mirror of
https://github.com/complexcaresolutions/dak.c2s.git
synced 2026-03-17 20:43:41 +00:00
Add audit_service for compliance logging, admin endpoints (user CRUD, invitation management, audit log), notification endpoints (list, mark read), and interactive create_admin script. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
30 lines
881 B
Python
30 lines
881 B
Python
# backend/app/main.py
|
|
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from app.api.admin import router as admin_router
|
|
from app.api.auth import router as auth_router
|
|
from app.api.notifications import router as notifications_router
|
|
from app.config import get_settings
|
|
|
|
settings = get_settings()
|
|
|
|
app = FastAPI(title=settings.APP_NAME, docs_url="/docs")
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=settings.CORS_ORIGINS.split(","),
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
# --- Routers ---
|
|
app.include_router(auth_router, prefix="/api/auth", tags=["auth"])
|
|
app.include_router(admin_router, prefix="/api/admin", tags=["admin"])
|
|
app.include_router(notifications_router, prefix="/api/notifications", tags=["notifications"])
|
|
|
|
|
|
@app.get("/api/health")
|
|
def health_check():
|
|
return {"status": "ok"}
|