from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from fastapi.responses import JSONResponse from app.api.inventory import router as inventory_router app = FastAPI( title="Inventory Management API", description="A comprehensive inventory management system", version="1.0.0", openapi_url="/openapi.json", ) app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) app.include_router(inventory_router, prefix="/api/v1/inventory", tags=["inventory"]) @app.get("/") async def root(): return { "title": "Inventory Management API", "description": "A comprehensive inventory management system", "version": "1.0.0", "documentation": "/docs", "health_check": "/health" } @app.get("/health") async def health_check(): return { "status": "healthy", "message": "Inventory Management API is running properly" }