# aishwarya842/meditrack architecture

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

- Interactive diagram: https://gitdiagram.com/aishwarya842/meditrack
- Repository: https://github.com/aishwarya842/meditrack

## Overview

CareHub is a multispeciality hospital portal spanning public doctor discovery and booking, role-based front-desk and clinical workflows, and administrative billing and reporting. The documented frontend centers on `src/App.tsx` and browser-local persistence; the tree also contains a FastAPI backend with relational persistence. The excerpts establish backend routing and several frontend component links, but do not show the frontend communicating with the FastAPI service, so no connection between them is asserted. Some README-described capabilities have only tree-level evidence.

Main entry points: [`src/App.tsx`](https://github.com/aishwarya842/meditrack/blob/main/src/App.tsx) (Portal application), [`backend/main.py`](https://github.com/aishwarya842/meditrack/blob/main/backend/main.py) (FastAPI application), [`backend/routers/clinical.py`](https://github.com/aishwarya842/meditrack/blob/main/backend/routers/clinical.py) (Clinical routes), [`src/components/PublicHome.tsx`](https://github.com/aishwarya842/meditrack/blob/main/src/components/PublicHome.tsx) (Public discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Portal workflows"]
  node_app["Portal application<br/>[App.tsx]"]
  node_public["Public discovery<br/>[PublicHome.tsx]"]
  node_doctors["Doctor directory<br/>[DoctorsView.tsx]"]
end

subgraph group_clinical["Clinical operations"]
  node_booking["Appointment booking"]
  node_calendar["Date selection"]
  node_dashboard["Role dashboard<br/>[DashboardView.tsx]"]
  node_reception["Reception registration"]
  node_patients["Patient records<br/>[PatientsView.tsx]"]
  node_consultations["OPD consultations"]
  node_prescriptions["Digital prescriptions"]
  node_seeddata["Clinical master data<br/>[hospitalData.ts]"]
end

subgraph group_admin["Hospital administration"]
  node_medicines["Medicine inventory<br/>[MedicinesView.tsx]"]
  node_invoices["Invoices<br/>[InvoicesView.tsx]"]
  node_payments["Payments<br/>[PaymentsView.tsx]"]
  node_analytics["Analytics<br/>[AnalyticsView.tsx]"]
  node_reports["Reports<br/>[ReportsView.tsx]"]
  node_reminders["Follow-up reminders<br/>[RemindersView.tsx]"]
end

subgraph group_server["API and persistence"]
  node_localdb["Browser data service<br/>[db.ts]"]
  node_fastapi["FastAPI application<br/>[main.py]"]
  node_authroutes["Authentication routes<br/>[auth.py]"]
  node_patientroutes["Patient routes<br/>[patients.py]"]
  node_clinicalroutes["Clinical routes<br/>[clinical.py]"]
  node_auth["Auth and access control<br/>[auth.py]"]
  node_dbsession[("SQLAlchemy sessions<br/>[database.py]")]
  node_models["Hospital data models<br/>[models.py]"]
  node_sms["SMS notifications<br/>[sms_service.py]"]
  node_legacyapp["Application server<br/>[app.py]"]
end

node_patient(("Patient"))
node_staff(("Hospital staff"))

node_patient -->|"browses"| node_public
node_public -->|"submits booking"| node_app
node_staff -.->|"uses portal"| node_app
node_app -->|"renders"| node_public
node_app -->|"renders"| node_doctors
node_app -->|"renders"| node_booking
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_patients
node_app -->|"renders"| node_consultations
node_app -->|"renders"| node_prescriptions
node_app -->|"renders"| node_medicines
node_app -->|"renders"| node_invoices
node_booking -->|"uses"| node_calendar
node_public -->|"uses"| node_calendar
node_dashboard -->|"opens registration"| node_reception
node_dashboard -.->|"shows queue"| node_booking
node_consultations -.->|"issues"| node_prescriptions
node_app -->|"renders"| node_payments
node_app -->|"renders"| node_analytics
node_app -->|"renders"| node_reports
node_app -->|"renders"| node_reminders
node_app -->|"loads and saves"| node_localdb
node_localdb -->|"seeds defaults"| node_seeddata
node_patient -.->|"uses API"| node_fastapi
node_fastapi -->|"mounts"| node_authroutes
node_fastapi -->|"mounts"| node_patientroutes
node_fastapi -->|"mounts"| node_clinicalroutes
node_authroutes -->|"gets sessions"| node_dbsession
node_authroutes -->|"verifies credentials"| node_auth
node_patientroutes -.->|"gets sessions"| node_dbsession
node_clinicalroutes -->|"gets sessions"| node_dbsession
node_clinicalroutes -->|"checks access"| node_auth
node_clinicalroutes -->|"sends appointment SMS"| node_sms
node_dbsession -->|"provides ORM base"| node_models

click node_app "https://github.com/aishwarya842/meditrack/blob/main/src/App.tsx"
click node_public "https://github.com/aishwarya842/meditrack/blob/main/src/components/PublicHome.tsx"
click node_doctors "https://github.com/aishwarya842/meditrack/blob/main/src/components/DoctorsView.tsx"
click node_booking "https://github.com/aishwarya842/meditrack/blob/main/src/components/AppointmentsView.tsx"
click node_calendar "https://github.com/aishwarya842/meditrack/blob/main/src/components/DatePickerCalendar.tsx"
click node_dashboard "https://github.com/aishwarya842/meditrack/blob/main/src/components/DashboardView.tsx"
click node_reception "https://github.com/aishwarya842/meditrack/blob/main/src/components/ReceptionCallDeskModal.tsx"
click node_patients "https://github.com/aishwarya842/meditrack/blob/main/src/components/PatientsView.tsx"
click node_consultations "https://github.com/aishwarya842/meditrack/blob/main/src/components/ConsultationsView.tsx"
click node_prescriptions "https://github.com/aishwarya842/meditrack/blob/main/src/components/PrescriptionsView.tsx"
click node_medicines "https://github.com/aishwarya842/meditrack/blob/main/src/components/MedicinesView.tsx"
click node_invoices "https://github.com/aishwarya842/meditrack/blob/main/src/components/InvoicesView.tsx"
click node_payments "https://github.com/aishwarya842/meditrack/blob/main/src/components/PaymentsView.tsx"
click node_analytics "https://github.com/aishwarya842/meditrack/blob/main/src/components/AnalyticsView.tsx"
click node_reports "https://github.com/aishwarya842/meditrack/blob/main/src/components/ReportsView.tsx"
click node_reminders "https://github.com/aishwarya842/meditrack/blob/main/src/components/RemindersView.tsx"
click node_seeddata "https://github.com/aishwarya842/meditrack/blob/main/src/data/hospitalData.ts"
click node_localdb "https://github.com/aishwarya842/meditrack/blob/main/src/services/db.ts"
click node_fastapi "https://github.com/aishwarya842/meditrack/blob/main/backend/main.py"
click node_authroutes "https://github.com/aishwarya842/meditrack/blob/main/backend/routers/auth.py"
click node_patientroutes "https://github.com/aishwarya842/meditrack/blob/main/backend/routers/patients.py"
click node_clinicalroutes "https://github.com/aishwarya842/meditrack/blob/main/backend/routers/clinical.py"
click node_auth "https://github.com/aishwarya842/meditrack/blob/main/backend/auth.py"
click node_dbsession "https://github.com/aishwarya842/meditrack/blob/main/backend/database.py"
click node_models "https://github.com/aishwarya842/meditrack/blob/main/backend/models.py"
click node_sms "https://github.com/aishwarya842/meditrack/blob/main/backend/services/sms_service.py"
click node_legacyapp "https://github.com/aishwarya842/meditrack/blob/main/app.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_public,node_doctors toneBlue
class node_booking,node_calendar,node_dashboard,node_reception,node_patients,node_consultations,node_prescriptions,node_seeddata toneAmber
class node_medicines,node_invoices,node_payments,node_analytics,node_reports,node_reminders toneMint
class node_localdb,node_fastapi,node_authroutes,node_patientroutes,node_clinicalroutes,node_auth,node_dbsession,node_models,node_sms,node_legacyapp toneRose
class node_patient,node_staff toneIndigo
```

## Components

### Portal workflows

- [Portal application](https://github.com/aishwarya842/meditrack/blob/main/src/App.tsx): `src/App.tsx`
- [Public discovery](https://github.com/aishwarya842/meditrack/blob/main/src/components/PublicHome.tsx): `src/components/PublicHome.tsx`
- [Doctor directory](https://github.com/aishwarya842/meditrack/blob/main/src/components/DoctorsView.tsx): `src/components/DoctorsView.tsx`

### Clinical operations

- [Appointment booking](https://github.com/aishwarya842/meditrack/blob/main/src/components/AppointmentsView.tsx): `src/components/AppointmentsView.tsx`
- [Date selection](https://github.com/aishwarya842/meditrack/blob/main/src/components/DatePickerCalendar.tsx): `src/components/DatePickerCalendar.tsx`
- [Role dashboard](https://github.com/aishwarya842/meditrack/blob/main/src/components/DashboardView.tsx): `src/components/DashboardView.tsx`
- [Reception registration](https://github.com/aishwarya842/meditrack/blob/main/src/components/ReceptionCallDeskModal.tsx): `src/components/ReceptionCallDeskModal.tsx`
- [Patient records](https://github.com/aishwarya842/meditrack/blob/main/src/components/PatientsView.tsx): `src/components/PatientsView.tsx`
- [OPD consultations](https://github.com/aishwarya842/meditrack/blob/main/src/components/ConsultationsView.tsx): `src/components/ConsultationsView.tsx`
- [Digital prescriptions](https://github.com/aishwarya842/meditrack/blob/main/src/components/PrescriptionsView.tsx): `src/components/PrescriptionsView.tsx`
- [Clinical master data](https://github.com/aishwarya842/meditrack/blob/main/src/data/hospitalData.ts): `src/data/hospitalData.ts`

### Hospital administration

- [Medicine inventory](https://github.com/aishwarya842/meditrack/blob/main/src/components/MedicinesView.tsx): `src/components/MedicinesView.tsx`
- [Invoices](https://github.com/aishwarya842/meditrack/blob/main/src/components/InvoicesView.tsx): `src/components/InvoicesView.tsx`
- [Payments](https://github.com/aishwarya842/meditrack/blob/main/src/components/PaymentsView.tsx): `src/components/PaymentsView.tsx`
- [Analytics](https://github.com/aishwarya842/meditrack/blob/main/src/components/AnalyticsView.tsx): `src/components/AnalyticsView.tsx`
- [Reports](https://github.com/aishwarya842/meditrack/blob/main/src/components/ReportsView.tsx): `src/components/ReportsView.tsx`
- [Follow-up reminders](https://github.com/aishwarya842/meditrack/blob/main/src/components/RemindersView.tsx): `src/components/RemindersView.tsx`

### API and persistence

- [Browser data service](https://github.com/aishwarya842/meditrack/blob/main/src/services/db.ts): `src/services/db.ts`
- [FastAPI application](https://github.com/aishwarya842/meditrack/blob/main/backend/main.py): `backend/main.py`
- [Authentication routes](https://github.com/aishwarya842/meditrack/blob/main/backend/routers/auth.py): `backend/routers/auth.py`
- [Patient routes](https://github.com/aishwarya842/meditrack/blob/main/backend/routers/patients.py): `backend/routers/patients.py`
- [Clinical routes](https://github.com/aishwarya842/meditrack/blob/main/backend/routers/clinical.py): `backend/routers/clinical.py`
- [Auth and access control](https://github.com/aishwarya842/meditrack/blob/main/backend/auth.py): `backend/auth.py`
- [SQLAlchemy sessions](https://github.com/aishwarya842/meditrack/blob/main/backend/database.py): `backend/database.py`
- [Hospital data models](https://github.com/aishwarya842/meditrack/blob/main/backend/models.py): `backend/models.py`
- [SMS notifications](https://github.com/aishwarya842/meditrack/blob/main/backend/services/sms_service.py): `backend/services/sms_service.py`
- [Application server](https://github.com/aishwarya842/meditrack/blob/main/app.py): `app.py`

### Other components

- **Patient**
- **Hospital staff**

## Connections

- Patient → Public discovery: browses
- Public discovery → Portal application: submits booking (evidence: `src/components/PublicHome.tsx`)
- Hospital staff → Portal application: uses portal
- Portal application → Public discovery: renders (evidence: `src/App.tsx`)
- Portal application → Doctor directory: renders (evidence: `src/App.tsx`)
- Portal application → Appointment booking: renders (evidence: `src/App.tsx`)
- Portal application → Role dashboard: renders (evidence: `src/App.tsx`)
- Portal application → Patient records: renders (evidence: `src/App.tsx`)
- Portal application → OPD consultations: renders (evidence: `src/App.tsx`)
- Portal application → Digital prescriptions: renders (evidence: `src/App.tsx`)
- Portal application → Medicine inventory: renders (evidence: `src/App.tsx`)
- Portal application → Invoices: renders (evidence: `src/App.tsx`)
- Appointment booking → Date selection: uses (evidence: `src/components/AppointmentsView.tsx`)
- Public discovery → Date selection: uses (evidence: `src/components/PublicHome.tsx`)
- Role dashboard → Reception registration: opens registration
- Role dashboard → Appointment booking: shows queue
- OPD consultations → Digital prescriptions: issues
- Portal application → Payments: renders (evidence: `src/App.tsx`)
- Portal application → Analytics: renders (evidence: `src/App.tsx`)
- Portal application → Reports: renders (evidence: `src/App.tsx`)
- Portal application → Follow-up reminders: renders (evidence: `src/App.tsx`)
- Portal application → Browser data service: loads and saves (evidence: `src/App.tsx`)
- Browser data service → Clinical master data: seeds defaults (evidence: `src/services/db.ts`)
- Patient → FastAPI application: uses API
- FastAPI application → Authentication routes: mounts (evidence: `backend/main.py`)
- FastAPI application → Patient routes: mounts (evidence: `backend/main.py`)
- FastAPI application → Clinical routes: mounts (evidence: `backend/main.py`)
- Authentication routes → SQLAlchemy sessions: gets sessions (evidence: `backend/routers/auth.py`)
- Authentication routes → Auth and access control: verifies credentials (evidence: `backend/routers/auth.py`)
- Patient routes → SQLAlchemy sessions: gets sessions (evidence: `backend/routers/patients.py`)
- Clinical routes → SQLAlchemy sessions: gets sessions (evidence: `backend/routers/clinical.py`)
- Clinical routes → Auth and access control: checks access (evidence: `backend/routers/clinical.py`)
- Clinical routes → SMS notifications: sends appointment SMS (evidence: `backend/routers/clinical.py`)
- SQLAlchemy sessions → Hospital data models: provides ORM base (evidence: `backend/models.py`)
