import os from pathlib import Path from pydantic_settings import BaseSettings # Build paths inside the project BASE_DIR = Path(__file__).resolve().parent.parent.parent class Settings(BaseSettings): API_V1_STR: str = "/api/v1" PROJECT_NAME: str = "Todo App API" PROJECT_DESCRIPTION: str = ( "A simple Todo application API built with FastAPI and SQLite" ) VERSION: str = "0.1.0" # SQLite Database settings DB_DIR = Path("/app") / "storage" / "db" SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite" class Config: case_sensitive = True env_file = os.path.join(BASE_DIR, ".env") settings = Settings() # Ensure database directory exists settings.DB_DIR.mkdir(parents=True, exist_ok=True)