- FastAPI backend mit Domain-Check, TLD-Pricing, User-Management - Next.js frontend mit modernem UI - Sortierbare TLD-Tabelle mit Mini-Charts - Domain availability monitoring - Subscription tiers (Starter, Professional, Enterprise) - Authentication & Authorization - Scheduler für automatische Domain-Checks
42 lines
1001 B
Python
42 lines
1001 B
Python
"""Application configuration using pydantic-settings."""
|
|
from functools import lru_cache
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""Application settings loaded from environment variables."""
|
|
|
|
# Database
|
|
database_url: str = "sqlite+aiosqlite:///./domainwatch.db"
|
|
|
|
# JWT Settings
|
|
secret_key: str = "dev-secret-key-change-in-production"
|
|
algorithm: str = "HS256"
|
|
access_token_expire_minutes: int = 1440 # 24 hours
|
|
|
|
# App Settings
|
|
app_name: str = "DomainWatch"
|
|
debug: bool = True
|
|
|
|
# Email Settings (optional)
|
|
smtp_host: str = ""
|
|
smtp_port: int = 587
|
|
smtp_user: str = ""
|
|
smtp_password: str = ""
|
|
email_from: str = ""
|
|
|
|
# Scheduler Settings
|
|
check_hour: int = 6
|
|
check_minute: int = 0
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
env_file_encoding = "utf-8"
|
|
|
|
|
|
@lru_cache()
|
|
def get_settings() -> Settings:
|
|
"""Get cached settings instance."""
|
|
return Settings()
|
|
|