Skip to Content
DocumentationGetting StartedIntroduction

Introduction

Gofasta is a Go backend toolkit that provides production-ready, independent packages for building backend services. It handles the infrastructure plumbing — authentication, caching, database setup, email, logging, middleware, and more — so you can focus on writing business logic. Every package is independent: use what you need, ignore the rest.

Gofasta is split into two parts:

  • gofastadev/gofasta  — A Go library of independent packages under pkg/. Each package (auth, cache, mailer, etc.) can be used on its own — there is no all-or-nothing dependency.
  • gofastadev/cli  — A globally installed CLI tool that scaffolds new projects, generates code, and deploys to remote servers. It does not import the library — it only manipulates files on disk.

What You Get

When you run gofasta new myapp, the CLI creates a complete, ready-to-run project with:

  • REST API with controllers, routes, and middleware (default)
  • GraphQL with schema files and auto-generated resolvers (opt-in via --graphql flag)
  • Database with migrations, seeders, and multi-DB support (Postgres, MySQL, SQLite, SQL Server, ClickHouse)
  • Authentication with JWT tokens and role-based access control (Casbin)
  • Dependency injection with Google Wire (compile-time, no reflection)
  • Background jobs — cron scheduling and async task queues
  • Email — SMTP, SendGrid, and Brevo with HTML templates
  • Observability — Prometheus metrics and OpenTelemetry tracing
  • Docker — Production Dockerfile and Docker Compose configuration
  • Deployment — One-command VPS deploy via gofasta deploy (Docker or binary over SSH), with generated systemd units and nginx reverse-proxy config
  • CI/CD — GitHub Actions workflow templates for testing, releasing, and deploying
  • A one-command dev loopgofasta dev boots db + cache + queue dashboard, runs migrations, and starts Air for hot reload. Press r mid-session to restart the whole stack from scratch, q to quit, h for help. Supports --all-in-docker for full-Docker mode, --dashboard for a live request inspector (trace waterfalls, EXPLAIN-on-click, panic history, HAR export), and --json for agent-readable structured events.
  • Agent-native tooling — every command honors --json, every error carries a stable code + remediation hint + docs link, and gofasta ai claude|cursor|codex|aider|windsurf installs per-agent configuration in one command.

A starter User resource is included so the project compiles and runs out of the box.

Architecture

Your project has a one-way dependency on the gofasta library:

Your Project (myapp) └── imports → github.com/gofastadev/gofasta/pkg/*

The library never imports your code. This means:

  • No vendor lock-in — you can replace any package with your own implementation
  • No code generation at runtime — Wire (and gqlgen, if GraphQL is enabled) run at build time
  • No reflection magic — all wiring is explicit Go code

Who Is This For

Gofasta is designed for Go developers who want to ship production backends quickly without assembling dozens of libraries manually. It is especially useful if you:

  • Want a full project structure from day one (not just a router)
  • Need REST, or both REST and GraphQL (via --graphql), in the same project
  • Want code generation that stays out of your way
  • Value compile-time safety over runtime magic

Next Steps

Last updated on