added analytics

This commit is contained in:
belviskhoremk
2026-02-23 17:24:41 +00:00
parent 07c4c55072
commit 2ed998058e
5 changed files with 543 additions and 105 deletions

View File

@@ -5,7 +5,7 @@ from fastapi.responses import JSONResponse
import logging
from app.config import settings
from app.routers import auth, chatbots, documents, chat, marketplace, billing, models
from app.routers import auth, chatbots, documents, chat, marketplace, billing, models, analytics
# Configure logging
logging.basicConfig(
@@ -15,15 +15,12 @@ logging.basicConfig(
logger = logging.getLogger(__name__)
# BUG-13 FIX: Replace deprecated @app.on_event("startup") with lifespan
@asynccontextmanager
async def lifespan(app: FastAPI):
# Startup
logger.info("Contexta API starting up...")
logger.info(f"Environment: {settings.app_env}")
logger.info(f"Allowed origins: {settings.allowed_origins_list}")
yield
# Shutdown
logger.info("Contexta API shutting down...")
@@ -54,6 +51,7 @@ app.include_router(chat.router, prefix="/api/v1")
app.include_router(marketplace.router, prefix="/api/v1")
app.include_router(billing.router, prefix="/api/v1")
app.include_router(models.router, prefix="/api/v1")
app.include_router(analytics.router, prefix="/api/v1")
# ── Health & Info ──────────────────────────────────────────────────────────────
@app.get("/")