Quickstart
Create a Full app with organisations and run it on your machine. You need Go 1.26 or later and Docker.
-
Install
apsThe CLI isn't published yet, so install it from a checkout:
terminalgit clone https://github.com/apistockhq/apistock.git cd apistock/cli && go install ./cmd/aps && cd ../..If your shell then says
command not found: aps, add Go's bin directory to yourPATHwithexport PATH="$(go env GOPATH)/bin:$PATH"and open a new terminal. -
Create the app
terminalaps new acme-api --preset full --tenancy multi --local ./apistockLeave the flags out to be asked with arrow-key menus instead. Without
--tenancy multi, records belong to users rather than organisations. -
Start it
terminalcd acme-api aps devaps devcreates.env, starts PostgreSQL and Mailpit in Docker, applies migrations, runs seed data and starts the API, rebuilding when files change. The first run prints the administrator's password, authenticator app key and recovery codes once. They aren't saved anywhere, so keep them. -
Open it
What Where API reference http://localhost:8080/docsEmails sent in development http://127.0.0.1:8025Readiness http://127.0.0.1:8080/readyzUse
localhostrather than127.0.0.1for the docs if you try passkeys: browsers tie passkeys to a name, not an address. -
Add a resource
terminalaps gen resource Invoice number:string:unique 'status:enum(draft,sent,paid)' go run ./cmd/migrate go test ./...In a multi-tenant app the resource belongs to an organisation: endpoints under
/v1/orgs/{orgId}/invoices, a membership check in every use case, and tests proving that a member of another organisation gets a 404.
Without the CLI#
aps dev runs ordinary commands. From the app's directory:
cp .env.example .env
docker compose up -d --wait
go run ./cmd/migrate
go run ./cmd/seed
go run ./cmd/api
If port 5432 is taken, set POSTGRES_PORT in .env and the same port in DATABASE_URL.
Next#
- Organisations: members, roles, invitations and how data stays inside an organisation.
- Authentication: sign-up, sign-in, sessions, two-factor authentication and roles.
- Background jobs:
aps gen joband schedules you change at runtime. - CLI reference: every command and flag.