# kartik-h6/healthcare-ai architecture

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

- Interactive diagram: https://gitdiagram.com/kartik-h6/healthcare-ai
- Repository: https://github.com/kartik-h6/healthcare-ai

## Overview

Healthcare AI is a Flask healthcare-support application. Its principal workflow takes an authenticated user’s selected symptoms through ML disease classification, enriches the result with disease-specific recommendations, then presents and stores the prediction. Separate branches provide chatbot answers, downloadable reports, account/history tools, and administration of users, predictions, and healthcare data. The README documents these capabilities; some connections are therefore shown from that documentation where sampled source does not expose the call site.

Main entry points: [`routes/prediction.py`](https://github.com/kartik-h6/healthcare-ai/blob/main/routes/prediction.py) (Symptom prediction), [`db.py`](https://github.com/kartik-h6/healthcare-ai/blob/main/db.py) (Database connector), [`app.py`](https://github.com/kartik-h6/healthcare-ai/blob/main/app.py) (Flask application), [`routes/admin.py`](https://github.com/kartik-h6/healthcare-ai/blob/main/routes/admin.py) (Admin panel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Flask application<br/>[app.py]"]
  node_result["Prediction result"]
  node_pdf["PDF reports<br/>[pdf_service.py]"]
  node_chat_route["Chat interface<br/>[chatbot.py]"]
  node_config["Application settings<br/>[config.py]"]
end

subgraph group_prediction["Prediction and guidance"]
  node_prediction_route["Symptom prediction<br/>[prediction.py]"]
  node_symptoms["Symptom catalog<br/>[symptoms_master.py]"]
  node_model["Disease classifier<br/>[predict.py]"]
  node_recommendations["Disease recommendations"]
  node_health_data["Healthcare datasets"]
  node_chat_service["Healthcare chatbot<br/>[chatbot_service.py]"]
end

subgraph group_account["Accounts and records"]
  node_auth["Authentication<br/>[auth.py]"]
  node_db["Database connector<br/>[db.py]"]
  node_history["Prediction history<br/>[history_service.py]"]
  node_profile["Profile management<br/>[profile_service.py]"]
end

subgraph group_operations["Healthcare administration"]
  node_admin["Admin panel<br/>[admin.py]"]
end

node_patient(("User"))
node_oracle[("Oracle database")]

node_patient -->|"uses"| node_app
node_app -->|"registers routes"| node_auth
node_auth -->|"requests connection"| node_db
node_db -->|"loads settings"| node_config
node_db -->|"connects"| node_oracle
node_patient -->|"selects symptoms"| node_prediction_route
node_prediction_route -->|"predicts disease"| node_model
node_prediction_route -->|"gets guidance"| node_recommendations
node_recommendations -->|"reads information"| node_health_data
node_symptoms -.->|"supplies symptom names"| node_prediction_route
node_prediction_route -->|"renders result"| node_result
node_prediction_route -->|"saves prediction"| node_history
node_history -->|"stores records"| node_db
node_app -->|"provides reports"| node_pdf
node_patient -->|"asks questions"| node_chat_route
node_chat_route -->|"delegates answers"| node_chat_service
node_chat_service -.->|"retrieves disease details"| node_health_data
node_app -->|"uses profile service"| node_profile
node_profile -->|"reads profile data"| node_db
node_app -->|"registers routes"| node_admin
node_admin -->|"manages records"| node_db
node_admin -->|"manages datasets"| node_health_data

click node_app "https://github.com/kartik-h6/healthcare-ai/blob/main/app.py"
click node_auth "https://github.com/kartik-h6/healthcare-ai/blob/main/routes/auth.py"
click node_db "https://github.com/kartik-h6/healthcare-ai/blob/main/db.py"
click node_prediction_route "https://github.com/kartik-h6/healthcare-ai/blob/main/routes/prediction.py"
click node_symptoms "https://github.com/kartik-h6/healthcare-ai/blob/main/dataset/symptoms_master.py"
click node_model "https://github.com/kartik-h6/healthcare-ai/blob/main/ml/predict.py"
click node_recommendations "https://github.com/kartik-h6/healthcare-ai/blob/main/services/recommendation_service.py"
click node_health_data "https://github.com/kartik-h6/healthcare-ai/tree/main/dataset"
click node_result "https://github.com/kartik-h6/healthcare-ai/blob/main/templates/prediction_result.html"
click node_history "https://github.com/kartik-h6/healthcare-ai/blob/main/services/history_service.py"
click node_pdf "https://github.com/kartik-h6/healthcare-ai/blob/main/services/pdf_service.py"
click node_chat_route "https://github.com/kartik-h6/healthcare-ai/blob/main/routes/chatbot.py"
click node_chat_service "https://github.com/kartik-h6/healthcare-ai/blob/main/services/chatbot_service.py"
click node_profile "https://github.com/kartik-h6/healthcare-ai/blob/main/services/profile_service.py"
click node_admin "https://github.com/kartik-h6/healthcare-ai/blob/main/routes/admin.py"
click node_config "https://github.com/kartik-h6/healthcare-ai/blob/main/config.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_result,node_pdf,node_chat_route,node_config,node_patient toneBlue
class node_prediction_route,node_symptoms,node_model,node_recommendations,node_health_data,node_chat_service,node_oracle toneAmber
class node_auth,node_db,node_history,node_profile toneMint
class node_admin toneRose
```

## Components

### Web application

- [Flask application](https://github.com/kartik-h6/healthcare-ai/blob/main/app.py): `app.py`
- [Prediction result](https://github.com/kartik-h6/healthcare-ai/blob/main/templates/prediction_result.html): `templates/prediction_result.html`
- [PDF reports](https://github.com/kartik-h6/healthcare-ai/blob/main/services/pdf_service.py): `services/pdf_service.py`
- [Chat interface](https://github.com/kartik-h6/healthcare-ai/blob/main/routes/chatbot.py): `routes/chatbot.py`
- [Application settings](https://github.com/kartik-h6/healthcare-ai/blob/main/config.py): `config.py`

### Prediction and guidance

- [Symptom prediction](https://github.com/kartik-h6/healthcare-ai/blob/main/routes/prediction.py): `routes/prediction.py`
- [Symptom catalog](https://github.com/kartik-h6/healthcare-ai/blob/main/dataset/symptoms_master.py): `dataset/symptoms_master.py`
- [Disease classifier](https://github.com/kartik-h6/healthcare-ai/blob/main/ml/predict.py): `ml/predict.py`
- [Disease recommendations](https://github.com/kartik-h6/healthcare-ai/blob/main/services/recommendation_service.py): `services/recommendation_service.py`
- [Healthcare datasets](https://github.com/kartik-h6/healthcare-ai/tree/main/dataset): `dataset`
- [Healthcare chatbot](https://github.com/kartik-h6/healthcare-ai/blob/main/services/chatbot_service.py): `services/chatbot_service.py`

### Accounts and records

- [Authentication](https://github.com/kartik-h6/healthcare-ai/blob/main/routes/auth.py): `routes/auth.py`
- [Database connector](https://github.com/kartik-h6/healthcare-ai/blob/main/db.py): `db.py`
- [Prediction history](https://github.com/kartik-h6/healthcare-ai/blob/main/services/history_service.py): `services/history_service.py`
- [Profile management](https://github.com/kartik-h6/healthcare-ai/blob/main/services/profile_service.py): `services/profile_service.py`

### Healthcare administration

- [Admin panel](https://github.com/kartik-h6/healthcare-ai/blob/main/routes/admin.py): `routes/admin.py`

### Other components

- **User**
- **Oracle database**

## Connections

- User → Flask application: uses (evidence: `README.md`)
- Flask application → Authentication: registers routes (evidence: `app.py`)
- Authentication → Database connector: requests connection (evidence: `routes/auth.py`)
- Database connector → Application settings: loads settings (evidence: `db.py`)
- Database connector → Oracle database: connects (evidence: `db.py`)
- User → Symptom prediction: selects symptoms (evidence: `README.md`)
- Symptom prediction → Disease classifier: predicts disease (evidence: `routes/prediction.py`)
- Symptom prediction → Disease recommendations: gets guidance (evidence: `routes/prediction.py`)
- Disease recommendations → Healthcare datasets: reads information (evidence: `README.md`)
- Symptom catalog → Symptom prediction: supplies symptom names
- Symptom prediction → Prediction result: renders result (evidence: `README.md`)
- Symptom prediction → Prediction history: saves prediction (evidence: `routes/prediction.py`)
- Prediction history → Database connector: stores records (evidence: `services/history_service.py`)
- Flask application → PDF reports: provides reports (evidence: `README.md`)
- User → Chat interface: asks questions (evidence: `README.md`)
- Chat interface → Healthcare chatbot: delegates answers (evidence: `routes/chatbot.py`)
- Healthcare chatbot → Healthcare datasets: retrieves disease details
- Flask application → Profile management: uses profile service (evidence: `app.py`)
- Profile management → Database connector: reads profile data (evidence: `services/profile_service.py`)
- Flask application → Admin panel: registers routes (evidence: `app.py`)
- Admin panel → Database connector: manages records (evidence: `routes/admin.py`)
- Admin panel → Healthcare datasets: manages datasets (evidence: `README.md`)
