trexi is a pnpm + Turborepo monorepo. You’ll need Node 20+ and Docker (for local Postgres).
1

Install dependencies

pnpm install
2

Start Postgres

Local Postgres 16 runs in Docker:
pnpm db:up
The connection string lives in apps/backend/.env as DATABASE_URL (postgres://trexi:trexi@localhost:5432/trexi).
3

Apply migrations

pnpm db:migrate
4

Boot the apps

Run the frontend and backend together:
pnpm run dev
Run only one pnpm run dev at a time. If it fails with EADDRINUSE :::3000 (or :4000), a previous dev server is still holding the port — free it with lsof -nP -tiTCP:3000 -sTCP:LISTEN | xargs kill.

Services & ports

AppURLNotes
frontendhttp://localhost:3000Next.js dev server (Turbopack)
backendhttp://localhost:4000Express; /api/health, /api/orgs/sync, /api/orgs/me
postgreslocalhost:5432Docker (pnpm db:up); db/user/pass all trexi
The frontend calls the backend via NEXT_PUBLIC_API_URL; the backend allows the frontend origin via CORS_ORIGIN. Keep these in sync if you change ports.