from functools import lru_cache from pydantic import AnyHttpUrl, Field from pydantic_settings import BaseSettings, SettingsConfigDict class Settings(BaseSettings): model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore") project_name: str = "NexaFabric" environment: str = "development" api_host: str = "0.0.0.0" api_port: int = 8000 database_url: str = "sqlite:///./nexafabric.db" redis_url: str = "redis://localhost:6379/0" jwt_secret: str = Field(default="dev-only-change-me") jwt_access_token_minutes: int = 15 jwt_refresh_token_days: int = 14 token_encryption_key: str = "dev-only-change-me" demo_admin_password: str = "ChangeMe_UseEnvInstead" cors_origins: list[AnyHttpUrl] | list[str] = ["http://localhost:5173", "http://localhost:8080"] @lru_cache def get_settings() -> Settings: return Settings()