01
api-template
api-template/.env. Consumed by the Bun process directly when running outside Docker.
Environment variables
Each repo has its own .env.example for the vars it consumes. This page maps
which repo owns a variable, why it exists, and which .env.example has the
full reference.
4
config files
Strict
env validator
Prod-only
guards
01
api-template/.env. Consumed by the Bun process directly when running outside Docker.
02
ui-template/.env.local. Consumed by Vite at build and dev time (VITE_* only).
03
compose/.env in the infra-docker-compose-template folder. Injected into the api and ui dev containers.
04
compose/.env + compose/api.prod.env. Prod profile uses a separate api env file.
Repo: api. Required: yes. Values development, production, or
test; gates prod-only invariants.
Repo: api. Required: no (default API Template). Public-facing
identity used in email From-names, OAuth consent metadata, and the OpenAPI
document title.
Repo: api. Required: no. One of debug, info, warn, error.
Repo: api. Required: no. Empty means the SDK is a no-op.
Repo: api. Required: no. Range 0 to 1, default 0.1.
Repo: ui. Required: no. Same wire protocol as Sentry or GlitchTip.
Repo: api. Required: yes. Postgres connection string.
Repo: api. Required: no. Default true. Keep it true in production
so Postgres TLS is verified instead of merely encrypted.
Repo: api. Required: no. Optional PEM CA bundle for production Postgres providers that use a private CA.
Repo: api. Required: yes when queues or cache use Valkey. Defaults
localhost and 6379.
Repo: api. Required: in production when queues, Valkey cache, notification SSE, or OAuth is on.
Repo: api. Required: no. Default 0.
Repo: api. Required: no. false uses noop; providers include
memory and valkey.
Repo: api. Required: no. When false, dispatch falls back to inline
execution.
Repo: api. Required: no. Enables the live notification stream.
true requires Valkey because API instances coordinate through pub/sub.
Repo: api. Required: yes (32+ chars). Signs the 15-minute access cookie and hashes refresh tokens. Rotation forces every user to sign in again.
Repo: api. Required: yes. App origin used for OAuth success redirects and Stripe return-url allowlisting.
Repo: api. Required: yes. Public URL used to build OAuth callback URLs. Same-origin default is the frontend origin; cross-origin setups use the API origin.
Repo: api. Required: no (default empty). CSV. Empty means same-origin deployment (default); CORS is not mounted. When set, every origin must be HTTPS with no wildcards.
Repo: api. Required: no (default empty). Optional first-boot
superuser. Both set means db:seed creates an admin user on first run.
Empty means no-op; register via the UI instead.
Repo: api. Required: when Google OAuth is enabled.
Repo: api. Required: when GitHub OAuth is enabled.
Repo: api. Required: when LinkedIn OAuth is enabled.
Repo: api. Required: no (defaults 100 / 60000ms). Per-IP global rate limit; defence-in-depth alongside Traefik’s edge limit.
Repo: api. Required: no (defaults 10 / 60000ms). Stricter per-IP
limit applied to every /api/v1/auth/* route. Tightens the global default
for the credential-stuffing surface.
Repo: api. Required: no (default false in api-template
.env.example). When true, exposes /api/v1/auth/__test/* helpers
outside NODE_ENV=test. Docker Compose dev defaults this to true via
API_DEV_E2E_TEST_ENDPOINTS_ENABLED for Playwright — keep false in prod.
Repo: api. Required: always set. One of cloudflare (default),
resend, sendgrid, or smtp.
Repo: api. Required: always. Sender on a verified domain.
Repo: api. Required: when provider is cloudflare.
Repo: api. Required: when provider is cloudflare. Scope Email Sending: Edit.
Repo: api. Required: when provider is resend.
Repo: api. Required: when provider is sendgrid.
Repo: api. Required: when provider is smtp. Use mailpit against
the dev overlay; any RFC 5321 server in prod.
Repo: api. Required: when provider is smtp. Default 25; Mailpit listens on 1025.
Repo: api. Required: optional. Auth when the server requires it.
Repo: api. Required: no. Optional http(s) link rendered in notification email footers.
Repo: api. Required: no (defaults false). When true, the first
verified signup with a non-public email domain claims that domain on its
personal account; subsequent signups from the same domain hit
DOMAIN_CLAIMED (409) and must be invited through the standard invitations
flow. The public-email allowlist (gmail.com, outlook.com, etc.) is
hard-coded. Those domains always get fresh personal accounts. Leave off for
consumer products. See Multi-tenant model → Domain
claiming.
Repo: api. Required: no. When true, Stripe keys are required.
Repo: api. Required: when billing is on.
Repo: api. Required: when billing is on.
Repo: api. Required: when billing is on. Used to upsert the template’s Free and Pro plans at runtime.
Repo: api. Required: no.
Repo: api. Required: when AI is on. One of openai, anthropic, or
noop.
Repo: api. Required: when AI provider is openai.
Repo: api. Required: no. Point at OpenAI-compatible APIs (OpenRouter, Ollama, vLLM).
Repo: api. Required: no. Optional JSON object of extra headers
passed on every OpenAI client request. Useful for OpenRouter ranking
(HTTP-Referer, X-Title) or for custom auth on a compatible endpoint.
Empty means no extra headers.
Repo: api. Required: when AI provider is anthropic.
Repo: ui. Required: no (default empty). API base URL. Empty means
same-origin (/api/* relative). Set a full HTTPS URL only for cross-origin
deployments.
Repo: ui. Required: no. CSV of locale codes; first entry is the fallback.
Repo: ui. Required: yes (default http://localhost:3001). Public SPA
origin used for billing return URLs, SEO, and share links. In same-origin
deploys this matches the browser origin; cross-origin setups still need the
UI’s public URL here (not the API host).
Repo: ui. Required: no (default empty). Web Push public key. Must be
the same value as API WEB_PUSH_VAPID_PUBLIC — generate both sides together
with bun run vapid:generate in api-template. Empty hides the subscribe UI;
the API also exposes capabilities.features.notifications.webPush.
Repo: infra. Required: yes. dev or prod.
Repo: infra. Required: yes. Postgres bootstrap credentials.
Repo: infra. Required: yes in prod. Apex DNS name for Traefik.
Same-origin path routing serves both UI and /api/* from this single host.
Repo: infra. Required: yes in prod. Let’s Encrypt contact address.
Repo: infra. Required: when observability overlay is on.
Repo: infra. Required: no. Per-service resource caps; see Resource limits.
Repo: infra. Required: no. Overlay toggles.
Repo: infra. Required: when backups are configured.
Repo: infra. Required: no. Default 30.
Repo: infra. Required: no. 1 means the script logs but does not
act.
The sections above are an index. For defaults, comments, and per-var reasoning: