cv-buddy-backend / app /core /config.py
Momal's picture
feat: sync latest backend with auth, usage tracking, and admin bypass
bcaf4d8
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")
# Redis
redis_url: str = "redis://localhost:6379/0"
# LLM
llm_provider: str = "google"
llm_model_fast: str = "gemini-2.0-flash"
llm_model_smart: str = "gemini-2.0-flash"
# API Keys
openai_api_key: str = ""
google_api_key: str = ""
zai_api_key: str = ""
groq_api_key: str = ""
# Session
session_ttl_seconds: int = 7200
# Auth
nextauth_secret: str = ""
frontend_url: str = "http://localhost:3000"
user_profile_ttl_seconds: int = 30 * 24 * 60 * 60 # 30 days
# Usage limits
free_tier_limit: int = 3
usage_ttl_seconds: int = 35 * 24 * 60 * 60 # 35 days
# Admin emails (comma-separated) — unlimited usage, no gating
admin_emails: str = ""
@property
def admin_email_set(self) -> set[str]:
"""Parse comma-separated admin emails into a set for fast lookup."""
if not self.admin_emails:
return set()
return {e.strip().lower() for e in self.admin_emails.split(",") if e.strip()}
settings = Settings()