Environments
Environment loading is implemented in backend/src/environments.ts.
Runtime modes
Section titled “Runtime modes”development: loads dotenv files in a strict order.production: does not load dotenv files; expects platform-managed env vars.
This project does not use a single local file. Local development can resolve from four files, in precedence order: .env, .env.development, .env.local, .env.development.local.
Development file precedence
Section titled “Development file precedence”When NODE_ENV resolves to development, files are read in this order:
.env.env.development.env.local.env.development.local
Existing process variables are not overwritten.
Key environment variables
Section titled “Key environment variables”PORTDATABASE_URLJWT_SECRETJWT_EXPIRES_INBCRYPT_SALT_ROUNDSGOOGLE_CLIENT_IDOPENAI_API_KEY(or compatibility aliasOPEN_AI_API_KEY)RATE_LIMIT_WINDOW_MS,RATE_LIMIT_MAX_GLOBAL,RATE_LIMIT_MAX_AUTH,RATE_LIMIT_MAX_API
Test bootstrap defaults
Section titled “Test bootstrap defaults”backend/src/setup-env.ts sets safe defaults for tests, including local test DB URL and fallback JWT secret.