75 lines
2.1 KiB
Python
75 lines
2.1 KiB
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
from app.api import (
|
|
auth,
|
|
users,
|
|
posts,
|
|
events,
|
|
connections,
|
|
uploads,
|
|
notifications,
|
|
ministries,
|
|
donations,
|
|
messages,
|
|
prayers,
|
|
attendance,
|
|
)
|
|
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.include_router(uploads.router, prefix="/uploads", tags=["File Uploads"])
|
|
app.include_router(
|
|
notifications.router, prefix="/notifications", tags=["Notifications"]
|
|
)
|
|
app.include_router(ministries.router, prefix="/ministries", tags=["Ministries"])
|
|
app.include_router(donations.router, prefix="/donations", tags=["Donations"])
|
|
app.include_router(messages.router, prefix="/messages", tags=["Messaging"])
|
|
app.include_router(prayers.router, prefix="/prayers", tags=["Prayer Requests"])
|
|
app.include_router(attendance.router, prefix="/attendance", tags=["Attendance"])
|
|
|
|
|
|
@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
|
|
)
|