""" Application-wide settings loaded from environment variables (or a .env file). pydantic-settings reads the .env file automatically when BaseSettings is used, so there is no need to call load_dotenv() manually. """ from pydantic_settings import BaseSettings class Settings(BaseSettings): # ------------------------------------------------------------------------- # Auth / Security # ------------------------------------------------------------------------- # Signing secret for JWT tokens. Must be kept private on the server. secret_key: str = "insecure-dev-secret-replace-in-production" # JWT signing algorithm. HS256 is a symmetric HMAC-SHA256 scheme which # is perfectly fine for a single-server application. algorithm: str = "HS256" # Token lifetime in minutes. Tokens expire after this period and the # user must log in again. access_token_expire_minutes: int = 60 # ------------------------------------------------------------------------- # Database # ------------------------------------------------------------------------- # Any SQLAlchemy-compatible URL. Defaults to a local SQLite file so the # app works out-of-the-box without extra infrastructure. database_url: str = "sqlite:///./flipventory.db" # ------------------------------------------------------------------------- # Business rules # ------------------------------------------------------------------------- # The e-mail address that is ALWAYS treated as the site-wide administrator. # Even if the database row for this user somehow has admin=False, every # login will force-set it back to True. admin_email: str = "martin@hohenberg.jp" class Config: env_file = ".env" # Module-level singleton – import this everywhere instead of re-instantiating. settings = Settings()