from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from app.api import auth, tutor from app.db.session import engine from app.db.base import Base Base.metadata.create_all(bind=engine) app = FastAPI( title="AI Tutor Backend Service", description="Backend API for AI-powered tutoring application", version="1.0.0", openapi_url="/openapi.json" ) app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) app.include_router(auth.router, prefix="/auth", tags=["authentication"]) app.include_router(tutor.router, prefix="/tutor", tags=["tutor"]) @app.get("/") def read_root(): return { "title": "AI Tutor Backend Service", "documentation": "/docs", "health": "/health" } @app.get("/health") def health_check(): return {"status": "healthy", "service": "AI Tutor Backend"}