Skip to content

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

  1. Start the backend services:
bash
pnpm dev:backend
  1. In a separate terminal, start the Next.js dev server:
bash
pnpm dev:web

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

VariableValueDescription
NEXT_PUBLIC_GRAPHQL_SCHEMAhttp://localhost:8888/api/graphqlGraphQL endpoint via API Gateway
NEXT_PUBLIC_API_URLhttp://localhost:8888/api/v1REST API endpoint via API Gateway
MAIN_DB_CONNECTION_STRINGpostgresql://postgres:postgres@127.0.0.1/mainDirect Postgres connection
OTEL_EXPORTER_OTLP_ENDPOINThttp://localhost:18889OpenTelemetry — 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