from pathlib import Path from pydantic_settings import BaseSettings class Settings(BaseSettings): PROJECT_NAME: str = "Notes Management Platform" PROJECT_DESCRIPTION: str = "A platform to store and download notes in various formats" VERSION: str = "0.1.0" API_V1_STR: str = "/api/v1" # Database settings DB_DIR: Path = Path("/app/storage/db") SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite" # Storage path for generated files STORAGE_DIR: Path = Path("/app/storage") EXPORT_DIR: Path = STORAGE_DIR / "exports" class Config: env_file = ".env" case_sensitive = True settings = Settings() # Ensure required directories exist settings.DB_DIR.mkdir(parents=True, exist_ok=True) settings.EXPORT_DIR.mkdir(parents=True, exist_ok=True)