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:
parent
3200c42b29
commit
c83d8ee6da
1 changed files with 28 additions and 8 deletions
36
README.md
36
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue