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
This commit is contained in:
Christoph Haas 2026-03-29 23:10:18 +02:00
parent 3200c42b29
commit c83d8ee6da

View file

@ -173,34 +173,54 @@ WantedBy=multi-user.target
- Go 1.21+ - Go 1.21+
- Bun (for frontend development) - Bun (for frontend development)
- sqlc (for database code generation)
- MariaDB/MySQL - MariaDB/MySQL
- Postfix (with postqueue/postsuper) - Postfix (with postqueue/postsuper)
- systemd-journald (for log viewing) - systemd-journald (for log viewing)
## Development ## 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 ```sh
make dev 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: Build the binary into the build/ directory:
```bash ```bash
# Build frontend and backend
make build make build
``` ```
Build only frontend or backend: Build only frontend or backend:
```sh ```sh
# Run backend only (uses filesystem frontend) make build-frontend
cd backend && go run ./cmd/server make build-backend
# Run frontend dev server
cd frontend && bun run dev
``` ```
## License ## License