Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
Environment schema — one declaration, clear startup report
Goal: one schema in @carbon/env, a grouped startup report, and no Vercel- or
Supabase-specific names in app logic — without changing what any deployment has
to set. Audit taken at 59ed755d52, re-verified at c1b539854c.
Rules that keep every deployment booting
- New names fall back to old ones, inside
@carbon/envonly. - The report lists everything, but only exits on what exits today
(
SUPABASE_SERVICE_ROLE_KEY,SUPABASE_DB_URL,SESSION_SECRET,REDIS_URL,INNGEST_SIGNING_KEY/INNGEST_EVENT_KEYunlessINNGEST_DEV). Newly required variables are warnings for one release. - A test pins what each real deployment sets and asserts no startup error.
- A derived OAuth callback never overrides a variable that is set.
PR 1 — schema, reporter, aliases (no behaviour change)
-
packages/env/src/schema.ts: every variable once (type, group, description, secret, browser, required level, aliases) -
packages/env/src/validate.ts:validateEnv+formatReport, pure -
index.tsreads through the schema; named exports unchanged -
APP_URL(←VERCEL_URL),APP_ENV(←VERCEL_ENV),DATABASE_URL(←SUPABASE_DB_URL); old exports stay -
Window.envtype andgetBrowserEnv()checked against the browser flag - Reporter tests + deployment test (SST,
crbn up) - Deployment test for Vercel (
carbonandmesprojects, names read with the Vercel CLI on 2026-10-07) - Deployment test for the BYOC chart — the chart is not in this repository
PR 2 — move direct process.env reads
- The direct-only variables into the schema (AI, Resend, Inngest URLs,
QuickBooks/Xero redirect,
GIT_COMMIT_SHA, sweep and dev variables) - Call sites off
VERCEL_URL/VERCEL_ENVontoAPP_URL/APP_ENV - One
DATABASE_URLprecedence inpackages/checksandpackages/database - Derive the four live OAuth callbacks from the ERP origin when unset
-
packages/dev/src/env.tsandsst.config.tswrite the new names - Biome
noProcessEnvwith the exempt list
PR 3 — housekeeping
- Generate
.env.examplefrom the schema + a staleness check - Build-affecting variables in
turbo.json - Remove dead exports; move non-env constants out of the env file
Follow-up release
- Flip
required: "warn"and half-configured features to startup errors - Remove aliases:
VERCEL_URL,VERCEL_ENV,SUPABASE_DB_URL,OPENAI_API_KEY,VERCEL_GIT_COMMIT_SHA, the old QuickBooks webhook name