Skip to content

Create .env.example + Setup Validator #2

Description

@hudazaan

Description

We need a beginner-friendly environment setup flow. Add a safe .env.example template and a setup validation command so contributors can verify local config before running the app.

Why

Current setup can fail silently when env keys are missing or incorrect. New contributors should get clear errors and next steps.

Scope

  • Add .env.example with all required keys (no secrets):
    • MONGO_URI=
    • STRIPE_SECRET_KEY=
    • JWT_SECRET=
    • PORT=3000
    • DOMAIN=http://localhost:3000
  • Add a setup validation script (for example: npm run validate:setup)
  • Validation should check:
    • required env keys exist
    • PORT is numeric
    • DOMAIN format is valid URL
    • optional: basic Mongo URI format check
    • optional: Stripe key starts with sk_test_ in local/dev
  • Show clear pass/fail output with actionable messages

Deliverables

  • New .env.example file
  • Validation script file (Node script)
  • README update with command usage (npm run validate:setup)
  • CONTRIBUTING update referencing setup validation step

Acceptance Criteria

  • Running npm run validate:setup prints success when env is valid
  • Missing/invalid keys produce readable error messages
  • No secrets are committed
  • Works on Windows and Linux/macOS terminals

Suggested Labels

good first issue, documentation, setup, enhancement

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestgood first issueGood for newcomers

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions