What to give
- Language and framework: [e.g. TypeScript with Node.js, Python with FastAPI, Go]
- Settings the app uses now: [paste the places where settings are read, or list them]
- Environments: [e.g. local, staging, production]
- Validation library allowed: [e.g. zod, pydantic, none]
Task
Collect every setting into one config module that is checked when the app starts.
Checklist
- List every setting with its name, type, whether it is required, a safe default if any, and whether it is a secret.
- Read values only from environment variables; no hardcoded secrets, hosts or absolute paths.
- Parse types: numbers, booleans written as true or false, lists, URLs, durations.
- Validate ranges and formats, such as a port between 1 and 65535 or a URL starting with https in production.
- Collect every error and stop at startup with one message listing them all.
- Export a frozen, typed object; the rest of the code imports it and never reads the environment directly.
- Mask secrets when the config is printed or logged.
- Produce a sample env file with placeholder values only, and make sure the real env file is in the ignore list.
Output format
- | Setting | Type | Required | Default | Secret | Used for |
- The config module with comments.
- The sample env file.
- A short list of the places in the code to change to use the module.
- Tests: all settings valid, one missing, one wrong type, a secret masked in logs.
Guardrails
- Never put a real key, password or token in any output; use placeholders such as [your-api-key].
- Defaults must be safe; never default to debug mode on or to a production database.






