Web
The web app is a Next.js application that runs outside Docker during local development. It connects to backend services running in Docker Compose.
Setup
- Start the backend services:
bash
pnpm dev:backend- In a separate terminal, start the Next.js dev server:
bash
pnpm dev:webThe dev server starts at http://localhost:3000 with hot module replacement and fast refresh.
Environment Variables
The web app loads environment variables from apps/web/.env.development at dev time. This file points to the local backend services:
| Variable | Value | Description |
|---|---|---|
NEXT_PUBLIC_GRAPHQL_SCHEMA | http://localhost:8888/api/graphql | GraphQL endpoint via API Gateway |
NEXT_PUBLIC_API_URL | http://localhost:8888/api/v1 | REST API endpoint via API Gateway |
MAIN_DB_CONNECTION_STRING | postgresql://postgres:postgres@127.0.0.1/main | Direct Postgres connection |
OTEL_EXPORTER_OTLP_ENDPOINT | http://localhost:18889 | OpenTelemetry — see Observability |
TIP
Build-time environment variables (Sanity tokens, App Insights keys, etc.) are only needed in CI/CD and are injected via Key Vault. See CI/CD Docker Builds for details.
Why Not Docker?
The web app runs natively rather than in Docker for several reasons:
- Fast refresh -- Next.js HMR is significantly faster without Docker's filesystem layer
- Build-time env vars -- Next.js bakes environment variables at build time, making container-based dev cumbersome
- Frontend tooling -- Debuggers, browser DevTools, and IDE integrations work better with a native dev server