Clean Go backend project structure. Good for APIs, microservices, internal tools. No framework, just net/http, pgx, sqlc.
Folders:
cmd/your-project β entry point (main.go)
internal/api/ β handlers/controllers
internal/auth/ β JWT and auth logic
internal/database/ β DB setup (e.g sqlc)
internal/middleware/ β custom middleware (e.g. auth)
internal/models/ β data models
internal/routes/ β route definitions
internal/utils/ β common helpers
scripts/ β test/dev/bash scripts
sql/queries/ β raw or sqlc SQL queries
sql/schema/ β DB migration files
static/ β static frontend assets (HTML/CSS/JS)
.env β environment variables
Simple. Scalable. Easy to start.