diff --git a/README.md b/README.md index 3ed8334..eee01d5 100644 --- a/README.md +++ b/README.md @@ -1,143 +1,149 @@ -# Rentease +# RentEase -![RentEase](assets/assets/icons/favicon-main.png) +Smart property management for short and mid‑term rentals: ingest bookings from +multiple sources, keep owners and guests in sync, and turn payments into clean +financial reporting. + +![RentEase Logo](assets/assets/icons/favicon-main.png) -- [Rentease](#rentease) - - [Features](#features) - - [Getting Started](#getting-started) - - [Prerequisites](#prerequisites) - - [Installation](#installation) - - [Built With](#built-with) - - [Roadmap](#roadmap) - - [Contributing](#contributing) - - [License](#license) - -Rentease is a property-management application to help landlords to manage your rental -properties efficiently. With Rentease, you can create invoices, generate activity -reports, and sync all the booking platforms you use. +- [Features](#features) +- [Visuals](#visuals) +- [Quick Start](#quick-start) +- [Configuration](#configuration) +- [Usage](#usage) +- [Development](#development) +- [Tech Stack](#tech-stack) +- [Project Layout](#project-layout) +- [Roadmap](#roadmap) +- [Contributing](#contributing) +- [Support](#support) +- [License](#license) +- [Status](#status) ## Features -- **Invoice Management**: Create and manage invoices for your rental properties - with ease. -- **Activity Reports**: Generate detailed reports of rental activities to keep track - of your property performance. -- **Platform Sync**: Sync bookings across multiple platforms to streamline your rental - management. +- **Invoice management**: Create and track invoices for each stay. +- **Activity reports**: Export booking and payment reports for owners and accountants. +- **Multi-platform sync**: Consolidate bookings from different channels. +- **Stripe automation (optional)**: Pull card payments from Stripe, validate webhooks, + and trigger manual syncs when needed. +- **PDF generation**: Produce guest-ready invoices and summaries. + +## Visuals ![RentEase Screenshot](assets/assets/img/booking_screenshot.png) -## Getting Started - -To get started with Rentease, follow these steps. +## Quick Start ### Prerequisites -You need a version of the Go programming language installed. You can either install -it via your package manager or via [Go's official website](https://go.dev/). -You also need a PostgreSQL database. You can install it locally using Homebrew or -use a cloud alternative such as Railway, fly.io, _etc._ +- Go (go.mod targets 1.25.4; use Go 1.22+ in practice) +- Docker + Docker Compose (for the recommended dev stack) +- PostgreSQL 14+ (Docker Compose starts one automatically) -### Installation +### Run with Docker Compose (recommended) -1. Clone the repository +```sh +git clone https://github.com/rjNemo/rentease.git +cd rentease +make dev +``` - ```sh - git clone https://github.com/rjNemo/rentease.git - cd rentease - ``` +This starts the app on `http://localhost:8000` with hot reload and a local +Postgres instance. -2. Install the dependencies +### Run locally without Docker - ```sh - go mod download - ``` +```sh +git clone https://github.com/rjNemo/rentease.git +cd rentease +go mod download +cp .env.example .env # create this file using the Configuration section below +go run . +``` -3. **Setup PostgreSQL**: - Ensure you have PostgreSQL installed and running. Create a database for Rentease: +Set `APP_PORT` (defaults to 4200) to change the listening port when running locally. - ```sh - createdb rentease - ``` +## Configuration -4. **Configure the application**: - Create a `.env` file in the project root with the following environment variables: +Configuration is driven by environment variables (parsed with the `APP_` prefix). +Minimum required variables: - ```sh - DB_HOST=localhost - DB_PORT=5432 - DB_USER=your_db_username - DB_PASSWORD=your_db_password - DB_NAME=rentease - # Stripe configuration (optional until you enable automatic sync) - APP_STRIPE_SECRET_KEY=sk_test_your_key - APP_STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret - APP_STRIPE_ACCOUNT_ID=acct_your_account_id - ``` +```sh +APP_DATABASE_URL=postgres://user:pass@localhost:5432/rentease?sslmode=disable +APP_ADMIN=admin@example.com +APP_ADMIN_SECRET=choose-a-strong-password +APP_API_KEY=your-api-key +APP_SECRET_KEY=signing-secret +APP_SESSION_SECRET=session-secret +APP_ORIGINS=http://localhost:8000 +# Optional +APP_PORT=8000 +APP_DEBUG=true +APP_LOG_LEVEL=debug +APP_STRIPE_SECRET_KEY= +APP_STRIPE_WEBHOOK_SECRET= +APP_SENTRY_DSN= +``` - Leave the Stripe variables blank to continue using manual cash entry only. When set, Rentease will pull payments from Stripe, process webhooks sent to `/webhooks/stripe`, and expose a manual sync endpoint at `POST /api/stripe/sync` (protected by the existing API key middleware). Providing `APP_STRIPE_ACCOUNT_ID` also enables dashboard links for synchronized card payments. +Stripe values can be left blank for manual payment entry only. +When provided, webhooks are received at `/webhooks/stripe` and a manual sync is +available at `POST /api/stripe/sync` (API key protected). -5. Start the application +## Usage - ```sh - make dev - ``` +- Start the stack (`make dev`) and open `http://localhost:8000`. +- Default dev credentials (from `docker-compose.dev.yml`): + - `admin@example.com` & `supersecret`. +- Create bookings, issue invoices, and review payments from the dashboard. -### Development Commands +## Development -Use the included Makefile for common tasks: +- `make dev` — run the dev stack with hot reload on `:8000`. +- `make test` — run `go test ./...`. +- `make format` — generate templ files and format Go + templ sources. +- `make lint` — run `golangci-lint`. +- `make run` — build and run the production image locally. +- `make stop` — shut down the dev stack. -- `make dev`: Run the dev container with live reload (Air) on `http://localhost:8000`. -- `make run`: Build and run the production image locally. -- `make test`: Run `go test ./...` inside the dev container. -- `make format`: Generate templ files and format code. -- `make lint`: Lint with `golangci-lint`. -- `make stop`: Stop the dev container. +## Tech Stack -6. **Access the application**: - Open your browser and go to `http://localhost:8000` to start using Rentease. +- Go backend with PostgreSQL +- [Templ](https://templ.guide/) for server-rendered components +- [htmx](https://htmx.org/) for dynamic interactions with minimal JavaScript +- [GORM](https://gorm.io/) for database access +- [Stripe](https://stripe.com/) integration for payment syncing -### Built With +## Project Layout -Rentease is built using the following technologies: - -- [Go](https://go.dev/): The core application logic is written in Go, providing a - robust and efficient backend. -- [Htmx](https://htmx.org/): For handling AJAX requests and enhancing the user interface - with minimal JavaScript. -- [Templ](https://templ.guide/): Used for templating and rendering dynamic HTML content. -- [Gorm](https://gorm.io/docs): An ORM library for Go, used for database interactions. -- [PostgreSQL](https://www.postgresql.org/):The database used to store all application - data. - -### Service Layout - -- `internal/service/booking`: booking lifecycle, items, reporting, and PDF generation. -- `internal/service/payment`: manual payments plus Stripe synchronisation and webhook handling. +- `internal/service/booking` — booking lifecycle, items, reporting, PDF generation. +- `internal/service/payment` — manual payments plus Stripe sync and webhook handling. +- `internal/view` — templ components (generate `_templ.go` files locally). ## Roadmap -See the [open issues](https://github.com/users/rjNemo/projects/2/views/1) for a full -list of proposed features (and known issues). +Track planned work and known issues on the [project board](https://github.com/users/rjNemo/projects/2/views/1). ## Contributing -Contributions are what make the open source community such an amazing place to learn, -inspire, and create. Any contributions you make are **greatly appreciated**. +Issues and pull requests are welcome! To propose a change: -If you have a suggestion that would make this better, please fork the repo and create -a pull request. You can also simply open an issue with the tag "enhancement". +1. Fork the repository. +2. Create a feature branch (`git checkout -b feature/amazing-idea`). +3. Run the test suite and linters (`make test`, `make lint`). +4. Open a PR describing your change and any setup notes. -Don't forget to give the project a star! Thanks again! +## Support -1. Fork the Project -2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) -3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) -4. Push to the Branch (`git push origin feature/AmazingFeature`) -5. Open a Pull Request +Need help or found a bug? Please open an issue in this repository with as much +context as possible (logs, steps, and expected behavior). ## License Distributed under the MIT License. See `LICENSE.md` for more information. + +## Status + +Active development.