# hemanthps007/ayushveda-final architecture

> Architecture diagram of the GitHub repository hemanthps007/ayushveda-final, 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/hemanthps007/ayushveda-final
- Repository: https://github.com/hemanthps007/ayushveda-final

## Overview

AyushVeda is a Flask-based, role-based Ayurvedic health-management application. Doctors can enter or extract symptoms, predict a disease, review medicine guidance and safety warnings, and create prescriptions; patients can view treatment history and manage appointments, payments, profiles, and location sharing. Admins manage doctors, patients, appointments, and payments. The sampled source confirms prediction, Excel lookups, safety checks, and SQLite access; broader capabilities come from the README, so uncertain integrations are shown separately.

Main entry points: [`app.py`](https://github.com/hemanthps007/ayushveda-final/blob/main/app.py) (Flask routes), [`templates/doctor`](https://github.com/hemanthps007/ayushveda-final/tree/main/templates/doctor) (Doctor portal), [`templates/patient`](https://github.com/hemanthps007/ayushveda-final/tree/main/templates/patient) (Patient portal), [`templates/admin`](https://github.com/hemanthps007/ayushveda-final/tree/main/templates/admin) (Admin portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_roles["Role Portals"]
  node_flask["Flask routes<br/>[app.py]"]
  node_doctor_portal["Doctor portal"]
  node_patient_portal["Patient portal"]
  node_admin_portal["Admin portal"]
end

subgraph group_clinical["Clinical Workflow"]
  node_symptom_capture["Symptom extraction<br/>[app.py]"]
  node_disease_model["Disease prediction<br/>[disease_model.pkl]"]
  node_symptom_vocab["Symptom vocabulary<br/>[symptoms_list.pkl]"]
  node_medicine_lookup["Medicine guidance<br/>[app.py]"]
  node_safety_check["Safety checks<br/>[app.py]"]
end

subgraph group_records["Care Records"]
  node_prescriptions["Prescriptions<br/>[app.py]"]
  node_appointments["Appointments<br/>[app.py]"]
  node_payments["Payments<br/>[app.py]"]
  node_profiles["Profiles and history<br/>[app.py]"]
  node_location["Patient location<br/>[app.py]"]
end

subgraph group_integrations["Data and Integrations"]
  node_database[("SQLite records<br/>[ayurcare.db]")]
  node_ayurvedic_data["Ayurvedic medicines"]
  node_allopathic_data["Allopathic medicines"]
  node_gemini["Gemini AI"]
  node_email["Email service"]
end

node_doctor(("Doctor"))
node_patient(("Patient"))
node_admin(("Admin"))

node_doctor -->|"uses"| node_doctor_portal
node_patient -->|"uses"| node_patient_portal
node_admin -->|"uses"| node_admin_portal
node_doctor_portal -->|"submits requests"| node_flask
node_patient_portal -->|"submits requests"| node_flask
node_admin_portal -->|"submits requests"| node_flask
node_flask -->|"extracts symptoms"| node_symptom_capture
node_symptom_capture -->|"matches against"| node_symptom_vocab
node_symptom_capture -.->|"optional extraction"| node_gemini
node_flask -->|"predicts disease"| node_disease_model
node_flask -->|"looks up guidance"| node_medicine_lookup
node_medicine_lookup -->|"reads"| node_ayurvedic_data
node_medicine_lookup -->|"reads"| node_allopathic_data
node_flask -->|"checks patient risks"| node_safety_check
node_flask -->|"creates and reads"| node_prescriptions
node_flask -->|"manages"| node_appointments
node_flask -->|"manages"| node_payments
node_flask -->|"manages"| node_profiles
node_flask -->|"updates and reads"| node_location
node_flask -->|"reads and writes"| node_database
node_flask -.->|"reassignment alert"| node_email

click node_flask "https://github.com/hemanthps007/ayushveda-final/blob/main/app.py"
click node_doctor_portal "https://github.com/hemanthps007/ayushveda-final/tree/main/templates/doctor"
click node_patient_portal "https://github.com/hemanthps007/ayushveda-final/tree/main/templates/patient"
click node_admin_portal "https://github.com/hemanthps007/ayushveda-final/tree/main/templates/admin"
click node_symptom_capture "https://github.com/hemanthps007/ayushveda-final/blob/main/app.py"
click node_disease_model "https://github.com/hemanthps007/ayushveda-final/blob/main/ml_model/disease_model.pkl"
click node_symptom_vocab "https://github.com/hemanthps007/ayushveda-final/blob/main/ml_model/symptoms_list.pkl"
click node_medicine_lookup "https://github.com/hemanthps007/ayushveda-final/blob/main/app.py"
click node_safety_check "https://github.com/hemanthps007/ayushveda-final/blob/main/app.py"
click node_prescriptions "https://github.com/hemanthps007/ayushveda-final/blob/main/app.py"
click node_appointments "https://github.com/hemanthps007/ayushveda-final/blob/main/app.py"
click node_payments "https://github.com/hemanthps007/ayushveda-final/blob/main/app.py"
click node_profiles "https://github.com/hemanthps007/ayushveda-final/blob/main/app.py"
click node_location "https://github.com/hemanthps007/ayushveda-final/blob/main/app.py"
click node_database "https://github.com/hemanthps007/ayushveda-final/blob/main/ayurcare.db"
click node_ayurvedic_data "https://github.com/hemanthps007/ayushveda-final/blob/main/data/ayurvedic_medicines.xlsx"
click node_allopathic_data "https://github.com/hemanthps007/ayushveda-final/blob/main/data/allopathic_medicines.xlsx"

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_doctor_portal,node_patient_portal,node_admin_portal toneBlue
class node_symptom_capture,node_disease_model,node_symptom_vocab,node_medicine_lookup,node_safety_check toneAmber
class node_prescriptions,node_appointments,node_payments,node_profiles,node_location toneMint
class node_database,node_ayurvedic_data,node_allopathic_data,node_gemini,node_email toneRose
class node_doctor,node_patient,node_admin toneIndigo
```

## Components

### Role Portals

- [Flask routes](https://github.com/hemanthps007/ayushveda-final/blob/main/app.py): `app.py`
- [Doctor portal](https://github.com/hemanthps007/ayushveda-final/tree/main/templates/doctor): `templates/doctor`
- [Patient portal](https://github.com/hemanthps007/ayushveda-final/tree/main/templates/patient): `templates/patient`
- [Admin portal](https://github.com/hemanthps007/ayushveda-final/tree/main/templates/admin): `templates/admin`

### Clinical Workflow

- [Symptom extraction](https://github.com/hemanthps007/ayushveda-final/blob/main/app.py): `app.py`
- [Disease prediction](https://github.com/hemanthps007/ayushveda-final/blob/main/ml_model/disease_model.pkl): `ml_model/disease_model.pkl`
- [Symptom vocabulary](https://github.com/hemanthps007/ayushveda-final/blob/main/ml_model/symptoms_list.pkl): `ml_model/symptoms_list.pkl`
- [Medicine guidance](https://github.com/hemanthps007/ayushveda-final/blob/main/app.py): `app.py`
- [Safety checks](https://github.com/hemanthps007/ayushveda-final/blob/main/app.py): `app.py`

### Care Records

- [Prescriptions](https://github.com/hemanthps007/ayushveda-final/blob/main/app.py): `app.py`
- [Appointments](https://github.com/hemanthps007/ayushveda-final/blob/main/app.py): `app.py`
- [Payments](https://github.com/hemanthps007/ayushveda-final/blob/main/app.py): `app.py`
- [Profiles and history](https://github.com/hemanthps007/ayushveda-final/blob/main/app.py): `app.py`
- [Patient location](https://github.com/hemanthps007/ayushveda-final/blob/main/app.py): `app.py`

### Data and Integrations

- [SQLite records](https://github.com/hemanthps007/ayushveda-final/blob/main/ayurcare.db): `ayurcare.db`
- [Ayurvedic medicines](https://github.com/hemanthps007/ayushveda-final/blob/main/data/ayurvedic_medicines.xlsx): `data/ayurvedic_medicines.xlsx`
- [Allopathic medicines](https://github.com/hemanthps007/ayushveda-final/blob/main/data/allopathic_medicines.xlsx): `data/allopathic_medicines.xlsx`
- **Gemini AI**
- **Email service**

### Other components

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

## Connections

- Doctor → Doctor portal: uses
- Patient → Patient portal: uses
- Admin → Admin portal: uses
- Doctor portal → Flask routes: submits requests
- Patient portal → Flask routes: submits requests
- Admin portal → Flask routes: submits requests
- Flask routes → Symptom extraction: extracts symptoms
- Symptom extraction → Symptom vocabulary: matches against
- Symptom extraction → Gemini AI: optional extraction
- Flask routes → Disease prediction: predicts disease
- Flask routes → Medicine guidance: looks up guidance
- Medicine guidance → Ayurvedic medicines: reads
- Medicine guidance → Allopathic medicines: reads
- Flask routes → Safety checks: checks patient risks
- Flask routes → Prescriptions: creates and reads
- Flask routes → Appointments: manages
- Flask routes → Payments: manages
- Flask routes → Profiles and history: manages
- Flask routes → Patient location: updates and reads
- Flask routes → SQLite records: reads and writes
- Flask routes → Email service: reassignment alert
