from functools import lru_cache from pydantic_settings import BaseSettings, SettingsConfigDict class Settings(BaseSettings): model_config = SettingsConfigDict(env_file=".env", extra="ignore") app_name: str = "VerifyPack" environment: str = "development" secret_key: str = "change-me-in-production-please-32chars-min" access_token_expire_minutes: int = 1440 algorithm: str = "HS256" frontend_url: str = "http://localhost:3000" # Database mongodb_url: str = "mongodb://localhost:27017" mongodb_db: str = "verifypack" mock_db: bool = False # Mock toggles mock_email: bool = True mock_storage: bool = True # AWS aws_region: str = "ap-south-1" aws_access_key_id: str = "" aws_secret_access_key: str = "" ses_from_email: str = "no-reply@verifypack.example" s3_bucket: str = "verifypack-uploads" # Google OAuth google_client_id: str = "" google_client_secret: str = "" google_redirect_uri: str = "http://localhost:8000/auth/google/callback" # Razorpay razorpay_key_id: str = "" razorpay_key_secret: str = "" razorpay_webhook_secret: str = "" gst_rate: float = 0.18 @property def google_configured(self) -> bool: return bool(self.google_client_id and self.google_client_secret) @property def razorpay_configured(self) -> bool: return bool(self.razorpay_key_id and self.razorpay_key_secret) @property def ses_configured(self) -> bool: return bool(self.aws_access_key_id and self.aws_secret_access_key) @lru_cache def get_settings() -> Settings: return Settings() settings = get_settings()