31 lines
960 B
Markdown
31 lines
960 B
Markdown
# Rhythm Backend (Go)
|
|
|
|
Lean Go API backend structure for ISeeU Tracker.
|
|
|
|
## General Folder Structure
|
|
|
|
```text
|
|
cmd/
|
|
api/
|
|
main.go # application entrypoint
|
|
|
|
internal/
|
|
config/ # env and app config
|
|
db/ # postgres/sqlx connection + tx helpers
|
|
http/ # router, middleware, handlers
|
|
auth/ # JWT, password hashing, auth middleware
|
|
service/ # business logic
|
|
repository/ # SQLx queries (no ORM)
|
|
model/ # domain models + request/response DTOs
|
|
|
|
migrations/ # Goose SQL migrations
|
|
scripts/ # optional local/dev scripts
|
|
```
|
|
|
|
## Notes
|
|
|
|
- Keep handlers thin, business logic in `service`, SQL in `repository`.
|
|
- Use `sqlx` for explicit SQL and scan helpers.
|
|
- Use `goose` for schema versioning (`up`, `down`, `status`).
|
|
- Prefer small packages and avoid over-abstraction early.
|