Initial commit: ICU Patient Display Management System

This commit is contained in:
Atharv1705
2026-10-23 14:59:37 +05:30
commit b7b29ee033
86 changed files with 22707 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.core.config import settings
from app.controllers import auth, patient, display, room, vitals
from app.core.database import engine
from app.models.base import Base
from contextlib import asynccontextmanager
@asynccontextmanager
async def lifespan(app: FastAPI):
# Create SQLite tables on startup automatically
async with engine.begin() as conn:
await conn.run_sync(Base.metadata.create_all)
yield
app = FastAPI(
title="ICU Patient Display Management System API",
description="Backend API for managing ICU patients and ESP32 displays",
version="1.0.0",
lifespan=lifespan
)
# CORS Middleware configuration
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(auth.router)
app.include_router(patient.router)
app.include_router(display.router)
app.include_router(room.router)
app.include_router(vitals.router)
@app.get("/")
async def root():
return {"message": "Welcome to ICU Patient Display API"}