from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from app.routers import categories, inventory, suppliers app = FastAPI( title="Small Business Inventory System", description="A comprehensive inventory management system for small businesses", version="1.0.0" ) 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.include_router(suppliers.router, prefix="/api/v1/suppliers", tags=["suppliers"]) app.include_router(categories.router, prefix="/api/v1/categories", tags=["categories"]) @app.get("/") async def root(): return { "title": "Small Business Inventory System", "documentation": "/docs", "health": "/health" } @app.get("/health") async def health_check(): return {"status": "healthy", "service": "inventory-system"} if __name__ == "__main__": import uvicorn uvicorn.run(app, host="0.0.0.0", port=8000)