munch-ease-backend/settings.py

27 lines
727 B
Python
Raw Normal View History

2025-10-18 05:50:43 +00:00
"""
Centralized runtime settings for the Doof backend.
No external dependencies; reads from environment only so it can be imported
anywhere (including tests) without side effects.
"""
from __future__ import annotations
from dataclasses import dataclass
import os
@dataclass(frozen=True)
class Settings:
# Database
database_path: str = os.environ.get("DOOF_DB", "./data/doof.sqlite")
# Environment flags
prod: bool = os.environ.get("DOOF_PROD", "false").lower() in {"1", "true", "yes"}
# Frontend dev server for reverse proxy in non-prod
frontend_dev_url: str = os.environ.get("FRONTEND_DEV_URL", "http://localhost:8080/")
# A module-level singleton for convenience imports
settings = Settings()