Common commands
| Command | What it does |
|---|---|
pnpm install | Install all workspace deps |
pnpm run dev | Boot frontend + backend together (turbo run dev) |
pnpm run build | Build all apps |
pnpm run lint | Typecheck all apps |
pnpm db:up | Start local Postgres (Docker, detached) |
pnpm db:down | Stop local Postgres |
pnpm db:generate | Generate a Drizzle migration from schema changes |
pnpm db:migrate | Apply pending migrations |
pnpm db:push | Push schema directly (dev shortcut, skips migrations) |
pnpm db:studio | Open Drizzle Studio |
pnpm --filter frontend <script> or
pnpm --filter backend <script>.
Environment files
.env files are git-ignored. Commit .env.example-style docs instead if values
need sharing. The frontend reads NEXT_PUBLIC_API_URL; the backend reads
DATABASE_URL, Clerk keys, and CORS_ORIGIN.
Backend dev notes
Backend dev usestsx watch — no build step in dev.
pnpm --filter backend build emits to apps/backend/dist. Turbo caches
build and lint; dev and start are persistent and uncached.
Troubleshooting
EADDRINUSE :::3000 or :::4000
EADDRINUSE :::3000 or :::4000
A previous dev server is still holding the port. Free it with
lsof -nP -tiTCP:3000 -sTCP:LISTEN | xargs kill (swap the port as needed),
or change the -p flag in apps/frontend/package.json and update
CORS_ORIGIN to match.Turbopack cache corruption
Turbopack cache corruption
If the dev server panics with
Failed to restore task data or
Unable to open static sorted file ... .sst, the Turbopack disk cache was
corrupted (usually from an unclean shutdown). Delete the cache and restart:
rm -rf apps/frontend/.next. Stop dev servers with Ctrl-C rather than
kill -9 to avoid recurrence.