From c83d8ee6da7a2ea17d0459dcac4736fdce4da4b9 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Sun, 29 Mar 2026 23:10:18 +0200 Subject: [PATCH] Update README with clear development setup documentation - Document tool requirements (air, sqlc) with install commands - Explain that 'make dev' starts both servers - Clarify which port to use (5173 for frontend dev, 8080 for backend) - Document separate server commands - Consolidate requirements sections --- README.md | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) 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