Prepared stock
for Go APIs.
The app a careful senior Go engineer would have set up. Postgres, sign-in with 2FA and passkeys, organisations, jobs and ops endpoints, written into your repo. You own every file.
$git clone https://github.com/apistockhq/apistock.git && cd apistock/cli && go install ./cmd/aps
$ aps new acme-api --preset full --tenancy multi creating acme-api in ./acme-api preset full · tenancy multi · library ../apistock ✓ ran go mod tidy ✓ initialised git created acme-api api docs http://localhost:8080/docs emails http://127.0.0.1:8025 next: cd acme-api aps dev $
It makes the calls, and says what each one costs.
You're not picking a router, a migration tool and an auth library on day one. Each choice below has a written record you can read before you commit.
One SQL file per query.
More files than a query builder. Each one is a query you can read in review and explain in production.
ADR-0032Auth is a library. The flows are yours.
Security fixes reach you with go get. Sign-up, sign-in and 2FA flows live in your repo, so you maintain what you change.
Tenancy is chosen at creation.
Moving from single to multi-tenant with a command waits for aps add orgs in v0.5.
Settings live in Postgres.
Change them without a deploy through /ops/settings. Secrets stay in the environment, never in the table.
From an empty folder to a running API.
Four commands. Each one ends by naming the next, and generators add one line at a named anchor instead of rewriting your files.
aps new acme-apiCut the stock
Pick a preset and tenancy. You get a repository, not a dependency to wrap.
aps devStart it locally
Postgres and Mailpit in Docker, migrations and seed data, the admin's password printed once.
aps gen resource InvoiceAdd what you sell
Four layers, one SQL file per query, and tests proving another organisation gets a 404.
go build ./cmd/apiShip one binary
Migrations run under an advisory lock. Release tracking shows which build every instance runs.
Your code on top. Seasoned libraries underneath.
The generated app owns its flows, tables and SQL. The modules hold the parts that need security fixes and careful maintenance.
acme-api/ ├── cmd/api main and commands ├── db/migrations forward-only SQL ├── internal/app wiring, permissions ├── internal/modules/ │ ├── auth yours: flows, SQL │ ├── orgs yours: members, invites │ └── projects yours: example resource ├── api/openapi.json checked in, diffed └── apistock.lock recipe and version
authargon2id, sessions, TOTP, passkeys, Google and AppleorgsOrganisation IDs, the membership check, invitation emailjobsRiver workers with schedules you change at runtimesettingsTyped runtime settings, live on every instanceauditpgAppend-only audit log with redactionopenapiHuma, problem errors and the /docs referencepostgresPool, transactions and goose migrationsreleasesWhich build every instance is runningYour app keeps working if apistock disappears.
Two kinds of docs, one system.
The framework has its own site. Every app you generate serves its own API reference, in its own name.
Start from stock, not from scratch.
One command gives you the parts a production Go API needs. What you build on it is yours.