from fastapi import FastAPI, Depends
from mangum import Mangum
from backend.app.portfolio import router as portfolio_router
from backend.app.plan import router as plan_router
from backend.app.dependencies import validate_api_key
from backend.app.config import get_settings

app = FastAPI(dependencies=[Depends(validate_api_key)])

app.include_router(portfolio_router.router, prefix="/v1")
app.include_router(plan_router.router, prefix="/v1")

if get_settings().ENVIRONMENT == "local":
    from app.local import router as local_router

    app.include_router(local_router.router)

handler = Mangum(app)
