# tarrus1/neemah-medical-centre architecture

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

- Interactive diagram: https://gitdiagram.com/tarrus1/neemah-medical-centre
- Repository: https://github.com/tarrus1/neemah-medical-centre

## Overview

Neemah is a medical-centre platform combining doctor discovery and appointments with staff-managed patient visits, clinical departments, billing, and administration. The user-facing journey starts with sign-in or onboarding, then supports finding a doctor and booking care; in-clinic staff handle reception, triage, consultation, lab work, pharmacy, and cashiering. Server actions and Prisma provide the application’s data boundary. The README is only a brief product description, and several routes and actions were not sampled, so uncertain internal wiring is omitted.

Main entry points: [`lib/prisma.js`](https://github.com/tarrus1/neemah-medical-centre/blob/main/lib/prisma.js) (Prisma data access), [`actions/appointments.js`](https://github.com/tarrus1/neemah-medical-centre/blob/main/actions/appointments.js) (Appointment actions), [`actions/patient-visits.js`](https://github.com/tarrus1/neemah-medical-centre/blob/main/actions/patient-visits.js) (Visit workflow actions), [`app/(main)/admin/page.jsx`](https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/admin/page.jsx) (Admin dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and identity"]
  node_auth["Sign-in and sign-up<br/>[page.jsx]"]
  node_onboard["Role onboarding<br/>[page.jsx]"]
  node_home["Home and pricing<br/>[page.js]"]
end

subgraph group_care["Appointments and care"]
  node_directory["Doctor directory<br/>[page.jsx]"]
  node_profile["Doctor profile and slots<br/>[page.jsx]"]
  node_appointment["Appointment booking"]
  node_appointment_actions["Appointment actions<br/>[appointments.js]"]
  node_patient_portal["Patient visits<br/>[patient.js]"]
  node_doctor_portal["Doctor workspace<br/>[page.jsx]"]
  node_video["Video consultation<br/>[page.jsx]"]
end

subgraph group_clinic["Clinic operations"]
  node_staff["Staff department pages<br/>[page.jsx]"]
  node_reception["Reception queue"]
  node_queue["Department queue"]
  node_visit_actions["Visit workflow actions<br/>[patient-visits.js]"]
  node_clinical["Triage, lab, pharmacy<br/>[page.jsx]"]
  node_catalog_actions["Lab and pharmacy actions<br/>[seed-lab.js]"]
  node_cashier["Cashier and receipts<br/>[cashier-client.jsx]"]
  node_db[("Prisma data access<br/>[prisma.js]")]
end

subgraph group_admin["Administration"]
  node_admin["Admin dashboard<br/>[page.jsx]"]
  node_admin_actions["Admin and payout actions<br/>[admin.js]"]
  node_doctor_actions["Doctor management actions<br/>[doctor.js]"]
end

node_visitor(("Patient / visitor"))
node_clerk{{"Clerk identity"}}
node_vonage{{"Vonage video service"}}

node_visitor -->|"visits"| node_home
node_visitor -->|"signs in"| node_auth
node_auth -->|"authenticates"| node_clerk
node_visitor -->|"chooses role"| node_onboard
node_onboard -->|"identifies user"| node_clerk
node_visitor -->|"browses"| node_directory
node_directory -->|"opens doctor"| node_profile
node_profile -->|"selects slot"| node_appointment
node_appointment -->|"submits booking"| node_appointment_actions
node_appointment_actions -->|"reads / writes"| node_db
node_visitor -->|"manages care"| node_patient_portal
node_doctor_portal -->|"manages appointments"| node_appointment_actions
node_visitor -->|"joins consultation"| node_video
node_video -.->|"uses video service"| node_vonage
node_staff -->|"opens reception"| node_reception
node_reception -->|"renders queue"| node_queue
node_queue -->|"updates visits"| node_visit_actions
node_cashier -->|"confirms payment"| node_visit_actions
node_clinical -->|"manages clinical records"| node_catalog_actions
node_visit_actions -->|"reads / writes"| node_db
node_catalog_actions -->|"reads / writes"| node_db
node_admin -->|"manages platform"| node_admin_actions
node_admin -->|"reviews doctors"| node_doctor_actions
node_admin_actions -->|"accesses records"| node_db
node_doctor_actions -->|"accesses records"| node_db

click node_auth "https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(auth)/sign-in/%5B%5B...sign-in%5D%5D/page.jsx"
click node_onboard "https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/onboarding/page.jsx"
click node_home "https://github.com/tarrus1/neemah-medical-centre/blob/main/app/page.js"
click node_directory "https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/doctors/page.jsx"
click node_profile "https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/doctors/%5Bspecialty%5D/%5Bid%5D/page.jsx"
click node_appointment "https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/doctors/%5Bspecialty%5D/%5Bid%5D/_components/appointment-form.jsx"
click node_appointment_actions "https://github.com/tarrus1/neemah-medical-centre/blob/main/actions/appointments.js"
click node_patient_portal "https://github.com/tarrus1/neemah-medical-centre/blob/main/actions/patient.js"
click node_doctor_portal "https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/doctor/page.jsx"
click node_video "https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/video-call/page.jsx"
click node_staff "https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/staff/page.jsx"
click node_reception "https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/staff/reception/_components/reception-client.jsx"
click node_queue "https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/staff/_components/department-queue.jsx"
click node_visit_actions "https://github.com/tarrus1/neemah-medical-centre/blob/main/actions/patient-visits.js"
click node_clinical "https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/staff/laboratory/page.jsx"
click node_catalog_actions "https://github.com/tarrus1/neemah-medical-centre/blob/main/prisma/seed-lab.js"
click node_cashier "https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/staff/cashier/_components/cashier-client.jsx"
click node_db "https://github.com/tarrus1/neemah-medical-centre/blob/main/lib/prisma.js"
click node_admin "https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/admin/page.jsx"
click node_admin_actions "https://github.com/tarrus1/neemah-medical-centre/blob/main/actions/admin.js"
click node_doctor_actions "https://github.com/tarrus1/neemah-medical-centre/blob/main/actions/doctor.js"

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_auth,node_onboard,node_home toneBlue
class node_directory,node_profile,node_appointment,node_appointment_actions,node_patient_portal,node_doctor_portal,node_video toneAmber
class node_staff,node_reception,node_queue,node_visit_actions,node_clinical,node_catalog_actions,node_cashier,node_db toneMint
class node_admin,node_admin_actions,node_doctor_actions toneRose
class node_visitor,node_clerk,node_vonage toneIndigo
```

## Components

### Entry and identity

- [Sign-in and sign-up](https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(auth)/sign-in/%5B%5B...sign-in%5D%5D/page.jsx): `app/(auth)/sign-in/[[...sign-in]]/page.jsx`
- [Role onboarding](https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/onboarding/page.jsx): `app/(main)/onboarding/page.jsx`
- [Home and pricing](https://github.com/tarrus1/neemah-medical-centre/blob/main/app/page.js): `app/page.js`

### Appointments and care

- [Doctor directory](https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/doctors/page.jsx): `app/(main)/doctors/page.jsx`
- [Doctor profile and slots](https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/doctors/%5Bspecialty%5D/%5Bid%5D/page.jsx): `app/(main)/doctors/[specialty]/[id]/page.jsx`
- [Appointment booking](https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/doctors/%5Bspecialty%5D/%5Bid%5D/_components/appointment-form.jsx): `app/(main)/doctors/[specialty]/[id]/_components/appointment-form.jsx`
- [Appointment actions](https://github.com/tarrus1/neemah-medical-centre/blob/main/actions/appointments.js): `actions/appointments.js`
- [Patient visits](https://github.com/tarrus1/neemah-medical-centre/blob/main/actions/patient.js): `actions/patient.js`
- [Doctor workspace](https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/doctor/page.jsx): `app/(main)/doctor/page.jsx`
- [Video consultation](https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/video-call/page.jsx): `app/(main)/video-call/page.jsx`

### Clinic operations

- [Staff department pages](https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/staff/page.jsx): `app/(main)/staff/page.jsx`
- [Reception queue](https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/staff/reception/_components/reception-client.jsx): `app/(main)/staff/reception/_components/reception-client.jsx`
- [Department queue](https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/staff/_components/department-queue.jsx): `app/(main)/staff/_components/department-queue.jsx`
- [Visit workflow actions](https://github.com/tarrus1/neemah-medical-centre/blob/main/actions/patient-visits.js): `actions/patient-visits.js`
- [Triage, lab, pharmacy](https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/staff/laboratory/page.jsx): `app/(main)/staff/laboratory/page.jsx`
- [Lab and pharmacy actions](https://github.com/tarrus1/neemah-medical-centre/blob/main/prisma/seed-lab.js): `prisma/seed-lab.js`
- [Cashier and receipts](https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/staff/cashier/_components/cashier-client.jsx): `app/(main)/staff/cashier/_components/cashier-client.jsx`
- [Prisma data access](https://github.com/tarrus1/neemah-medical-centre/blob/main/lib/prisma.js): `lib/prisma.js`

### Administration

- [Admin dashboard](https://github.com/tarrus1/neemah-medical-centre/blob/main/app/(main)/admin/page.jsx): `app/(main)/admin/page.jsx`
- [Admin and payout actions](https://github.com/tarrus1/neemah-medical-centre/blob/main/actions/admin.js): `actions/admin.js`
- [Doctor management actions](https://github.com/tarrus1/neemah-medical-centre/blob/main/actions/doctor.js): `actions/doctor.js`

### Other components

- **Patient / visitor**
- **Clerk identity**
- **Vonage video service**

## Connections

- Patient / visitor → Home and pricing: visits
- Patient / visitor → Sign-in and sign-up: signs in
- Sign-in and sign-up → Clerk identity: authenticates
- Patient / visitor → Role onboarding: chooses role
- Role onboarding → Clerk identity: identifies user
- Patient / visitor → Doctor directory: browses
- Doctor directory → Doctor profile and slots: opens doctor
- Doctor profile and slots → Appointment booking: selects slot
- Appointment booking → Appointment actions: submits booking
- Appointment actions → Prisma data access: reads / writes
- Patient / visitor → Patient visits: manages care
- Doctor workspace → Appointment actions: manages appointments
- Patient / visitor → Video consultation: joins consultation
- Video consultation → Vonage video service: uses video service
- Staff department pages → Reception queue: opens reception
- Reception queue → Department queue: renders queue
- Department queue → Visit workflow actions: updates visits
- Cashier and receipts → Visit workflow actions: confirms payment
- Triage, lab, pharmacy → Lab and pharmacy actions: manages clinical records
- Visit workflow actions → Prisma data access: reads / writes
- Lab and pharmacy actions → Prisma data access: reads / writes
- Admin dashboard → Admin and payout actions: manages platform
- Admin dashboard → Doctor management actions: reviews doctors
- Admin and payout actions → Prisma data access: accesses records
- Doctor management actions → Prisma data access: accesses records
