InkApex docs
Guides

Adding a module

The pattern every feature follows, from table to typed client.

Copy apps/api/src/modules/projects:

  1. schema.ts: tables with an organizationId column.
  2. service.ts: every function takes the organization id and filters by it.
  3. routes.ts: build each route with route({ ..., access }), never createRoute. Access is public, user, organization with a scope, or admin.
  4. A test proving another organization gets a 404.

Then:

  • add its scopes to SCOPES and ROLE_SCOPES in src/lib/scopes.ts
  • export the schema from src/db/schema.ts, and mount the router in src/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.