# jagannatha-dev/healthcare-ai architecture

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

- Interactive diagram: https://gitdiagram.com/jagannatha-dev/healthcare-ai
- Repository: https://github.com/jagannatha-dev/healthcare-ai

## Overview

Healthcare AI is a Flask-based symptom-to-disease decision-support application. The documented user journey runs from account access and symptom selection through ML prediction, disease-specific recommendations, and result review; history and PDF reporting persist or export completed predictions. Separate branches provide chatbot answers, profile tools, and administration. The tree and excerpts support the main entry points and service responsibilities, while wiring inside unsampled routes is represented only where documented or visible.

Main entry points: [`app.py`](https://github.com/jagannatha-dev/healthcare-ai/blob/main/app.py) (Flask application), [`db.py`](https://github.com/jagannatha-dev/healthcare-ai/blob/main/db.py) (Database access), [`routes/prediction.py`](https://github.com/jagannatha-dev/healthcare-ai/blob/main/routes/prediction.py) (Prediction route), [`ml/predict.py`](https://github.com/jagannatha-dev/healthcare-ai/blob/main/ml/predict.py) (Disease classifier)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_flask["Flask application<br/>[app.py]"]
  node_chat_ui["Chat interface<br/>[chatbot.js]"]
end

subgraph group_clinical["Prediction and guidance"]
  node_prediction_route["Prediction route<br/>[prediction.py]"]
  node_classifier["Disease classifier<br/>[predict.py]"]
  node_symptoms["Symptom vocabulary<br/>[symptoms_master.py]"]
  node_training_data["Model datasets<br/>[Training.csv]"]
  node_recommendations["Recommendation service"]
  node_health_data["Healthcare CSVs"]
  node_results["Prediction results"]
  node_chat_route["Chatbot route<br/>[chatbot.py]"]
  node_chat_service["Chatbot service<br/>[chatbot_service.py]"]
end

subgraph group_account["Accounts and records"]
  node_auth["Authentication<br/>[auth.py]"]
  node_history_route["History routes<br/>[history.py]"]
  node_history_service["History service<br/>[history_service.py]"]
  node_pdf["PDF reports<br/>[pdf_service.py]"]
  node_profile_route["Profile routes<br/>[profile.py]"]
  node_profile_service["Profile service<br/>[profile_service.py]"]
  node_db_api["Database access<br/>[db.py]"]
  node_oracle[("Oracle database")]
end

subgraph group_admin["Administration"]
  node_admin_routes["Admin panel<br/>[admin.py]"]
end

node_user(("User"))
node_admin_actor(("Administrator"))
node_browser(("Web browser"))

node_user -->|"uses"| node_browser
node_browser -->|"sends requests"| node_flask
node_flask -->|"registers routes"| node_auth
node_flask -->|"registers routes"| node_prediction_route
node_flask -->|"registers routes"| node_admin_routes
node_auth -->|"queries"| node_db_api
node_prediction_route -->|"predicts symptoms"| node_classifier
node_prediction_route -->|"retrieves guidance"| node_recommendations
node_classifier -->|"uses vocabulary"| node_symptoms
node_classifier -.->|"trained from"| node_training_data
node_recommendations -->|"reads"| node_health_data
node_prediction_route -->|"renders result"| node_results
node_browser -->|"asks questions"| node_chat_ui
node_chat_ui -->|"posts message"| node_chat_route
node_chat_route -->|"gets reply"| node_chat_service
node_chat_service -->|"looks up information"| node_health_data
node_flask -->|"serves history"| node_history_route
node_history_route -->|"retrieves records"| node_history_service
node_history_service -->|"reads and writes"| node_db_api
node_flask -->|"serves profile"| node_profile_route
node_profile_route -->|"manages profile"| node_profile_service
node_profile_service -->|"reads and writes"| node_db_api
node_flask -->|"generates report"| node_pdf
node_pdf -->|"returns PDF"| node_browser
node_admin_actor -->|"manages system"| node_browser
node_admin_routes -->|"manages records"| node_db_api
node_admin_routes -->|"updates CSVs"| node_health_data
node_db_api -->|"connects"| node_oracle

click node_flask "https://github.com/jagannatha-dev/healthcare-ai/blob/main/app.py"
click node_auth "https://github.com/jagannatha-dev/healthcare-ai/blob/main/routes/auth.py"
click node_prediction_route "https://github.com/jagannatha-dev/healthcare-ai/blob/main/routes/prediction.py"
click node_classifier "https://github.com/jagannatha-dev/healthcare-ai/blob/main/ml/predict.py"
click node_symptoms "https://github.com/jagannatha-dev/healthcare-ai/blob/main/dataset/symptoms_master.py"
click node_training_data "https://github.com/jagannatha-dev/healthcare-ai/blob/main/dataset/Training.csv"
click node_recommendations "https://github.com/jagannatha-dev/healthcare-ai/blob/main/services/recommendation_service.py"
click node_health_data "https://github.com/jagannatha-dev/healthcare-ai/tree/main/dataset"
click node_results "https://github.com/jagannatha-dev/healthcare-ai/blob/main/templates/prediction_result.html"
click node_chat_route "https://github.com/jagannatha-dev/healthcare-ai/blob/main/routes/chatbot.py"
click node_chat_service "https://github.com/jagannatha-dev/healthcare-ai/blob/main/services/chatbot_service.py"
click node_chat_ui "https://github.com/jagannatha-dev/healthcare-ai/blob/main/static/js/chatbot.js"
click node_history_route "https://github.com/jagannatha-dev/healthcare-ai/blob/main/routes/history.py"
click node_history_service "https://github.com/jagannatha-dev/healthcare-ai/blob/main/services/history_service.py"
click node_pdf "https://github.com/jagannatha-dev/healthcare-ai/blob/main/services/pdf_service.py"
click node_profile_route "https://github.com/jagannatha-dev/healthcare-ai/blob/main/routes/profile.py"
click node_profile_service "https://github.com/jagannatha-dev/healthcare-ai/blob/main/services/profile_service.py"
click node_admin_routes "https://github.com/jagannatha-dev/healthcare-ai/blob/main/routes/admin.py"
click node_db_api "https://github.com/jagannatha-dev/healthcare-ai/blob/main/db.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_flask,node_chat_ui,node_user,node_browser toneBlue
class node_prediction_route,node_classifier,node_symptoms,node_training_data,node_recommendations,node_health_data,node_results,node_chat_route,node_chat_service toneAmber
class node_auth,node_history_route,node_history_service,node_pdf,node_profile_route,node_profile_service,node_db_api,node_oracle toneMint
class node_admin_routes toneRose
class node_admin_actor toneIndigo
```

## Components

### Web application

- [Flask application](https://github.com/jagannatha-dev/healthcare-ai/blob/main/app.py): `app.py`
- [Chat interface](https://github.com/jagannatha-dev/healthcare-ai/blob/main/static/js/chatbot.js): `static/js/chatbot.js`

### Prediction and guidance

- [Prediction route](https://github.com/jagannatha-dev/healthcare-ai/blob/main/routes/prediction.py): `routes/prediction.py`
- [Disease classifier](https://github.com/jagannatha-dev/healthcare-ai/blob/main/ml/predict.py): `ml/predict.py`
- [Symptom vocabulary](https://github.com/jagannatha-dev/healthcare-ai/blob/main/dataset/symptoms_master.py): `dataset/symptoms_master.py`
- [Model datasets](https://github.com/jagannatha-dev/healthcare-ai/blob/main/dataset/Training.csv): `dataset/Training.csv`
- [Recommendation service](https://github.com/jagannatha-dev/healthcare-ai/blob/main/services/recommendation_service.py): `services/recommendation_service.py`
- [Healthcare CSVs](https://github.com/jagannatha-dev/healthcare-ai/tree/main/dataset): `dataset`
- [Prediction results](https://github.com/jagannatha-dev/healthcare-ai/blob/main/templates/prediction_result.html): `templates/prediction_result.html`
- [Chatbot route](https://github.com/jagannatha-dev/healthcare-ai/blob/main/routes/chatbot.py): `routes/chatbot.py`
- [Chatbot service](https://github.com/jagannatha-dev/healthcare-ai/blob/main/services/chatbot_service.py): `services/chatbot_service.py`

### Accounts and records

- [Authentication](https://github.com/jagannatha-dev/healthcare-ai/blob/main/routes/auth.py): `routes/auth.py`
- [History routes](https://github.com/jagannatha-dev/healthcare-ai/blob/main/routes/history.py): `routes/history.py`
- [History service](https://github.com/jagannatha-dev/healthcare-ai/blob/main/services/history_service.py): `services/history_service.py`
- [PDF reports](https://github.com/jagannatha-dev/healthcare-ai/blob/main/services/pdf_service.py): `services/pdf_service.py`
- [Profile routes](https://github.com/jagannatha-dev/healthcare-ai/blob/main/routes/profile.py): `routes/profile.py`
- [Profile service](https://github.com/jagannatha-dev/healthcare-ai/blob/main/services/profile_service.py): `services/profile_service.py`
- [Database access](https://github.com/jagannatha-dev/healthcare-ai/blob/main/db.py): `db.py`
- **Oracle database**

### Administration

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

### Other components

- **User**
- **Administrator**
- **Web browser**

## Connections

- User → Web browser: uses
- Web browser → Flask application: sends requests
- Flask application → Authentication: registers routes
- Flask application → Prediction route: registers routes
- Flask application → Admin panel: registers routes
- Authentication → Database access: queries
- Prediction route → Disease classifier: predicts symptoms
- Prediction route → Recommendation service: retrieves guidance
- Disease classifier → Symptom vocabulary: uses vocabulary
- Disease classifier → Model datasets: trained from
- Recommendation service → Healthcare CSVs: reads
- Prediction route → Prediction results: renders result
- Web browser → Chat interface: asks questions
- Chat interface → Chatbot route: posts message
- Chatbot route → Chatbot service: gets reply
- Chatbot service → Healthcare CSVs: looks up information
- Flask application → History routes: serves history
- History routes → History service: retrieves records
- History service → Database access: reads and writes
- Flask application → Profile routes: serves profile
- Profile routes → Profile service: manages profile
- Profile service → Database access: reads and writes
- Flask application → PDF reports: generates report
- PDF reports → Web browser: returns PDF
- Administrator → Web browser: manages system
- Admin panel → Database access: manages records
- Admin panel → Healthcare CSVs: updates CSVs
- Database access → Oracle database: connects
