# mrnobody23-cloude/ai-healthcare-system architecture

> Architecture diagram of the GitHub repository mrnobody23-cloude/ai-healthcare-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mrnobody23-cloude/ai-healthcare-system
- Repository: https://github.com/mrnobody23-cloude/ai-healthcare-system

## Overview

MedVault is a patient-and-doctor healthcare portal for account access, doctor discovery and appointments, health-data and medical-record management, access requests, and disease-risk analysis. Users enter through the React application; its role-specific pages use the API service to reach the Flask backend, which coordinates persistence and, for analysis, disease models. The database supports MongoDB or in-memory storage, and the frontend also has localStorage utilities. Source excerpts are partial, so uncertain route-to-model and page-to-endpoint wiring is not asserted.

Main entry points: [`backend/app.py`](https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/backend/app.py) (HTTP API), [`frontend/src/App.jsx`](https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/frontend/src/App.jsx) (App shell), [`frontend/src/services/api.js`](https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/frontend/src/services/api.js) (API client), [`frontend/src/pages/patient`](https://github.com/mrnobody23-cloude/ai-healthcare-system/tree/main/frontend/src/pages/patient) (Patient pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["App shell<br/>[App.jsx]"]
  node_login["Sign in<br/>[Login.jsx]"]
  node_patient_pages["Patient pages"]
  node_doctor_pages["Doctor pages"]
  node_api["API client<br/>[api.js]"]
  node_browser_store[("Browser storage<br/>[storage.js]")]
  node_ai_page["AI analysis page<br/>[AIAnalysis.jsx]"]
end

subgraph group_backend["Backend services"]
  node_flask["HTTP API<br/>[app.py]"]
  node_crypto["Encryption<br/>[encryption.py]"]
  node_ai_api["Prediction API<br/>[app.py]"]
end

subgraph group_data["Health data"]
  node_database["Data access<br/>[database.py]"]
  node_mongo[("MongoDB")]
  node_memory[("Memory store<br/>[database.py]")]
  node_medical_records["Medical records<br/>[app.py]"]
  node_appointments["Appointments<br/>[app.py]"]
  node_health["Health data<br/>[app.py]"]
  node_access["Access requests<br/>[app.py]"]
end

subgraph group_analysis["AI analysis"]
  node_models["Disease models"]
end

node_patient(("Patient"))
node_doctor(("Doctor"))

node_patient -->|"uses"| node_app
node_doctor -->|"uses"| node_app
node_app -->|"renders"| node_login
node_app -->|"renders"| node_patient_pages
node_app -->|"renders"| node_doctor_pages
node_login -->|"authenticates through"| node_api
node_app -->|"syncs through"| node_api
node_app -->|"reads and writes"| node_browser_store
node_patient_pages -->|"requests data"| node_api
node_doctor_pages -->|"requests data"| node_api
node_api -->|"sends HTTP requests"| node_flask
node_flask -->|"reads and writes"| node_database
node_database -.->|"uses when configured"| node_mongo
node_database -.->|"falls back to"| node_memory
node_flask -->|"encrypts and decrypts"| node_crypto
node_flask -->|"handles record routes"| node_medical_records
node_flask -->|"handles appointment routes"| node_appointments
node_flask -->|"handles health routes"| node_health
node_flask -->|"handles access routes"| node_access
node_patient_pages -->|"includes"| node_ai_page
node_ai_page -->|"requests analysis"| node_api
node_flask -->|"serves prediction routes"| node_ai_api
node_ai_api -.->|"runs predictions"| node_models

click node_app "https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/frontend/src/App.jsx"
click node_login "https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/frontend/src/pages/Login.jsx"
click node_patient_pages "https://github.com/mrnobody23-cloude/ai-healthcare-system/tree/main/frontend/src/pages/patient"
click node_doctor_pages "https://github.com/mrnobody23-cloude/ai-healthcare-system/tree/main/frontend/src/pages/doctor"
click node_api "https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/frontend/src/services/api.js"
click node_browser_store "https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/frontend/src/utils/storage.js"
click node_flask "https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/backend/app.py"
click node_crypto "https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/backend/encryption.py"
click node_database "https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/backend/database.py"
click node_memory "https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/backend/database.py"
click node_medical_records "https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/backend/app.py"
click node_appointments "https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/backend/app.py"
click node_health "https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/backend/app.py"
click node_access "https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/backend/app.py"
click node_ai_page "https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/frontend/src/pages/patient/AIAnalysis.jsx"
click node_ai_api "https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/backend/app.py"
click node_models "https://github.com/mrnobody23-cloude/ai-healthcare-system/tree/main/backend/ml_models"

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_login,node_patient_pages,node_doctor_pages,node_api,node_browser_store,node_ai_page toneBlue
class node_flask,node_crypto,node_ai_api toneAmber
class node_database,node_mongo,node_memory,node_medical_records,node_appointments,node_health,node_access toneMint
class node_models toneRose
class node_patient,node_doctor toneIndigo
```

## Components

### Web application

- [App shell](https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign in](https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Patient pages](https://github.com/mrnobody23-cloude/ai-healthcare-system/tree/main/frontend/src/pages/patient): `frontend/src/pages/patient`
- [Doctor pages](https://github.com/mrnobody23-cloude/ai-healthcare-system/tree/main/frontend/src/pages/doctor): `frontend/src/pages/doctor`
- [API client](https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Browser storage](https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/frontend/src/utils/storage.js): `frontend/src/utils/storage.js`
- [AI analysis page](https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/frontend/src/pages/patient/AIAnalysis.jsx): `frontend/src/pages/patient/AIAnalysis.jsx`

### Backend services

- [HTTP API](https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/backend/app.py): `backend/app.py`
- [Encryption](https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/backend/encryption.py): `backend/encryption.py`
- [Prediction API](https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/backend/app.py): `backend/app.py`

### Health data

- [Data access](https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/backend/database.py): `backend/database.py`
- **MongoDB**
- [Memory store](https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/backend/database.py): `backend/database.py`
- [Medical records](https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/backend/app.py): `backend/app.py`
- [Appointments](https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/backend/app.py): `backend/app.py`
- [Health data](https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/backend/app.py): `backend/app.py`
- [Access requests](https://github.com/mrnobody23-cloude/ai-healthcare-system/blob/main/backend/app.py): `backend/app.py`

### AI analysis

- [Disease models](https://github.com/mrnobody23-cloude/ai-healthcare-system/tree/main/backend/ml_models): `backend/ml_models`

### Other components

- **Patient**
- **Doctor**

## Connections

- Patient → App shell: uses
- Doctor → App shell: uses
- App shell → Sign in: renders
- App shell → Patient pages: renders
- App shell → Doctor pages: renders
- Sign in → API client: authenticates through
- App shell → API client: syncs through
- App shell → Browser storage: reads and writes
- Patient pages → API client: requests data
- Doctor pages → API client: requests data
- API client → HTTP API: sends HTTP requests
- HTTP API → Data access: reads and writes
- Data access → MongoDB: uses when configured
- Data access → Memory store: falls back to
- HTTP API → Encryption: encrypts and decrypts
- HTTP API → Medical records: handles record routes
- HTTP API → Appointments: handles appointment routes
- HTTP API → Health data: handles health routes
- HTTP API → Access requests: handles access routes
- Patient pages → AI analysis page: includes
- AI analysis page → API client: requests analysis
- HTTP API → Prediction API: serves prediction routes
- Prediction API → Disease models: runs predictions
