import os from functools import lru_cache from pydantic_settings import BaseSettings class Settings(BaseSettings): # Application APP_NAME: str = "FreeTable" APP_VERSION: str = "1.0.0" DEBUG: bool = os.getenv("DEBUG", "false").lower() == "true" # Database DATABASE_URL: str = os.getenv("DATABASE_URL", "sqlite:///./freetable.db") # JWT SECRET_KEY: str = os.getenv("SECRET_KEY", "change-me-in-production") ALGORITHM: str = "HS256" ACCESS_TOKEN_EXPIRE_MINUTES: int = 1440 # 24 hours # CORS CORS_ORIGINS: list[str] = ["http://localhost:5173", "http://localhost:3000"] # Password PASSWORD_COST_FACTOR: int = 12 # Upload UPLOAD_DIR: str = os.getenv("UPLOAD_DIR", "./uploads") MAX_UPLOAD_SIZE: int = 10 * 1024 * 1024 # 10MB class Config: env_file = ".env" case_sensitive = True @lru_cache() def get_settings() -> Settings: return Settings()