diff --git a/README.md b/README.md index dc5adec..d720264 100644 --- a/README.md +++ b/README.md @@ -173,34 +173,54 @@ WantedBy=multi-user.target - Go 1.21+ - Bun (for frontend development) -- sqlc (for database code generation) - MariaDB/MySQL - Postfix (with postqueue/postsuper) - systemd-journald (for log viewing) ## Development -Run development server that watches for file changes: +### Tool Requirements + +- [air](https://github.com/air-verse/air) for Go hot-reload: `go install github.com/air-verse/air@latest` +- [sqlc](https://sqlc.dev/) for SQL code generation: `go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest` + +### Running Development Server + +Start both frontend and backend with hot-reload: ```sh make dev ``` +This starts: +- **Frontend** on http://localhost:5173 (SvelteKit with HMR - frontend changes auto-reload) +- **Backend** on http://localhost:8080 (Go API with hot-reload) + +**During development, access the app at http://localhost:5173** - the Vite dev server proxies `/api` requests to the backend and enables instant frontend updates. + +### Running Servers Separately + +```sh +# Backend only (port 8080, serves frontend from frontend/build/) +make dev-backend + +# Frontend only (port 5173) +make dev-frontend +``` + +### Building + Build the binary into the build/ directory: ```bash -# Build frontend and backend make build ``` Build only frontend or backend: ```sh -# Run backend only (uses filesystem frontend) -cd backend && go run ./cmd/server - -# Run frontend dev server -cd frontend && bun run dev +make build-frontend +make build-backend ``` ## License