docs: comprehensive API documentation

- Create enhanced health endpoints with /health and /health/db
- Add comprehensive docstrings to all API endpoints
- Add Pydantic response models with Field descriptions
- Create apps/api/README.md with setup guide
- Create ADR-001 for session auth decision
- Create ADR-002 for async SQLAlchemy decision
- Quality gates: Python syntax OK, TypeScript OK
This commit is contained in:
Fusion
2026-05-19 21:31:20 +02:00
parent e344e961d6
commit 40a940304b
25 changed files with 1848 additions and 88 deletions
+2 -11
View File
@@ -9,6 +9,7 @@ from sqlalchemy import select, text
from src.api.auth import router as auth_router
from src.api.dashboard import router as dashboard_router
from src.api.git_repositories import router as git_repositories_router
from src.api.health import router as health_router
from src.api.projects import router as projects_router
from src.api.ssh_keys import router as ssh_keys_router
from src.api.terminal import router as terminal_router
@@ -148,17 +149,7 @@ async def on_startup():
await seed_builtin_tool_types()
logger.info("Startup complete.")
@app.get("/health")
async def health_check():
try:
from sqlalchemy import text
async with SessionLocal() as session:
await session.execute(text("SELECT 1"))
return {"status": "healthy", "database": "connected"}
except Exception as exc:
logger.error("Health check failed: %s", exc)
return {"status": "unhealthy", "database": "disconnected", "error": str(exc)}
app.include_router(health_router)
app.include_router(auth_router)
app.include_router(dashboard_router)
app.include_router(projects_router)