Skip to content

chore(backend): add environment variable validation with Joi#31

Open
nonoto999t wants to merge 11 commits into
BountyOnChain:mainfrom
nonoto999t:chore/backend-env-validation-joi
Open

chore(backend): add environment variable validation with Joi#31
nonoto999t wants to merge 11 commits into
BountyOnChain:mainfrom
nonoto999t:chore/backend-env-validation-joi

Conversation

@nonoto999t
Copy link
Copy Markdown

Summary

Add environment variable validation using Joi for NestJS backend.

Changes

Validation Schema

  • Created env.validation.ts with Joi schema
  • Validates: DATABASE_URL, JWT_SECRET, STELLAR_NETWORK, PORT, FRONTEND_URL
  • Custom error messages for each required field
  • Contract ID validation with regex pattern

Configuration

  • Updated .env.example with all required fields and defaults
  • Uses ConfigModule.forRoot with validationSchema
  • Fail fast with clear error messages if env vars are missing

Closes #12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(backend): add environment validation with Joi

1 participant