Document configuration and provide an .env.example
Description
The only environment variables in src/index.ts and src/server.ts today are PORT and NODE_ENV, yet README.md does not list them, and there is no .env.example to onboard contributors. As the campaign adds more config (admin tokens, CORS origins, log level, persistence path, timeouts), this gap will widen. This issue establishes a single, authoritative configuration reference and a copyable example file.
Requirements and context
- Repository scope: StableRoute-Org/Stableroute-backend only.
- Add a "Configuration" section to
README.md with a table of every environment variable the code currently reads (PORT, NODE_ENV), each with purpose, default, and example value.
- Create a
.env.example (create file) listing those variables with safe placeholder defaults and explanatory comments.
- Confirm
.env is git-ignored (it is, per .gitignore) and note in the docs that .env.example is the template, never .env.
- Cross-link the section from the existing "Setup (contributors)" steps.
Suggested execution
- Fork the repo and create a branch
git checkout -b docs/configuration-37-env-reference
- Implement changes
- Write code in: documentation only — update
README.md and create .env.example.
- Write comprehensive tests in: not applicable (docs-only); if a config-loading helper is added, add a minimal test that
.env.example parses and lists no unknown keys.
- Add documentation: this issue is the documentation.
- Add inline comments in
.env.example describing each variable.
- Validate security: ensure no real secrets or tokens are committed; placeholders only.
- Test and commit
Test and commit
- Run
npm run build, npm run lint, and npm test (ensure nothing breaks even though changes are docs-first).
- Cover edge cases: verify documented defaults match the code's actual fallbacks.
- Paste the rendered Configuration section in the PR description.
Example commit message
docs(configuration): document env variables and add .env.example
Guidelines
- Minimum 95 percent test coverage for impacted code (where any code is touched).
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
Community & contribution rewards
- 💬 Join the StableRoute community on Discord for questions, reviews, and faster merges: https://discord.gg/37aCpusvx
- ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward.
Document configuration and provide an .env.example
Description
The only environment variables in
src/index.tsandsrc/server.tstoday arePORTandNODE_ENV, yetREADME.mddoes not list them, and there is no.env.exampleto onboard contributors. As the campaign adds more config (admin tokens, CORS origins, log level, persistence path, timeouts), this gap will widen. This issue establishes a single, authoritative configuration reference and a copyable example file.Requirements and context
README.mdwith a table of every environment variable the code currently reads (PORT,NODE_ENV), each with purpose, default, and example value..env.example(create file) listing those variables with safe placeholder defaults and explanatory comments..envis git-ignored (it is, per.gitignore) and note in the docs that.env.exampleis the template, never.env.Suggested execution
git checkout -b docs/configuration-37-env-referenceREADME.mdand create.env.example..env.exampleparses and lists no unknown keys..env.exampledescribing each variable.Test and commit
npm run build,npm run lint, andnpm test(ensure nothing breaks even though changes are docs-first).Example commit message
docs(configuration): document env variables and add .env.exampleGuidelines
Community & contribution rewards