WIP checkpoint: Scaffold FastAPI backend project structure

This commit is contained in:
2026-08-17 16:55:03 +00:00
committed by coder-bot
parent 857cf08402
commit 7594039fd0
5 changed files with 106 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
"""FastAPI application entry point."""
from contextlib import asynccontextmanager
from fastapi import FastAPI
from app.config import settings
from app.routers import auth, users, worlds, assets
@asynccontextmanager
async def lifespan(app: FastAPI):
"""Application lifespan: startup and shutdown events."""
# Startup: initialize database, connect to Redis, etc.
yield
# Shutdown: close connections, cleanup
app = FastAPI(
title=settings.app_name,
version=settings.app_version,
description="Agentic Game Platform - Backend API",
lifespan=lifespan,
)
# Include routers
app.include_router(auth.router, prefix="/api/auth", tags=["auth"])
app.include_router(users.router, prefix="/api/users", tags=["users"])
app.include_router(worlds.router, prefix="/api/worlds", tags=["worlds"])
app.include_router(assets.router, prefix="/api/assets", tags=["assets"])
@app.get("/api/health")
async def health_check():
"""Simple health check endpoint."""
return {"status": "ok", "app": settings.app_name}