Configuration Manager
When to Trigger
- •Environment changes
- •"Add config for [service]"
What to Do
- •Central config: Single module (e.g. lib/config.ts or config/index.ts) exporting typed object from process.env (app, database, stripe, email, etc.).
- •Types: Use
as constor explicit types so config is type-safe. - •Validation: On startup, validate required env vars with Zod (or similar); log clear errors and exit if invalid.
- •Secrets: Never commit secrets; use .env.example with placeholder keys only.
Document new vars in .env.example and any deployment docs.