Skip to content

Document environment variables and a sample .env file #22

@mikewheeleer

Description

@mikewheeleer

Document configuration environment variables

Description

The service reads process.env.PORT and process.env.NODE_ENV in src/index.ts and src/server.ts, and upcoming work will add ADMIN_TOKEN, CORS_ALLOWED_ORIGINS, TRUST_PROXY, and LOG_LEVEL. None of these are documented and there is no .env.example. This issue creates an environment reference and a sample env file.

Requirements and context

  • Repository scope: StableRoute-Org/Stableroute-backend only.
  • Create .env.example (create file) listing every recognized variable with a safe default and a comment.
  • Add an "Environment" section to README.md describing each variable, its default, and its effect.
  • Cross-reference the runtime defaults already present (PORT defaults to 3001, NODE_ENV gates logging).
  • Note that .env is git-ignored (verify against .gitignore).

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b docs/config-docs-22-env-reference
  • Implement changes
    • Add documentation: create .env.example; update README.md.
    • Keep the list in sync with actual process.env reads in the source.
    • Validate security: ensure no real secrets are committed; defaults must be non-sensitive.
  • Test and commit

Test and commit

  • Run npm run build and npm test to confirm nothing regressed.
  • Verify .env.example parses cleanly and matches documented variables.
  • Paste the env table in the PR.

Example commit message

docs(config): document environment variables and add .env.example

Guidelines

  • Minimum 95 percent test coverage for impacted code (n/a for docs; keep existing tests green).
  • 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.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions