from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from app.api.auth import router as auth_router from app.api.users import router as users_router from app.api.departments import router as departments_router from app.core.config import settings app = FastAPI( title="Project Control API", description="Cross-departmental project management system API", version="0.1.0", ) # CORS middleware app.add_middleware( CORSMiddleware, allow_origins=settings.CORS_ORIGINS, allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) # Include routers app.include_router(auth_router.router, prefix="/api/auth", tags=["Authentication"]) app.include_router(users_router.router, prefix="/api/users", tags=["Users"]) app.include_router(departments_router.router, prefix="/api/departments", tags=["Departments"]) @app.get("/health") async def health_check(): return {"status": "healthy"}