Skip to main content

Configuration

No .env file is required to boot the api or web app locally — both have code-level defaults for local development. This page lists what each var controls and its default, sourced from apps/api/src/common/config/default.ts, apps/api/.env.example, and apps/web/.env.example.

apps/api

VariableDefaultNotes
NODE_ENVlocalControls TypeORM synchronize — on for local/development, off for staging/production. See Architecture.
PORT8085 in code (default.ts); .env.example overrides to 8087 to match make dev-apiThe port the NestJS server listens on.
CLIENT_URLhttp://stackdoc.localhost:5173CORS origin and GitHub OAuth callback base.
DATABASE_URLpostgresql://postgres:postgres@localhost:5432/stackdoc-dbMatches make infra's bundled Postgres out of the box.
JWT_SECRETstackdoc-dev-secret-change-in-productionDev-only fallback — set a real secret for any non-local deployment.
JWT_EXPIRES_IN7dToken lifetime.
GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRETemptyRequired for GitHub OAuth sign-in to work; unset disables sign-in, not the rest of the app.
GITHUB_CALLBACK_URLhttp://stackdoc.localhost:8087/auth/github/callbackMust match one of the OAuth app's explicit registered callback URLs in GitHub — one per environment, wildcard matching off.

apps/web

VariableDefaultNotes
VITE_API_URLhttp://stackdoc.localhost:8087The api lives on its own subdomain (not a path under the web app), so this must be an absolute URL — set per environment (e.g. https://stackdoc-api.kazuki.uk in prod). Baked in at build time, like all Vite env vars.
VITE_DOCS_URLhttp://stackdoc.localhost:3001The docs site lives on its own subdomain (not a path under the web app), so this must be an absolute URL — set per environment (e.g. https://stackdoc-docs.kazuki.uk in prod). Baked in at build time, like all Vite env vars.

Prod schema note

Production (NODE_ENV=production) has TypeORM synchronize off and no migration scripts — its schema exists from an earlier one-off bootstrap, not a repeatable mechanism. See Architecture and the project's internal notes for the open risk this carries for a from-scratch prod database.