# sushanth1411/medical_management architecture

> Architecture diagram of the GitHub repository sushanth1411/medical_management, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sushanth1411/medical_management
- Repository: https://github.com/sushanth1411/medical_management

## Overview

This is a role-based medical operations system for educational institutes. Users authenticate, then manage clinic workflows through a React interface: doctor on-call schedules, medicine information and hostel stock, inter-hostel sharing, patients and visits, and emergency guidance/reporting. The Flask API handles these domains against SQLAlchemy models backed by MySQL; reports, analytics, notifications, and audit logging are documented capabilities. The sampled app factory shows blueprint registration and database configuration, while README capability descriptions fill gaps where route or page implementation was not sampled.

Main entry points: [`frontend/src/App.js`](https://github.com/sushanth1411/medical_management/blob/main/frontend/src/App.js) (App routing), [`backend/app/__init__.py`](https://github.com/sushanth1411/medical_management/blob/main/backend/app/__init__.py) (Flask app and routing), [`frontend/src/services/api.js`](https://github.com/sushanth1411/medical_management/blob/main/frontend/src/services/api.js) (API client), [`backend/app/models.py`](https://github.com/sushanth1411/medical_management/blob/main/backend/app/models.py) (Domain models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["App routing<br/>[App.js]"]
  node_navbar["Navigation<br/>[Navbar.js]"]
  node_authui["Login and signup<br/>[Login.js]"]
  node_dashboard["Dashboard<br/>[Dashboard.js]"]
  node_admin["Admin analytics<br/>[AdminPanel.js]"]
  node_profileui["User profile<br/>[Profile.js]"]
end

subgraph group_clinic["Clinic operations"]
  node_doctorsui["Doctor schedules<br/>[Doctors.js]"]
  node_medicineui["Medicine inventory<br/>[Medicines.js]"]
  node_searchui["Medicine search<br/>[MedicineSearch.js]"]
  node_patientsui["Patients and visits<br/>[Patients.js]"]
end

subgraph group_response["Emergency and sharing"]
  node_sharingui["Medicine sharing<br/>[ShareRequests.js]"]
  node_receiptui["Share receipt<br/>[ShareReceipt.js]"]
  node_emergencyui["Emergency reports<br/>[Emergency.js]"]
  node_diseasesui["Disease information<br/>[Diseases.js]"]
  node_snakeui["Snake-bite guidance<br/>[SnakeBite.js]"]
end

subgraph group_service["API services"]
  node_api["API client<br/>[api.js]"]
  node_flask["Flask app and routing<br/>[__init__.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_doctors["Doctor service<br/>[doctors.py]"]
  node_medicines["Medicine service<br/>[medicines.py]"]
  node_patients["Patient service<br/>[patients.py]"]
  node_sharing["Sharing service<br/>[share_requests.py]"]
  node_emergency["Emergency service<br/>[emergency.py]"]
  node_reports["Reports and analytics<br/>[reports.py]"]
  node_notifications["Notifications<br/>[notifications.py]"]
  node_users["User management<br/>[users.py]"]
end

subgraph group_data["Persistence"]
  node_models["Domain models<br/>[models.py]"]
  node_mysql[("MySQL database")]
end

node_user(("Institute user"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_authui
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_doctorsui
node_app -->|"routes to"| node_medicineui
node_app -->|"routes to"| node_searchui
node_app -->|"routes to"| node_sharingui
node_app -->|"routes to"| node_receiptui
node_app -->|"routes to"| node_patientsui
node_app -->|"routes to"| node_emergencyui
node_app -->|"routes to"| node_diseasesui
node_app -->|"routes to"| node_snakeui
node_app -->|"routes to"| node_profileui
node_app -->|"routes to"| node_admin
node_app -->|"renders"| node_navbar
node_authui -->|"authenticates via"| node_api
node_dashboard -->|"requests data"| node_api
node_admin -.->|"requests data"| node_api
node_doctorsui -->|"requests schedules"| node_api
node_medicineui -->|"manages stock"| node_api
node_searchui -->|"searches via"| node_api
node_patientsui -->|"manages visits"| node_api
node_sharingui -->|"requests sharing"| node_api
node_emergencyui -->|"reports emergencies"| node_api
node_diseasesui -->|"fetches information"| node_api
node_snakeui -->|"fetches guidance"| node_api
node_api -->|"calls API"| node_flask
node_flask -->|"registers blueprint"| node_auth
node_flask -->|"registers blueprint"| node_doctors
node_flask -->|"registers blueprint"| node_medicines
node_flask -->|"registers blueprint"| node_patients
node_flask -->|"registers blueprint"| node_sharing
node_flask -->|"registers blueprint"| node_emergency
node_flask -->|"registers blueprint"| node_reports
node_flask -->|"registers blueprint"| node_notifications
node_flask -->|"registers blueprint"| node_users
node_auth -->|"queries users"| node_models
node_doctors -->|"uses models"| node_models
node_medicines -->|"updates inventory"| node_models
node_patients -->|"uses models"| node_models
node_sharing -->|"uses models"| node_models
node_emergency -->|"uses models"| node_models
node_reports -->|"uses models"| node_models
node_notifications -->|"uses models"| node_models
node_users -->|"uses models"| node_models
node_flask -->|"configures database"| node_mysql

click node_app "https://github.com/sushanth1411/medical_management/blob/main/frontend/src/App.js"
click node_navbar "https://github.com/sushanth1411/medical_management/blob/main/frontend/src/components/Navbar.js"
click node_authui "https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/Login.js"
click node_dashboard "https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/Dashboard.js"
click node_admin "https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/AdminPanel.js"
click node_doctorsui "https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/Doctors.js"
click node_medicineui "https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/Medicines.js"
click node_searchui "https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/MedicineSearch.js"
click node_patientsui "https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/Patients.js"
click node_sharingui "https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/ShareRequests.js"
click node_receiptui "https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/ShareReceipt.js"
click node_emergencyui "https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/Emergency.js"
click node_diseasesui "https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/Diseases.js"
click node_snakeui "https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/SnakeBite.js"
click node_profileui "https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/Profile.js"
click node_api "https://github.com/sushanth1411/medical_management/blob/main/frontend/src/services/api.js"
click node_flask "https://github.com/sushanth1411/medical_management/blob/main/backend/app/__init__.py"
click node_auth "https://github.com/sushanth1411/medical_management/blob/main/backend/app/routes/auth.py"
click node_doctors "https://github.com/sushanth1411/medical_management/blob/main/backend/app/routes/doctors.py"
click node_medicines "https://github.com/sushanth1411/medical_management/blob/main/backend/app/routes/medicines.py"
click node_patients "https://github.com/sushanth1411/medical_management/blob/main/backend/app/routes/patients.py"
click node_sharing "https://github.com/sushanth1411/medical_management/blob/main/backend/app/routes/share_requests.py"
click node_emergency "https://github.com/sushanth1411/medical_management/blob/main/backend/app/routes/emergency.py"
click node_reports "https://github.com/sushanth1411/medical_management/blob/main/backend/app/routes/reports.py"
click node_notifications "https://github.com/sushanth1411/medical_management/blob/main/backend/app/routes/notifications.py"
click node_users "https://github.com/sushanth1411/medical_management/blob/main/backend/app/routes/users.py"
click node_models "https://github.com/sushanth1411/medical_management/blob/main/backend/app/models.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_navbar,node_authui,node_dashboard,node_admin,node_profileui,node_user toneBlue
class node_doctorsui,node_medicineui,node_searchui,node_patientsui toneAmber
class node_sharingui,node_receiptui,node_emergencyui,node_diseasesui,node_snakeui toneMint
class node_api,node_flask,node_auth,node_doctors,node_medicines,node_patients,node_sharing,node_emergency,node_reports,node_notifications,node_users toneRose
class node_models,node_mysql toneIndigo
```

## Components

### Web application

- [App routing](https://github.com/sushanth1411/medical_management/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Navigation](https://github.com/sushanth1411/medical_management/blob/main/frontend/src/components/Navbar.js): `frontend/src/components/Navbar.js`
- [Login and signup](https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/Login.js): `frontend/src/pages/Login.js`
- [Dashboard](https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/Dashboard.js): `frontend/src/pages/Dashboard.js`
- [Admin analytics](https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/AdminPanel.js): `frontend/src/pages/AdminPanel.js`
- [User profile](https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/Profile.js): `frontend/src/pages/Profile.js`

### Clinic operations

- [Doctor schedules](https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/Doctors.js): `frontend/src/pages/Doctors.js`
- [Medicine inventory](https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/Medicines.js): `frontend/src/pages/Medicines.js`
- [Medicine search](https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/MedicineSearch.js): `frontend/src/pages/MedicineSearch.js`
- [Patients and visits](https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/Patients.js): `frontend/src/pages/Patients.js`

### Emergency and sharing

- [Medicine sharing](https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/ShareRequests.js): `frontend/src/pages/ShareRequests.js`
- [Share receipt](https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/ShareReceipt.js): `frontend/src/pages/ShareReceipt.js`
- [Emergency reports](https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/Emergency.js): `frontend/src/pages/Emergency.js`
- [Disease information](https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/Diseases.js): `frontend/src/pages/Diseases.js`
- [Snake-bite guidance](https://github.com/sushanth1411/medical_management/blob/main/frontend/src/pages/SnakeBite.js): `frontend/src/pages/SnakeBite.js`

### API services

- [API client](https://github.com/sushanth1411/medical_management/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Flask app and routing](https://github.com/sushanth1411/medical_management/blob/main/backend/app/__init__.py): `backend/app/__init__.py`
- [Authentication](https://github.com/sushanth1411/medical_management/blob/main/backend/app/routes/auth.py): `backend/app/routes/auth.py`
- [Doctor service](https://github.com/sushanth1411/medical_management/blob/main/backend/app/routes/doctors.py): `backend/app/routes/doctors.py`
- [Medicine service](https://github.com/sushanth1411/medical_management/blob/main/backend/app/routes/medicines.py): `backend/app/routes/medicines.py`
- [Patient service](https://github.com/sushanth1411/medical_management/blob/main/backend/app/routes/patients.py): `backend/app/routes/patients.py`
- [Sharing service](https://github.com/sushanth1411/medical_management/blob/main/backend/app/routes/share_requests.py): `backend/app/routes/share_requests.py`
- [Emergency service](https://github.com/sushanth1411/medical_management/blob/main/backend/app/routes/emergency.py): `backend/app/routes/emergency.py`
- [Reports and analytics](https://github.com/sushanth1411/medical_management/blob/main/backend/app/routes/reports.py): `backend/app/routes/reports.py`
- [Notifications](https://github.com/sushanth1411/medical_management/blob/main/backend/app/routes/notifications.py): `backend/app/routes/notifications.py`
- [User management](https://github.com/sushanth1411/medical_management/blob/main/backend/app/routes/users.py): `backend/app/routes/users.py`

### Persistence

- [Domain models](https://github.com/sushanth1411/medical_management/blob/main/backend/app/models.py): `backend/app/models.py`
- **MySQL database**

### Other components

- **Institute user**

## Connections

- Institute user → App routing: uses
- App routing → Login and signup: routes to (evidence: `frontend/src/App.js`)
- App routing → Dashboard: routes to (evidence: `frontend/src/App.js`)
- App routing → Doctor schedules: routes to (evidence: `frontend/src/App.js`)
- App routing → Medicine inventory: routes to (evidence: `frontend/src/App.js`)
- App routing → Medicine search: routes to (evidence: `frontend/src/App.js`)
- App routing → Medicine sharing: routes to (evidence: `frontend/src/App.js`)
- App routing → Share receipt: routes to (evidence: `frontend/src/App.js`)
- App routing → Patients and visits: routes to (evidence: `frontend/src/App.js`)
- App routing → Emergency reports: routes to (evidence: `frontend/src/App.js`)
- App routing → Disease information: routes to (evidence: `frontend/src/App.js`)
- App routing → Snake-bite guidance: routes to (evidence: `frontend/src/App.js`)
- App routing → User profile: routes to (evidence: `frontend/src/App.js`)
- App routing → Admin analytics: routes to (evidence: `frontend/src/App.js`)
- App routing → Navigation: renders (evidence: `frontend/src/App.js`)
- Login and signup → API client: authenticates via (evidence: `frontend/src/pages/Login.js`)
- Dashboard → API client: requests data (evidence: `frontend/src/pages/Dashboard.js`)
- Admin analytics → API client: requests data
- Doctor schedules → API client: requests schedules (evidence: `frontend/src/pages/Doctors.js`)
- Medicine inventory → API client: manages stock (evidence: `frontend/src/pages/Medicines.js`)
- Medicine search → API client: searches via (evidence: `frontend/src/pages/MedicineSearch.js`)
- Patients and visits → API client: manages visits (evidence: `frontend/src/pages/Patients.js`)
- Medicine sharing → API client: requests sharing (evidence: `frontend/src/pages/ShareRequests.js`)
- Emergency reports → API client: reports emergencies (evidence: `frontend/src/pages/Emergency.js`)
- Disease information → API client: fetches information (evidence: `frontend/src/pages/Diseases.js`)
- Snake-bite guidance → API client: fetches guidance (evidence: `frontend/src/pages/SnakeBite.js`)
- API client → Flask app and routing: calls API (evidence: `README.md`)
- Flask app and routing → Authentication: registers blueprint (evidence: `backend/app/__init__.py`)
- Flask app and routing → Doctor service: registers blueprint (evidence: `backend/app/__init__.py`)
- Flask app and routing → Medicine service: registers blueprint (evidence: `backend/app/__init__.py`)
- Flask app and routing → Patient service: registers blueprint (evidence: `backend/app/__init__.py`)
- Flask app and routing → Sharing service: registers blueprint (evidence: `backend/app/__init__.py`)
- Flask app and routing → Emergency service: registers blueprint (evidence: `backend/app/__init__.py`)
- Flask app and routing → Reports and analytics: registers blueprint (evidence: `backend/app/__init__.py`)
- Flask app and routing → Notifications: registers blueprint (evidence: `backend/app/__init__.py`)
- Flask app and routing → User management: registers blueprint (evidence: `backend/app/__init__.py`)
- Authentication → Domain models: queries users (evidence: `backend/app/routes/auth.py`)
- Doctor service → Domain models: uses models (evidence: `backend/app/routes/doctors.py`)
- Medicine service → Domain models: updates inventory (evidence: `backend/app/routes/medicines.py`)
- Patient service → Domain models: uses models (evidence: `backend/app/routes/patients.py`)
- Sharing service → Domain models: uses models (evidence: `backend/app/routes/share_requests.py`)
- Emergency service → Domain models: uses models (evidence: `backend/app/routes/emergency.py`)
- Reports and analytics → Domain models: uses models (evidence: `backend/app/routes/reports.py`)
- Notifications → Domain models: uses models (evidence: `backend/app/routes/notifications.py`)
- User management → Domain models: uses models (evidence: `backend/app/routes/users.py`)
- Flask app and routing → MySQL database: configures database (evidence: `backend/app/__init__.py`)
