Environment
Every variable, which app reads it, and what is frozen at build time.
What you do here: know what to set, and where setting it is not enough. Config enters the
server once, at boot: the composition root reads the environment and builds the Config
that the rest of the code receives. No layer reaches for process.env in the middle of an
operation.
Server (runtime)
| Variable | Required | What it does |
|---|---|---|
DATABASE_URL | yes | The application schema (Prisma) and the workflow world |
API_URL | yes | The API's public URL — it is the auth baseURL and where the OAuth callback lives |
ADMIN_URL | yes | The web app's public URL. It is the trusted origin, the CORS origin and where the login redirects to |
AUTH_SECRET | yes | Signs the sessions. openssl rand -base64 32 |
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET | no | Filled in, Google login appears; empty, it stays off |
PORT | no | The API's port (default 3000) |
WORKFLOW_POSTGRES_URL | no | Points the workflow schema at another database. Absent, it falls back to DATABASE_URL |
RENDER_* | no | The render's caps — see The render |
Web (build time)
VITE_API_URL — the API's URL. The SPA has no server of its own, so this is baked into the
bundle: changing it requires rebuilding the image, not just restarting it.
Landing (build time)
All five are public values of the sales page, and all are baked at build: NEXT_PUBLIC_SITE_URL,
NEXT_PUBLIC_CHECKOUT_URL, NEXT_PUBLIC_REPO_URL, NEXT_PUBLIC_CONTACT_EMAIL,
NEXT_PUBLIC_PRICE. Empty ones fall back to sensible defaults — the landing never breaks for
lack of them.
Database package
packages/db/.env carries DATABASE_URL for the Prisma CLI. It is what
pnpm --filter @package/db push reads — which is why the one-shot migrate container has it.
What is not in the environment
Storage. Endpoint, region, bucket and credential are per organization and live in the database, configured in Settings › Storage — which is what allows two organizations on the same install to have different buckets.
What is worth knowing
.env.examplein each app is the source of truth, and it documents what the code really reads.docker-compose.yamlfills the containers from the repository root.env— see Deploy.VITE_API_URLandNEXT_PUBLIC_*are the two families that survive a restart but not a rebuild — if the address of the API changed,--buildis part of the fix.
Related
- Deploy — the
.envand.env.vpsfiles, and how they are used. - Database — what
DATABASE_URLis used for beyond the app schema. - Running kino — the same variables, with values that work.