Setup & Development
Prerequisites
- Node.js 22+
- pnpm 9.12+
- Docker (for local Postgres and Redis)
Installation
bash
git clone <repo-url>
cd acme-photo-platform
pnpm installEnvironment Variables
Copy the root example file and fill in the required values:
bash
cp .env.example .envSee Environment Variables for a full description of each variable.
At minimum for local development you need:
env
DATABASE_URL=postgresql://acme:acme@localhost:5432/acme_photo
REDIS_URL=redis://localhost:6379
JWT_SECRET=<random string, at least 32 characters>
NODE_ENV=developmentCloud service credentials (R2, Rekognition, Resend, Stripe) are optional — workers skip gracefully when they are not configured.
Start Infrastructure
bash
docker compose up postgres redis -dThis starts Postgres on port 5432 and Redis on port 6379.
Run Migrations
bash
pnpm --filter=@repo/db db:migrateStart All Apps
bash
pnpm turbo devThis starts all five apps in parallel with watch mode:
| App | URL |
|---|---|
| backoffice-api | http://localhost:3001 |
| main-api | http://localhost:3002 |
| media-api | http://localhost:3003 |
| backoffice-web | http://localhost:4001 |
| main-web | http://localhost:4002 |
Start a Single App
bash
pnpm turbo dev --filter=@repo/media-apiDatabase
bash
# Generate a migration after a schema change
pnpm --filter=@repo/db db:generate
# Apply migrations
pnpm --filter=@repo/db db:migrate
# Open Drizzle Studio (local DB browser)
pnpm --filter=@repo/db db:studioWARNING
Never hand-edit files in packages/db/migrations/. Always use db:generate after schema changes.
Common Commands
bash
pnpm turbo build # build all packages and apps
pnpm turbo typecheck # tsc --noEmit across all workspaces
pnpm turbo lint # eslint across all workspaces
pnpm turbo test # vitest across all workspacesTIP
Always use pnpm. Never run npm or yarn commands in this repo.