Refactor code structure for improved readability and maintainability

This commit is contained in:
JSC
2025-07-22 13:21:44 +02:00
parent 11796b1012
commit fefb7f7bf4
26 changed files with 1424 additions and 7 deletions

26
app/main.py Normal file
View File

@@ -0,0 +1,26 @@
from collections.abc import AsyncGenerator
from contextlib import asynccontextmanager
from fastapi import FastAPI
from app.core.database import init_db
@asynccontextmanager
async def lifespan(_app: FastAPI) -> AsyncGenerator[None, None]:
await init_db()
yield
def create_app() -> FastAPI:
app = FastAPI(lifespan=lifespan)
@app.get("/")
def health() -> dict[str, str]:
return {"status": "healthy"}
return app
app = create_app()