feat(backend): add FastAPI app entry point

This commit is contained in:
2025-04-10 23:30:50 +01:00
parent bb91be6848
commit 0b0efb71eb
3 changed files with 151 additions and 0 deletions

27
backend/src/config.py Normal file
View File

@@ -0,0 +1,27 @@
from functools import lru_cache
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8",
case_sensitive=False,
)
app_name: str = "CodeTutor API"
app_version: str = "0.1.0"
debug: bool = False
database_url: str
cors_origins: list[str] = ["http://localhost:3000"]
default_page_size: int = 20
max_page_size: int = 100
@lru_cache
def get_settings() -> Settings:
return Settings()