from pathlib import Path from pydantic_settings import BaseSettings class Settings(BaseSettings): API_V1_STR: str = "/api/v1" PROJECT_NAME: str = "Todo App" # CORS Settings CORS_ORIGINS: list[str] = ["*"] # Database DB_DIR: Path = Path("/app") / "storage" / "db" class Config: env_file = ".env" env_file_encoding = "utf-8" case_sensitive = True settings = Settings() # Ensure DB directory exists settings.DB_DIR.mkdir(parents=True, exist_ok=True)