How timsina-suraj/medishield works
MediShield is a role-based hospital management system whose user workflows span account access, patient registration, appointments, clinical records, labs, prescriptions, and pharmacy, with dengue and diagnosis ML plus analytics and alerts. The frontend routes role-specific users to workflows and calls the FastAPI API; backend services coordinate repositories and persistence. Sampled source confirms app/router registration, frontend routing and API client behavior, registration and authentication details, and selected repository behavior. Other capability links reflect the README and module paths; unsampled internal wiring is not asserted.
Main entry points: main.py FastAPI application · repositories Repositories · auth_service.py Authentication service · App.jsx Role-based interface
Components 25
Frontend
- Role-based interface
frontend/src/App.jsx - Login and session
frontend/src/auth/AuthContext.jsx - API client
frontend/src/api/client.js
API and security
- FastAPI application
backend/app/main.py - Authentication routes
backend/app/routers/auth.py - Authentication service
backend/app/services/auth_service.py - Registration service
backend/app/services/registration_service.py - Auth and access control
backend/app/security - Email notifications
backend/app/services/email_service.py
Clinical operations
- Appointments
backend/app/routers/appointments.py - Records and history
backend/app/routers/medical_records.py - Lab workflow
backend/app/routers/lab.py - Prescriptions
backend/app/routers/prescriptions.py - Pharmacy inventory
backend/app/routers/pharmacy.py - Documents and exports
backend/app/routers/documents.py
AI and oversight
- Prediction endpoints
backend/app/routers/ml_dengue.py - Diagnosis prediction
backend/app/routers/ml_diagnosis.py - ML models and metrics
backend/app/ml - Alerts
backend/app/routers/alerts.py - Analytics dashboard API
backend/app/routers/analytics.py
Persistence
- Repositories
backend/app/repositories - Async database setup
backend/app/database.py - Hospital database
Other components
- Hospital users
- SMTP service
Connections 33
- Hospital users → Role-based interface: use workflows
- Role-based interface → Login and session: renders routes
- Login and session → API client: requests API
- Role-based interface → API client: calls API
- API client → FastAPI application: HTTP requests
- FastAPI application → Authentication routes: dispatches auth
- Authentication routes → Authentication service: invokes
- Authentication service → Auth and access control: verifies credentials
- Authentication service → Repositories: reads and writes
- Authentication service → Email notifications: schedules OTP mail
- Registration service → Repositories: creates accounts
- Registration service → Email notifications: schedules notices
- Email notifications → SMTP service: sends messages
- FastAPI application → Appointments: dispatches
- FastAPI application → Records and history: dispatches
- FastAPI application → Lab workflow: dispatches
- FastAPI application → Prescriptions: dispatches
- FastAPI application → Pharmacy inventory: dispatches
- FastAPI application → Documents and exports: dispatches
- FastAPI application → Prediction endpoints: dispatches
- FastAPI application → Diagnosis prediction: dispatches
- FastAPI application → Alerts: dispatches
- FastAPI application → Analytics dashboard API: dispatches
- Prediction endpoints → ML models and metrics: uses models
- Diagnosis prediction → ML models and metrics: uses models
- Appointments → Repositories: persists workflow
- Records and history → Repositories: reads and writes
- Lab workflow → Repositories: reads and writes
- Prescriptions → Repositories: reads and writes
- Pharmacy inventory → Repositories: reads and writes
- Documents and exports → Repositories: stores metadata
- Repositories → Async database setup: uses sessions
- Async database setup → Hospital database: queries and updates