from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from app.core.config import settings from app.api.v1.router import api_router from app.db.session import engine from app.db.base import Base # Create database tables Base.metadata.create_all(bind=engine) app = FastAPI( title=settings.APP_NAME, version=settings.APP_VERSION, description="AI-Powered Resume & Job Match Hub - Helping job seekers find the perfect match", openapi_url="/openapi.json" ) # Configure CORS app.add_middleware( CORSMiddleware, allow_origins=settings.CORS_ORIGINS, allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) # Include API routes app.include_router(api_router, prefix="/api/v1") @app.get("/") async def root(): """Root endpoint providing service information""" return { "service": settings.APP_NAME, "version": settings.APP_VERSION, "description": "AI-Powered Resume & Job Match Hub", "documentation": "/docs", "health_check": "/health" } @app.get("/health") async def health_check(): """Health check endpoint""" return { "status": "healthy", "service": settings.APP_NAME, "version": settings.APP_VERSION }