from fastapi import FastAPI from app import models from app.database import engine from app.routers import auth, users from app.middleware import jwt_middleware from pathlib import Path # Create database tables models.Base.metadata.create_all(bind=engine) app = FastAPI( title="User Authentication Service", description="A service for user authentication and management", version="0.1.0", ) # Add middleware app.middleware("http")(jwt_middleware.verify_token) # Include routers app.include_router(auth.router) app.include_router(users.router) @app.get("/health", tags=["Health"]) async def health_check(): """ Health check endpoint that returns the service status """ return {"status": "healthy"} if __name__ == "__main__": import uvicorn uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)