Skip to content

chore: no centralized environment variable validation at startup #174

Description

@nazarli-shabnam

Problem

Required environment variables (DATABASE_URL, QF_CLIENT_SECRET, AI provider keys such as ANTHROPIC_API_KEY/GEMINI_API_KEY, etc.) are read ad hoc wherever they're needed across the codebase, with no single validation step at boot.

Proposed fix

Add a small lib/env.ts (or similar) module that validates all required env vars once at startup (e.g. via a schema library already in the dependency tree, or a plain assertion module) and throws a clear, actionable error immediately if one is missing or malformed.

Why this matters

Today a missing/misconfigured env var surfaces as an opaque runtime failure deep inside a request handler, rather than a clear boot-time error — this makes misconfiguration in new environments (local dev, staging, a new deploy target) much harder to diagnose than it needs to be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions