from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from app.config import settings from app.api.endpoints import market, funds, portfolio, goals, ai app = FastAPI( title=settings.PROJECT_NAME, openapi_url=f"{settings.API_V1_STR}/openapi.json" ) # Set up CORS middleware app.add_middleware( CORSMiddleware, allow_origins=settings.BACKEND_CORS_ORIGINS, allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) # Include API routers app.include_router(market.router, prefix=f"{settings.API_V1_STR}/market", tags=["market"]) app.include_router(funds.router, prefix=f"{settings.API_V1_STR}/funds", tags=["funds"]) app.include_router(portfolio.router, prefix=f"{settings.API_V1_STR}/portfolio", tags=["portfolio"]) app.include_router(goals.router, prefix=f"{settings.API_V1_STR}/goals", tags=["goals"]) app.include_router(ai.router, prefix=f"{settings.API_V1_STR}/ai", tags=["ai"]) @app.get("/") async def root(): return {"message": "Mutual Fund Investment Decision Support System API"} @app.get("/health") async def health_check(): return {"status": "healthy"}