Skip to content

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 install

Environment Variables

Copy the root example file and fill in the required values:

bash
cp .env.example .env

See 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=development

Cloud service credentials (R2, Rekognition, Resend, Stripe) are optional — workers skip gracefully when they are not configured.

Start Infrastructure

bash
docker compose up postgres redis -d

This starts Postgres on port 5432 and Redis on port 6379.

Run Migrations

bash
pnpm --filter=@repo/db db:migrate

Start All Apps

bash
pnpm turbo dev

This starts all five apps in parallel with watch mode:

AppURL
backoffice-apihttp://localhost:3001
main-apihttp://localhost:3002
media-apihttp://localhost:3003
backoffice-webhttp://localhost:4001
main-webhttp://localhost:4002

Start a Single App

bash
pnpm turbo dev --filter=@repo/media-api

Database

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:studio

WARNING

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 workspaces

TIP

Always use pnpm. Never run npm or yarn commands in this repo.

Acme Photo Platform — Internal Documentation