Skip to content

[FEATURE] Add Environment Variables Validation on Server Startup #305

@Vidheendu

Description

@Vidheendu

Is your feature request related to a problem? Please describe.

If required environment variables are missing or incorrectly configured, the server may fail unexpectedly or throw unclear runtime errors. This can make setup difficult for new contributors and developers.

Describe the solution you'd like

Add a startup validation system that checks whether all required environment variables are present before the server starts.

Suggested improvements:

  • Validate required .env variables
  • Show clear error messages for missing variables
  • Stop server startup if critical variables are absent
  • Keep implementation lightweight and easy to maintain

Example:

  • MONGO_URI missing
  • JWT_SECRET missing

Describe alternatives you've considered

Currently, missing variables may only be discovered when a related feature breaks. Early validation would improve the developer experience and debugging process.

Additional Context

This would be a beginner-friendly backend improvement and helpful for contributors setting up the project locally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions