960 B
960 B
Rhythm Backend (Go)
Lean Go API backend structure for ISeeU Tracker.
General Folder Structure
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 inrepository. - Use
sqlxfor explicit SQL and scan helpers. - Use
goosefor schema versioning (up,down,status). - Prefer small packages and avoid over-abstraction early.