Files
freetable/backend/app/config.py
T

39 lines
939 B
Python
Raw Normal View History

2026-06-09 23:29:24 +00:00
import os
from functools import lru_cache
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
# Application
APP_NAME: str = "FreeTable"
APP_VERSION: str = "1.0.0"
DEBUG: bool = os.getenv("DEBUG", "false").lower() == "true"
2026-06-09 23:29:24 +00:00
# Database
DATABASE_URL: str = os.getenv("DATABASE_URL", "sqlite:///./freetable.db")
# JWT
SECRET_KEY: str = os.getenv("SECRET_KEY", "change-me-in-production")
2026-06-09 23:29:24 +00:00
ALGORITHM: str = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES: int = 1440 # 24 hours
2026-06-09 23:29:24 +00:00
# CORS
CORS_ORIGINS: list[str] = ["http://localhost:5173", "http://localhost:3000"]
# Password
PASSWORD_COST_FACTOR: int = 12
# Upload
UPLOAD_DIR: str = os.getenv("UPLOAD_DIR", "./uploads")
MAX_UPLOAD_SIZE: int = 10 * 1024 * 1024 # 10MB
class Config:
env_file = ".env"
case_sensitive = True
2026-06-09 23:29:24 +00:00
@lru_cache()
def get_settings() -> Settings:
return Settings()