Problem
Three separate security violations exist:
src/config/database.config.ts:12 falls back to the hardcoded string 'adetomi' for DATABASE_PASSWORD
src/modules/auth/auth.module.ts:21 falls back to 'your-secret-key' for JWT_SECRET
.env.example contains real credentials: a live Neon DB password and a Cloudinary API secret
The app starts silently in an insecure state when required env vars are missing, with no error or warning to the operator.
Proposed Solution
- Add a Joi validation schema to
ConfigModule.forRoot({ validationSchema: ... }) listing every required env variable
- Set
validationOptions: { abortEarly: false } so all missing vars are reported at once
- Remove all hardcoded fallback strings for secrets
- Replace all real credential values in
.env.example with your_value_here placeholders
- Rotate any exposed credentials immediately
Acceptance Criteria
Problem
Three separate security violations exist:
src/config/database.config.ts:12falls back to the hardcoded string'adetomi'forDATABASE_PASSWORDsrc/modules/auth/auth.module.ts:21falls back to'your-secret-key'forJWT_SECRET.env.examplecontains real credentials: a live Neon DB password and a Cloudinary API secretThe app starts silently in an insecure state when required env vars are missing, with no error or warning to the operator.
Proposed Solution
ConfigModule.forRoot({ validationSchema: ... })listing every required env variablevalidationOptions: { abortEarly: false }so all missing vars are reported at once.env.examplewithyour_value_hereplaceholdersAcceptance Criteria
npm startfails with a clear, specific error listing missing env vars.env.examplecontains zero real credential valuesDATABASE_*,JWT_SECRET,CLOUDINARY_*,REDIS_*,THROTTLE_*