Summary
Add strict environment configuration validation so the access API fails fast when required runtime settings are missing or malformed.
Current Behaviour
The API reads environment variables such as database settings, port values, Redis settings, chain configuration, and contract addresses across the application. Invalid or missing values can surface later as unclear runtime errors.
Expected Behaviour
Startup should validate all required configuration once, provide clear error messages, and prevent the server from booting with unsafe or incomplete settings.
Suggested Implementation
Create a central config module that parses process.env, validates required values, applies safe defaults, and exports a typed config object. Use this config throughout the API instead of reading environment variables directly.
Files or Areas Likely Affected
apps/access-api/src/config.ts
apps/access-api/src/index.ts
apps/access-api/src/services/prisma.ts
.env.example
README.md
Acceptance Criteria
Additional Notes
Assumption: the access API should fail closed when configuration is invalid rather than starting in a partially working state.
Summary
Add strict environment configuration validation so the access API fails fast when required runtime settings are missing or malformed.
Current Behaviour
The API reads environment variables such as database settings, port values, Redis settings, chain configuration, and contract addresses across the application. Invalid or missing values can surface later as unclear runtime errors.
Expected Behaviour
Startup should validate all required configuration once, provide clear error messages, and prevent the server from booting with unsafe or incomplete settings.
Suggested Implementation
Create a central config module that parses
process.env, validates required values, applies safe defaults, and exports a typed config object. Use this config throughout the API instead of reading environment variables directly.Files or Areas Likely Affected
apps/access-api/src/config.tsapps/access-api/src/index.tsapps/access-api/src/services/prisma.ts.env.exampleREADME.mdAcceptance Criteria
process.envaccess.env.exampledocuments every required and optional settingAdditional Notes
Assumption: the access API should fail closed when configuration is invalid rather than starting in a partially working state.