Guides
Adding a module
The pattern every feature follows, from table to typed client.
Copy apps/api/src/modules/projects:
schema.ts: tables with anorganizationIdcolumn.service.ts: every function takes the organization id and filters by it.routes.ts: build each route withroute({ ..., access }), nevercreateRoute. Access ispublic,user,organizationwith a scope, oradmin.- A test proving another organization gets a 404.
Then:
- add its scopes to
SCOPESandROLE_SCOPESinsrc/lib/scopes.ts - export the schema from
src/db/schema.ts, and mount the router insrc/app.ts - generate the migration:
pnpm --filter @makev1/api db:generate --name <change> - regenerate the contract and the client
A guardrail test fails on a route without an access rule, or a public route nobody has listed with a reason.
For the dashboard page, copy apps/app/src/app/(app)/projects/page.tsx and add a line to components/shell/nav.ts.