Goal: in a few minutes you have the API running and a valid JSON response.
Requirements#
- Go API configured (
apps/api/.env.local) - Postgres with migrations applied
- Node monorepo only if you will call from Next
Full clone → install → env → migrate → app flow: Local development.
By default the API listens on port 8080 (adjust for your env).
Step 1 — Health (public)#
No secrets required.
Expected response (conceptual shape):
There is also GET /api/health/ready for readiness (depends on the DB).
Step 2 — Authenticated call (dev)#
Almost every product route goes through:
- User identity — Better Auth Bearer session only (
Authorization: Bearer <session token>). - Profile —
:studioIdpath + membership (on domain routes).
Details: Authentication.
Example: list the user's profiles (requires user auth):
Step 3 — A domain mutation#
With a valid studioId, create a task (exact fields per OpenAPI / the TS client):
Full guide: Create a task.
Step 4 — From Next (the real monorepo path)#
In the product you do not call Go from the browser. The flow is:
See From Next.js.
Aha moment checklist#
-
/api/healthreturns 200 - You list profiles with your user
- You create or read a resource in a profile
- You know how to read
error.codeandrequest_idon failures
Next#
| If you want to… | Go to… |
|---|---|
| Understand auth | Authentication |
| Money/date format | Conventions |
| Explore every endpoint | OpenAPI reference (sidebar) |