Skip to content

Add configuration validation (fail-fast on bootstrap) #3

@Flussen

Description

@Flussen

Context

Critical configuration (DB connection, API keys, etc.) is currently validated only when the feature is used. Misconfiguration can surface in the middle of gameplay instead of failing early during startup.

Goal

Validate critical configuration at bootstrap using a clear, typed schema and stop the server early when configuration is invalid.

Tasks

  • Define a Zod schema (or similar) for critical configuration:
    • Database connection string / credentials.
    • External API base URLs and keys.
    • Any other required engine-level configuration.
  • Add a boot validation step in initServer (or equivalent) that:
    • Validates configuration once at startup.
    • Logs a clear error with the list of invalid/missing fields.
    • Stops the server bootstrap when validation fails.
  • Provide helpful documentation / error messages so users know how to fix config.

Acceptance Criteria

  • Starting the server with missing or invalid critical config fails immediately with a clear log message.
  • No late runtime errors occur due to missing DB or critical API config during normal use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions