"""Homelab Dashboard API — aggregates data from homelab services."""
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from routers import overview, containers, media, automations, expenses, olares, network, logs, kuma

app = FastAPI(title="Homelab Dashboard API", version="1.0.0")
app.add_middleware(CORSMiddleware, allow_origins=["*"], allow_methods=["*"], allow_headers=["*"])
app.include_router(overview.router, prefix="/api")
app.include_router(containers.router, prefix="/api")
app.include_router(media.router, prefix="/api")
app.include_router(automations.router, prefix="/api")
app.include_router(expenses.router, prefix="/api")
app.include_router(olares.router, prefix="/api")
app.include_router(network.router, prefix="/api")
app.include_router(logs.router, prefix="/api")
app.include_router(kuma.router, prefix="/api")


@app.get("/api/health")
def health():
    return {"status": "ok"}
