Skip to content

Add Environment Configuration and Validation #2

@greatest0fallt1me

Description

@greatest0fallt1me

Description
Centralize environment variables (PORT, DATABASE_URL, HORIZON_URL, SOROBAN_RPC_URL, JWT_SECRET, etc.) in src/config and validate required vars at startup. Use a schema (e.g. zod or env schema) so the app fails fast with a clear message if config is missing.

Requirements and context

  • Must validate required env on boot
  • Support .env files for local dev
  • Document all env vars in README or .env.example

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feature/env-config
  • Implement changes
    • Add src/config/env.ts (or similar): read process.env, validate required keys, export typed config
    • Create .env.example with all keys and placeholder values
    • Update src/index.ts to use config and exit with message if validation fails
  • Test and commit
    • Run with missing env and verify error message; run with valid env and verify app starts
    • Example commit message: feat: env configuration and validation

Guidelines

  • No secrets in repo; .env in .gitignore
  • Clear documentation
  • Timeframe: 96 hours
  • Project details: #

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave program

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions