Guides
Each guide walks one task end to end in a scaffolded Gofasta project: what the CLI generates, what the generated code does, and where to change it. They assume you have already worked through Getting Started.
Building the API surface
- Building REST APIs with chi — Controllers, routes, DTOs, middleware, and the response helpers every generated endpoint uses.
- Building GraphQL APIs with gqlgen — Schemas, resolvers, queries, mutations, and subscriptions alongside (or instead of) REST.
- Code Generation — Using the CLI to generate models, services, controllers, and full scaffolds, and how the generated files get wired into the container and routes.
Data and access
- Database & Migrations — Database setup, GORM models, migration pairs, multi-driver support, and relationships.
- Authentication — JWT login and registration flows, auth middleware, Casbin RBAC, and token refresh.
- Configuration —
config.yaml, environment-variable overrides, and the database, JWT, Redis, and feature-flag sections.
Work that happens off the request path
- Background Jobs — Cron scheduling, async task queues, job definitions, and recurring work.
- Email & Notifications — SMTP, SendGrid, and Brevo delivery, HTML templates, and the notification channels.
Verifying and shipping
- Testing — Test layout, testcontainers-backed integration tests, mocking, and the
testutil/testdbhelper. - Debugging — The local dev dashboard: trace waterfalls, per-request logs, N+1 detection, EXPLAIN plans, pprof, and replay.
- Deployment — Ship to a VPS with
gofasta deploy— Docker or compiled binary over SSH, with systemd, nginx, and GitHub Actions wired up.
Related sections
- CLI Reference — The command-by-command detail behind every step in these guides.
- Package Library — API documentation for the
pkg/*packages the generated code imports.
Last updated on