WIP checkpoint: Scaffold FastAPI backend project structure

This commit is contained in:
2026-08-17 16:55:03 +00:00
parent 549c05f1c0
commit c1e7a44db9
5 changed files with 106 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
from pydantic_settings import BaseSettings
from functools import lru_cache
class Settings(BaseSettings):
# Database
DATABASE_URL: str = "postgresql+asyncpg://agp_user:agp_password@localhost:5432/agp_db"
# Redis
REDIS_URL: str = "redis://localhost:6379/0"
# JWT
SECRET_KEY: str = "change-me-to-a-secure-random-string"
ALGORITHM: str = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
# App
DEBUG: bool = True
CORS_ORIGINS: str = "http://localhost:8080,http://localhost:3000"
@property
def cors_origins_list(self) -> list[str]:
return [origin.strip() for origin in self.CORS_ORIGINS.split(",")]
class Config:
env_file = ".env"
case_sensitive = True
@lru_cache()
def get_settings() -> Settings:
return Settings()