# hamna-fatima/meditrack-hospital-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/hamna-fatima/meditrack-hospital-management-system
- Repository: https://github.com/hamna-fatima/meditrack-hospital-management-system

## Overview

MediTrack is a role-based hospital management system: staff and patients use the application to authenticate, manage hospital workflows, and view role-scoped records and analytics. The documented workflow spans authentication and access control, patient and appointment management, clinical records and prescriptions, and dashboard/search results backed by Atlas or an isolated preview store. The supplied tree omits the referenced server submodules and frontend source, so those components are represented with null paths; their capabilities and links rely on README documentation rather than inspected implementations.

Main entry points: [`server.ts`](https://github.com/hamna-fatima/meditrack-hospital-management-system/blob/main/server.ts) (Express server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application access"]
  node_webapp["Web application"]
  node_server["Express server<br/>[server.ts]"]
  node_auth["Authentication"]
  node_rbac["Role permissions"]
  node_api["REST API router"]
end

subgraph group_operations["Hospital operations"]
  node_patients["Patient profiles"]
  node_appointments["Appointments"]
  node_users["User accounts"]
end

subgraph group_clinical["Clinical care"]
  node_records["Medical records"]
  node_prescriptions["Prescriptions"]
end

subgraph group_data["Persistence and insight"]
  node_dashboard["Dashboard analytics"]
  node_search["Global search"]
  node_store["Store selection"]
  node_atlas[("MongoDB Atlas")]
  node_preview[("Preview store")]
end

node_user(("Staff or patient"))

node_user -->|"uses"| node_webapp
node_webapp -->|"sends requests"| node_server
node_server -->|"loads"| node_store
node_server -->|"mounts"| node_api
node_api -->|"serves auth"| node_auth
node_api -->|"enforces roles"| node_rbac
node_api -->|"manages accounts"| node_users
node_api -->|"manages profiles"| node_patients
node_api -->|"manages bookings"| node_appointments
node_api -->|"manages records"| node_records
node_api -->|"manages orders"| node_prescriptions
node_api -->|"serves metrics"| node_dashboard
node_api -->|"serves search"| node_search
node_store -->|"uses when configured"| node_atlas
node_store -->|"falls back to"| node_preview
node_dashboard -.->|"counts records"| node_patients
node_dashboard -.->|"counts bookings"| node_appointments

click node_server "https://github.com/hamna-fatima/meditrack-hospital-management-system/blob/main/server.ts"

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_webapp,node_server,node_auth,node_rbac,node_api toneBlue
class node_patients,node_appointments,node_users toneAmber
class node_records,node_prescriptions toneMint
class node_dashboard,node_search,node_store,node_atlas,node_preview toneRose
class node_user toneIndigo
```

## Components

### Application access

- **Web application**
- [Express server](https://github.com/hamna-fatima/meditrack-hospital-management-system/blob/main/server.ts): `server.ts`
- **Authentication**
- **Role permissions**
- **REST API router**

### Hospital operations

- **Patient profiles**
- **Appointments**
- **User accounts**

### Clinical care

- **Medical records**
- **Prescriptions**

### Persistence and insight

- **Dashboard analytics**
- **Global search**
- **Store selection**
- **MongoDB Atlas**
- **Preview store**

### Other components

- **Staff or patient**

## Connections

- Staff or patient → Web application: uses (evidence: `README.md`)
- Web application → Express server: sends requests (evidence: `README.md`)
- Express server → Store selection: loads (evidence: `server.ts`)
- Express server → REST API router: mounts (evidence: `server.ts`)
- REST API router → Authentication: serves auth (evidence: `README.md`)
- REST API router → Role permissions: enforces roles (evidence: `README.md`)
- REST API router → User accounts: manages accounts (evidence: `README.md`)
- REST API router → Patient profiles: manages profiles (evidence: `README.md`)
- REST API router → Appointments: manages bookings (evidence: `README.md`)
- REST API router → Medical records: manages records (evidence: `README.md`)
- REST API router → Prescriptions: manages orders (evidence: `README.md`)
- REST API router → Dashboard analytics: serves metrics (evidence: `README.md`)
- REST API router → Global search: serves search (evidence: `README.md`)
- Store selection → MongoDB Atlas: uses when configured (evidence: `README.md`)
- Store selection → Preview store: falls back to (evidence: `README.md`)
- Dashboard analytics → Patient profiles: counts records
- Dashboard analytics → Appointments: counts bookings
