# aashutosh-mahajan/arogyatrack architecture

> Architecture diagram of the GitHub repository aashutosh-mahajan/arogyatrack, 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/aashutosh-mahajan/arogyatrack
- Repository: https://github.com/aashutosh-mahajan/arogyatrack

## Overview

ArogyaTrack is a multi-role healthcare platform whose primary workflow moves from patient onboarding and verified clinical access through consultation, prescribing, pharmacy dispensing, and adherence follow-up. Its Next.js portals expose patient, clinician, pharmacy, and administrative workflows over a Django backend; the surveillance branch aggregates anonymized disease data for outbreak analysis and dashboards. The README documents several integrations and capabilities whose implementation files were not sampled, so those links are documented relationships rather than source-verified call paths.

Main entry points: [`frontend/app/doctor/dashboard/page.tsx`](https://github.com/aashutosh-mahajan/arogyatrack/blob/main/frontend/app/doctor/dashboard/page.tsx) (Doctor Portal), [`backend/accounts`](https://github.com/aashutosh-mahajan/arogyatrack/tree/main/backend/accounts) (Accounts and RBAC), [`frontend/app/dashboard/page.tsx`](https://github.com/aashutosh-mahajan/arogyatrack/blob/main/frontend/app/dashboard/page.tsx) (Patient Portal), [`frontend/app/pharmacy/page.tsx`](https://github.com/aashutosh-mahajan/arogyatrack/blob/main/frontend/app/pharmacy/page.tsx) (Pharmacy Portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portals["Role Portals"]
  node_patient_portal["Patient Portal<br/>[page.tsx]"]
  node_doctor_portal["Doctor Portal<br/>[page.tsx]"]
  node_pharmacy_portal["Pharmacy Portal<br/>[page.tsx]"]
  node_admin_portal["Admin Portal<br/>[page.tsx]"]
  node_surveillance_portal["Surveillance Dashboard<br/>[page.tsx]"]
end

subgraph group_identity["Identity and Access"]
  node_auth["Accounts and RBAC"]
end

subgraph group_clinical["Clinical Care"]
  node_patient_profile["Patient Profile"]
  node_health_card["QR Health Card<br/>[models.py]"]
  node_clinical_records[("Clinical Records<br/>[models.py]")]
  node_record_documents["PDF Records"]
  node_dashboard["Patient Health Dashboard"]
end

subgraph group_medication["Medication Lifecycle"]
  node_prescriptions[("Digital Prescriptions<br/>[models.py]")]
  node_safety_review["Drug Safety Review"]
  node_pharmacy[("Pharmacy and Inventory")]
  node_adherence["Dose Adherence<br/>[services.py]"]
  node_reminders["Dose Reminders<br/>[tasks.py]"]
end

subgraph group_surveillance["Public Health Surveillance"]
  node_surveillance_data[("Surveillance Data<br/>[models.py]")]
  node_surveillance_ml["ML Analytics<br/>[services.py]"]
  node_surveillance_tasks["Surveillance Tasks<br/>[tasks.py]"]
end

node_patient(("Patient"))
node_doctor(("Doctor"))
node_pharmacist(("Pharmacist"))
node_admin(("Administrator"))

node_patient -->|"uses"| node_patient_portal
node_doctor -->|"uses"| node_doctor_portal
node_pharmacist -->|"uses"| node_pharmacy_portal
node_admin -->|"uses"| node_admin_portal
node_patient_portal -->|"registers and verifies"| node_auth
node_doctor_portal -->|"authenticates"| node_auth
node_pharmacy_portal -->|"authenticates"| node_auth
node_admin_portal -->|"reviews access"| node_auth
node_auth -->|"creates profile"| node_patient_profile
node_patient_profile -->|"generates QR card"| node_health_card
node_doctor_portal -->|"scans card"| node_health_card
node_health_card -->|"grants timed access"| node_clinical_records
node_doctor_portal -->|"records consultation"| node_clinical_records
node_clinical_records -->|"exports records"| node_record_documents
node_doctor_portal -->|"creates prescription"| node_prescriptions
node_prescriptions -->|"checks interactions"| node_safety_review
node_pharmacy_portal -->|"verifies QR"| node_prescriptions
node_pharmacy_portal -->|"dispenses and updates stock"| node_pharmacy
node_prescriptions -->|"schedules dispensed doses"| node_adherence
node_adherence -->|"triggers reminders"| node_reminders
node_patient_portal -->|"records doses"| node_adherence
node_patient_portal -->|"views health summary"| node_dashboard
node_admin_portal -->|"opens analytics"| node_surveillance_portal
node_surveillance_data -->|"feeds analysis"| node_surveillance_ml
node_surveillance_tasks -->|"runs analytics"| node_surveillance_ml
node_surveillance_ml -->|"creates outbreak alerts"| node_surveillance_data
node_surveillance_portal -->|"presents regional trends"| node_surveillance_data

click node_patient_portal "https://github.com/aashutosh-mahajan/arogyatrack/blob/main/frontend/app/dashboard/page.tsx"
click node_doctor_portal "https://github.com/aashutosh-mahajan/arogyatrack/blob/main/frontend/app/doctor/dashboard/page.tsx"
click node_pharmacy_portal "https://github.com/aashutosh-mahajan/arogyatrack/blob/main/frontend/app/pharmacy/page.tsx"
click node_admin_portal "https://github.com/aashutosh-mahajan/arogyatrack/blob/main/frontend/app/admin/page.tsx"
click node_auth "https://github.com/aashutosh-mahajan/arogyatrack/tree/main/backend/accounts"
click node_patient_profile "https://github.com/aashutosh-mahajan/arogyatrack/tree/main/backend/patients"
click node_health_card "https://github.com/aashutosh-mahajan/arogyatrack/blob/main/backend/medical/models.py"
click node_clinical_records "https://github.com/aashutosh-mahajan/arogyatrack/blob/main/backend/medical/models.py"
click node_record_documents "https://github.com/aashutosh-mahajan/arogyatrack/tree/main/backend/documents"
click node_prescriptions "https://github.com/aashutosh-mahajan/arogyatrack/blob/main/backend/prescriptions/models.py"
click node_safety_review "https://github.com/aashutosh-mahajan/arogyatrack/tree/main/backend/prescriptions"
click node_pharmacy "https://github.com/aashutosh-mahajan/arogyatrack/tree/main/backend/pharmacy"
click node_adherence "https://github.com/aashutosh-mahajan/arogyatrack/blob/main/backend/adherence/services.py"
click node_reminders "https://github.com/aashutosh-mahajan/arogyatrack/blob/main/backend/adherence/tasks.py"
click node_dashboard "https://github.com/aashutosh-mahajan/arogyatrack/tree/main/backend/dashboard"
click node_surveillance_data "https://github.com/aashutosh-mahajan/arogyatrack/blob/main/backend/surveillance/models.py"
click node_surveillance_ml "https://github.com/aashutosh-mahajan/arogyatrack/blob/main/backend/surveillance/services.py"
click node_surveillance_tasks "https://github.com/aashutosh-mahajan/arogyatrack/blob/main/backend/surveillance/tasks.py"
click node_surveillance_portal "https://github.com/aashutosh-mahajan/arogyatrack/blob/main/frontend/app/admin/surveillance/page.tsx"

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_patient_portal,node_doctor_portal,node_pharmacy_portal,node_admin_portal,node_surveillance_portal toneBlue
class node_auth toneAmber
class node_patient_profile,node_health_card,node_clinical_records,node_record_documents,node_dashboard toneMint
class node_prescriptions,node_safety_review,node_pharmacy,node_adherence,node_reminders toneRose
class node_surveillance_data,node_surveillance_ml,node_surveillance_tasks,node_patient,node_doctor,node_pharmacist,node_admin toneIndigo
```

## Components

### Role Portals

- [Patient Portal](https://github.com/aashutosh-mahajan/arogyatrack/blob/main/frontend/app/dashboard/page.tsx): `frontend/app/dashboard/page.tsx`
- [Doctor Portal](https://github.com/aashutosh-mahajan/arogyatrack/blob/main/frontend/app/doctor/dashboard/page.tsx): `frontend/app/doctor/dashboard/page.tsx`
- [Pharmacy Portal](https://github.com/aashutosh-mahajan/arogyatrack/blob/main/frontend/app/pharmacy/page.tsx): `frontend/app/pharmacy/page.tsx`
- [Admin Portal](https://github.com/aashutosh-mahajan/arogyatrack/blob/main/frontend/app/admin/page.tsx): `frontend/app/admin/page.tsx`
- [Surveillance Dashboard](https://github.com/aashutosh-mahajan/arogyatrack/blob/main/frontend/app/admin/surveillance/page.tsx): `frontend/app/admin/surveillance/page.tsx`

### Identity and Access

- [Accounts and RBAC](https://github.com/aashutosh-mahajan/arogyatrack/tree/main/backend/accounts): `backend/accounts`

### Clinical Care

- [Patient Profile](https://github.com/aashutosh-mahajan/arogyatrack/tree/main/backend/patients): `backend/patients`
- [QR Health Card](https://github.com/aashutosh-mahajan/arogyatrack/blob/main/backend/medical/models.py): `backend/medical/models.py`
- [Clinical Records](https://github.com/aashutosh-mahajan/arogyatrack/blob/main/backend/medical/models.py): `backend/medical/models.py`
- [PDF Records](https://github.com/aashutosh-mahajan/arogyatrack/tree/main/backend/documents): `backend/documents`
- [Patient Health Dashboard](https://github.com/aashutosh-mahajan/arogyatrack/tree/main/backend/dashboard): `backend/dashboard`

### Medication Lifecycle

- [Digital Prescriptions](https://github.com/aashutosh-mahajan/arogyatrack/blob/main/backend/prescriptions/models.py): `backend/prescriptions/models.py`
- [Drug Safety Review](https://github.com/aashutosh-mahajan/arogyatrack/tree/main/backend/prescriptions): `backend/prescriptions`
- [Pharmacy and Inventory](https://github.com/aashutosh-mahajan/arogyatrack/tree/main/backend/pharmacy): `backend/pharmacy`
- [Dose Adherence](https://github.com/aashutosh-mahajan/arogyatrack/blob/main/backend/adherence/services.py): `backend/adherence/services.py`
- [Dose Reminders](https://github.com/aashutosh-mahajan/arogyatrack/blob/main/backend/adherence/tasks.py): `backend/adherence/tasks.py`

### Public Health Surveillance

- [Surveillance Data](https://github.com/aashutosh-mahajan/arogyatrack/blob/main/backend/surveillance/models.py): `backend/surveillance/models.py`
- [ML Analytics](https://github.com/aashutosh-mahajan/arogyatrack/blob/main/backend/surveillance/services.py): `backend/surveillance/services.py`
- [Surveillance Tasks](https://github.com/aashutosh-mahajan/arogyatrack/blob/main/backend/surveillance/tasks.py): `backend/surveillance/tasks.py`

### Other components

- **Patient**
- **Doctor**
- **Pharmacist**
- **Administrator**

## Connections

- Patient → Patient Portal: uses (evidence: `README.md`)
- Doctor → Doctor Portal: uses (evidence: `README.md`)
- Pharmacist → Pharmacy Portal: uses (evidence: `README.md`)
- Administrator → Admin Portal: uses (evidence: `README.md`)
- Patient Portal → Accounts and RBAC: registers and verifies (evidence: `README.md`)
- Doctor Portal → Accounts and RBAC: authenticates (evidence: `README.md`)
- Pharmacy Portal → Accounts and RBAC: authenticates (evidence: `README.md`)
- Admin Portal → Accounts and RBAC: reviews access (evidence: `README.md`)
- Accounts and RBAC → Patient Profile: creates profile (evidence: `README.md`)
- Patient Profile → QR Health Card: generates QR card (evidence: `README.md`)
- Doctor Portal → QR Health Card: scans card (evidence: `README.md`)
- QR Health Card → Clinical Records: grants timed access (evidence: `backend/medical/models.py`)
- Doctor Portal → Clinical Records: records consultation (evidence: `README.md`)
- Clinical Records → PDF Records: exports records (evidence: `README.md`)
- Doctor Portal → Digital Prescriptions: creates prescription (evidence: `README.md`)
- Digital Prescriptions → Drug Safety Review: checks interactions (evidence: `README.md`)
- Pharmacy Portal → Digital Prescriptions: verifies QR (evidence: `README.md`)
- Pharmacy Portal → Pharmacy and Inventory: dispenses and updates stock (evidence: `README.md`)
- Digital Prescriptions → Dose Adherence: schedules dispensed doses (evidence: `backend/adherence/services.py`)
- Dose Adherence → Dose Reminders: triggers reminders (evidence: `backend/adherence/tasks.py`)
- Patient Portal → Dose Adherence: records doses (evidence: `README.md`)
- Patient Portal → Patient Health Dashboard: views health summary (evidence: `README.md`)
- Admin Portal → Surveillance Dashboard: opens analytics (evidence: `README.md`)
- Surveillance Data → ML Analytics: feeds analysis (evidence: `backend/surveillance/services.py`)
- Surveillance Tasks → ML Analytics: runs analytics (evidence: `backend/surveillance/tasks.py`)
- ML Analytics → Surveillance Data: creates outbreak alerts (evidence: `backend/surveillance/services.py`)
- Surveillance Dashboard → Surveillance Data: presents regional trends (evidence: `README.md`)
