Skip to content

Document all environment variables and add a .env.example #54

@mikewheeleer

Description

@mikewheeleer

Document environment variables and provide a .env.example

Description

src/index.ts reads PORT, CORS_ALLOWED_ORIGINS, and NODE_ENV from the environment, and the .gitignore already excludes .env/.env.* — but there is no documentation of these variables and no example file. New contributors must read the source to learn how to configure the app. This issue documents configuration and adds a checked-in example.

Requirements and context

  • Repository scope: Agentpay-Org/Agentpay-backend only.
  • Add a .env.example (safe to commit) listing every env var the code reads, with defaults and inline comments.
  • Add a "Configuration" section to README.md mapping each variable to its effect (e.g. CORS_ALLOWED_ORIGINS is a comma-separated allowlist, default same-origin only).
  • Note env vars introduced by sibling issues as "reserved/optional" if not yet implemented, or scope strictly to currently-read vars.
  • Confirm .env.example is not matched by the .env.* ignore rule (use an explicit unignore if needed).

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b docs/docs-24-env-vars
  • Implement changes
    • Write code in: no production change; add .env.example.
    • Write comprehensive tests in: none required.
    • Add documentation: "Configuration" section in README.md.
    • Keep the example values non-secret and clearly placeholder.
    • Validate security assumptions: no real secrets committed; .gitignore still ignores real .env.
  • Test and commit

Test and commit

  • Run npm run build and npm test to confirm nothing breaks.
  • Verify each documented var matches a process.env.* read in src/index.ts.
  • Include a note in the PR listing the documented variables.

Example commit message

docs: document environment variables and add .env.example

Guidelines

  • Minimum 95 percent test coverage for impacted modules (where applicable).
  • Clear, reviewer-focused documentation.
  • Timeframe: 96 hours.

Community & contribution rewards

  • 💬 Join the AgentPay community on Discord for questions, reviews, and faster merges: https://discord.gg/eXvRKkgcv
  • ⭐ 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