Skip to content

nest-monorepo development

  1. Fill in apps/api/.env (database, Redis, BETTER_AUTH_SECRET, SMTP) and give apps/worker/.env the same DATABASE_URL and REDIS_*.

  2. Start Postgres and Redis, and wait until they accept connections:

    Terminal window
    yarn dc:up && yarn dc:wait
  3. Create the first migration and seed:

    Terminal window
    yarn db:migrate --name init
    yarn db:seed
  4. Run every app:

    Terminal window
    yarn dev # the API on http://localhost:5000/docs, plus the worker

From the root, turbo runs each across every workspace, building @scope/db first:

Terminal window
yarn build | typecheck | lint | test
yarn format

One workspace: yarn workspace @scope/api <script>, or the script from the app’s folder.

  1. Edit packages/db/prisma/schema/*.prisma.

  2. From the root or apps/api:

    Terminal window
    yarn db:migrate --name add_things

    This runs prisma migrate dev in @scope/db with the API’s .env, then rebuilds the client.

  3. Restart yarn dev, and run yarn typecheck from the root: it checks every app against the new client at once.

The API’s suites, as in nest-api, run from apps/api against compose.test.yml (ports 5499 / 6399):

Terminal window
cd apps/api
yarn test:dc:reinstall # once: test stack up, schema pushed, seeded
yarn test # unit
yarn test:e2e # e2e

Each app ships its own Claude Code skills in apps/<app>/.claude/skills/, and a root CLAUDE.md describes the workspace.

SkillShips withWhat it does
add-configEvery project

Add an environment variable to this API end to end — validated by the Zod config schema, mapped into the typed config, exposed through CustomConfigService, and documented in .env.example.

add-modelEvery project

Add or change a Prisma model in this API — the schema file, relations, enums, the migration, seed data — following the template's naming conventions.

add-resourceEvery project

Add a resource to this API — a Nest module with its controller, service, Zod DTOs and response entities, permission checks and tests — following the users module.

add-emailmail

Add a transactional email to this API — the job type, its data, a React Email template, the render step in the mail processor, the MailService method and its test double.

add-jobqueue

Add background work to this API with BullMQ — register a queue, produce jobs with retries, and consume them in a processor here or in a separate worker.

add-notificationnotifications

Add a new kind of in-app notification to this API — the NotificationType, its data shape, and dispatching it from the action that causes it.

add-realtime-eventrealtime

Add a Socket.IO event to this API — pushing a change to connected clients (a user, a room, a channel, everyone) or handling a message from them, with the right rooms and permissions.

SkillShips withWhat it does
add-workerqueue

Add a BullMQ queue consumer to this worker for a job the API produces — the queue name, a typed handler, registration and shutdown.

add-workflowtemporal

Add a Temporal workflow and its activities to this worker — durable, multi-step work the API starts by name (onboarding sequences, provisioning, refunds, anything that waits or must not half-happen).