Developer Docs

Local Setup

Install, run and check the monorepo locally.

Prerequisites

Use Node 20 or newer and pnpm 9.

corepack enable
corepack prepare pnpm@9 --activate
pnpm install

Environment

pnpm setup

The API uses port 4000. The web app uses port 3000. The docs app uses port 3001.

Set DATABASE_URL in .env to your local Mongo (see .env.example). Jobs run in-process locally — no Redis or separate worker process is required.

Run the app locally

pnpm infra:up    # Mongo on :27017
pnpm seed        # optional deterministic data
pnpm dev         # API + web

Open http://localhost:3000 and log in as test@together.agency / somepassword after seeding.

pnpm infra:down  # stop Mongo and wipe the volume

Other useful commands:

  • API health: http://localhost:4000/health
  • docs: pnpm dev:docs, then http://localhost:3001

Deploy (Vercel)

  1. Create two Vercel projects from this repo: one with root apps/web, one with root apps/api.
  2. Put the API project ID in apps/web/vercel.jsonrelatedProjects.
  3. Set shared env vars (DATABASE_URL, JWT_SECRET, AWS, GitHub) on both projects.
  4. Preview deployments automatically use database viz_preview_pr_<n> and seed it when empty.
  5. The API project needs Vercel Pro or Enterprise: visual-test consumers

run for up to 800s at 3008 MB (Hobby caps duration at 300s). Fluid Compute is on by default and is what those limits apply to. Do not set QUEUE_BACKEND=local on Vercel — it is ignored, and in-process jobs would not finish anyway.

Check your work

pnpm typecheck
pnpm docs:check

docs:check makes sure the generated API/model/contract reference is current and that every route has a JSDoc block for the docs.