You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a platform engineer, I want the application to validate all required environment variables at startup and fail fast with a clear error so that misconfigured deployments are caught immediately rather than producing cryptic runtime failures.
Context
ConfigModule.forRoot() is called without a validation schema. If JWT_SECRET, DATABASE_PASSWORD, ALLOWED_ORIGIN, or other required vars are absent, the app boots silently and fails at the first usage — often in a way that's hard to trace back to a missing env var.
Acceptance Criteria
ConfigModule.forRoot() includes a Joi validationSchema covering all required and optional env vars
App refuses to start if any required variable is missing, logging which variable is absent
Optional variables have sensible defaults declared in the schema (not scattered across service files)
.env.example updated to document every variable in the schema
Tech Story
As a platform engineer, I want the application to validate all required environment variables at startup and fail fast with a clear error so that misconfigured deployments are caught immediately rather than producing cryptic runtime failures.
Context
ConfigModule.forRoot()is called without a validation schema. IfJWT_SECRET,DATABASE_PASSWORD,ALLOWED_ORIGIN, or other required vars are absent, the app boots silently and fails at the first usage — often in a way that's hard to trace back to a missing env var.Acceptance Criteria
ConfigModule.forRoot()includes a JoivalidationSchemacovering all required and optional env vars.env.exampleupdated to document every variable in the schemaJWT_SECRET,JWT_REFRESH_SECRET,DATABASE_HOST,DATABASE_PORT,DATABASE_USER,DATABASE_PASSWORD,DATABASE_NAME,REDIS_HOST,REDIS_PORT,PORT,ALLOWED_ORIGIN,NODE_ENV,USE_REDIS_CACHE,FRONTEND_URLTechnical Elaboration
joiConfigModule.forRoot():process.env.X || 'default'patterns inmain.tsin favour ofConfigService.get()with typed defaults from the schemaNotes
.env.test) must also satisfy the schema or useignoreEnvVarsfor test-specific overridesJWT_SECRETminimum length of 32 chars enforced at the Joi level prevents weak secrets in dev