From 5837fad5df685ef60512f5c423ce6e21ec777dc5 Mon Sep 17 00:00:00 2001 From: architect-bot Date: Mon, 17 Aug 2026 18:02:48 +0000 Subject: [PATCH] WIP checkpoint: Scaffold FastAPI backend project structure --- backend/app/config.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/backend/app/config.py b/backend/app/config.py index 35109a7..6687b03 100644 --- a/backend/app/config.py +++ b/backend/app/config.py @@ -1,32 +1,48 @@ +"""Application configuration via pydantic-settings.""" + from pydantic_settings import BaseSettings from functools import lru_cache class Settings(BaseSettings): - # Database + # App + APP_NAME: str = "AGP Backend" + APP_VERSION: str = "0.1.0" + DEBUG: bool = True + + # Database (async) DATABASE_URL: str = "postgresql+asyncpg://agp_user:agp_password@localhost:5432/agp_db" # Redis REDIS_URL: str = "redis://localhost:6379/0" - # JWT + # JWT / Auth SECRET_KEY: str = "change-me-to-a-secure-random-string" ALGORITHM: str = "HS256" ACCESS_TOKEN_EXPIRE_MINUTES: int = 30 - # App - DEBUG: bool = True + # CORS CORS_ORIGINS: str = "http://localhost:8080,http://localhost:3000" + # File uploads + UPLOAD_DIR: str = "uploads" + MAX_UPLOAD_SIZE_MB: int = 100 + @property def cors_origins_list(self) -> list[str]: return [origin.strip() for origin in self.CORS_ORIGINS.split(",")] class Config: env_file = ".env" + env_file_encoding = "utf-8" case_sensitive = True @lru_cache() def get_settings() -> Settings: + """Return cached settings instance.""" return Settings() + + +# Convenience singleton +settings = get_settings()