Tier: Preview. Go is a preview stack — Archiet generates real, idiomatic Go and the output is boot-tested in CI, with cross-stack parity work ongoing relative to the four stable stacks (Flask, FastAPI, Django, NestJS). You get production-shaped code; treat it as a strong starting point rather than a runtime-certified release.
What generating a Go app from requirements produces
cmd/
server/
main.go # wiring: config, db pool, chi router, graceful shutdown
internal/
config/
config.go # reads os.Getenv; fails fast on missing DATABASE_URL
http/
router.go # chi.NewRouter(); middleware stack; route groups
middleware/
auth.go # JWT validation; injects user into request context
tenant.go # resolves workspace_id from the authenticated user
handler/
auth.go # POST /auth/login, /auth/register, /auth/refresh
{entity}.go # CRUD + paginated list per entity
store/
{entity}_store.go # sqlx queries; every read filtered by workspace_id
model/
{entity}.go # plain structs with db + json tags
migrations/
0001_init.up.sql # golang-migrate; one pair per schema change
Dockerfile # multi-stage; scratch/distroless final image
docker-compose.yml # api + postgres + redis
Makefile # make run, make test, make migrate
openapi.yaml
Go-specific patterns Archiet gets right
Idiomatic structs with db and json tags. No ORM. Models are plain structs mapped explicitly:
type Order struct {
ID string `db:"id" json:"id"`
WorkspaceID string `db:"workspace_id" json:"-"`
Status string `db:"status" json:"status"`
TotalCents int64 `db:"total_cents" json:"total_cents"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
}
Tenant-scoped queries via context, not URL params. Every store method takes the workspace_id resolved from the JWT — never from a path the caller can tamper with:
func (s *OrderStore) List(ctx context.Context, workspaceID string, page int) ([]Order, error) {
const q = `SELECT * FROM orders
WHERE workspace_id = $1
ORDER BY created_at DESC
LIMIT 25 OFFSET $2`
var orders []Order
err := s.db.SelectContext(ctx, &orders, q, workspaceID, (page-1)*25)
return orders, err
}
JWT in httpOnly cookies. Tokens are issued as HttpOnly; Secure; SameSite=Lax cookies. The auth middleware reads the cookie, validates the signature, and stores the user in context.Context. No tokens in response bodies for the browser to stash.
chi middleware stack, composed once. Request ID, real IP, structured logging (slog), panic recovery, CORS, and auth are composed in router.go so every route inherits them.
PostgreSQL only. The generated config.go fails fast if DATABASE_URL is missing or points at SQLite. Migrations run via golang-migrate, one versioned pair per change — no AutoMigrate.
What is included beyond the Go backend
- Next.js frontend — every screen from your manifest (auth, dashboard, settings, billing, per-entity CRUD)
- Docker — multi-stage build to a distroless/scratch image, plus
docker-compose.yml - Makefile + GitHub Actions —
go vet→golangci-lint→go test ./...→ build → deploy - Architecture docs — ADRs for each material decision under
docs/decisions/ - OpenAPI 3.1 spec — generated from your routes for client SDKs and gateways
Related
- Step-by-step walkthrough: Generate a production Go (chi) API from your PRD
- Template-oriented page: Go boilerplate generator
- All use cases: archiet.com/use-cases
FAQ
Does the generated Go app use an ORM?
No. Archiet generates idiomatic Go with sqlx over database/sql and explicit SQL. This keeps queries visible, fast, and debuggable — the Go community's preferred style over heavy ORMs like GORM.
Which router does it use?
chi (go-chi/chi). It is lightweight, net/http-compatible, and composes middleware cleanly. The generated router wires request ID, logging, recovery, CORS, auth, and tenant resolution.
How is multi-tenancy enforced?
Every store method requires a workspace_id resolved from the authenticated user's JWT and applies it as a WHERE workspace_id = $1 filter. The value never comes from a URL parameter.
Is the Go stack production-ready?
Go is a preview stack: the generated code is idiomatic and boot-tested in CI, with parity work ongoing versus the four stable stacks. Use it as a strong, real starting point and review before shipping to production.
CTA
Generate a complete Go (chi) + Next.js application from your requirements — free plan, no credit card.
Describe your product, pick Go, and download a production-shaped codebase in about 90 seconds.
Start free at archiet.com.