Files
card-game/backend/app/config.py

33 lines
785 B
Python

from pydantic_settings import BaseSettings
from functools import lru_cache
class Settings(BaseSettings):
# Database (matching what database.py expects)
DB_USER: str = "cardgame"
DB_PASSWORD: str = "cardgame"
DB_HOST: str = "postgres"
DB_PORT: str = "5432"
DB_NAME: str = "cardgame"
# JWT
secret_key: str = "your-secret-key-change-in-production"
algorithm: str = "HS256"
access_token_expire_minutes: int = 30
# CORS
cors_origins: list[str] = ["*"]
# Game Config
register_bonus_gold: int = 500
duplicate_card_gold: int = 20
class Config:
env_file = ".env"
@lru_cache()
def get_settings():
return Settings()
# Export settings instance for backwards compatibility
settings = get_settings()