from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from app.api import auth, users, posts, events, connections import os app = FastAPI( title="LinkedIn-Based Church Management System", description="A church management system with LinkedIn-style networking features", version="1.0.0", openapi_url="/openapi.json", ) app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) # Include routers app.include_router(auth.router, prefix="/auth", tags=["Authentication"]) app.include_router(users.router, prefix="/users", tags=["Users"]) app.include_router(posts.router, prefix="/posts", tags=["Posts"]) app.include_router(events.router, prefix="/events", tags=["Events"]) app.include_router(connections.router, prefix="/connections", tags=["Connections"]) @app.get("/") async def root(): return { "title": "LinkedIn-Based Church Management System", "documentation": "/docs", "health": "/health", } @app.get("/health") async def health_check(): return { "status": "healthy", "service": "LinkedIn-Based Church Management System", "version": "1.0.0", } if __name__ == "__main__": import uvicorn uvicorn.run( "main:app", host="0.0.0.0", port=int(os.getenv("PORT", 8000)), reload=True )