# sammy-black/plural-health architecture

> Architecture diagram of the GitHub repository sammy-black/plural-health, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sammy-black/plural-health
- Repository: https://github.com/sammy-black/plural-health

## Overview

This is a client-side clinic appointments dashboard, with sample appointment data rather than a demonstrated backend. The main workflow is to search patients or review appointment rows, then open a patient-entry or appointment-creation form. Appointment creation gathers patient, clinic, appointment type, date, and time; patient entry supports a photo-capture flow. The graph also includes the dashboard header and shared appointment table/status components. Evidence is limited to the README, source index, and sampled excerpts; unsampled modal and form wiring is not inferred.

Main entry points: [`app/(dashboard)/page.tsx`](https://github.com/sammy-black/plural-health/blob/main/app/(dashboard)/page.tsx) (Appointments page), [`components/appointments/index.tsx`](https://github.com/sammy-black/plural-health/blob/main/components/appointments/index.tsx) (Appointment table), [`components/modal/CreateAppointmentModal.tsx`](https://github.com/sammy-black/plural-health/blob/main/components/modal/CreateAppointmentModal.tsx) (Create appointment), [`components/modal/ImageCaptureModal.tsx`](https://github.com/sammy-black/plural-health/blob/main/components/modal/ImageCaptureModal.tsx) (Image capture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_dashboard["Appointments page<br/>[page.tsx]"]
  node_header["Staff header<br/>[Header.tsx]"]
  node_patient_search["Patient search"]
end

subgraph group_appointments["Appointment workflow"]
  node_appointment_data[("Sample appointments<br/>[dummyData.ts]")]
  node_appointments["Appointment table<br/>[index.tsx]"]
  node_appointment_rows["Appointment rows"]
  node_appointment_status["Appointment status"]
  node_paper_status["Paper record status"]
  node_pagination["Table pagination"]
  node_create_appointment["Create appointment"]
  node_clinic_type["Clinic selection"]
  node_appointment_type["Appointment type"]
  node_appointment_calendar["Appointment calendar"]
  node_appointment_validation["Appointment validation"]
end

subgraph group_patients["Patient intake"]
  node_add_patient["Add patient modal"]
  node_patient_form["Patient form<br/>[AddPatientForm.tsx]"]
  node_image_capture["Image capture"]
  node_image_picker["Image picker<br/>[useImagePicker.ts]"]
end

subgraph group_shared["Shared UI"]
  node_modal_state["Modal state hook<br/>[useModal.ts]"]
  node_user_avatar["User avatar<br/>[UserAvatar.tsx]"]
  node_avatar_ui["Avatar primitive<br/>[avatar.tsx]"]
  node_dialog_ui["Dialog primitive<br/>[dialog.tsx]"]
  node_button_ui["Button primitive<br/>[button.tsx]"]
  node_dropdown_ui["Dropdown primitive<br/>[dropdown-menu.tsx]"]
  node_calendar_ui["Calendar primitive<br/>[calendar.tsx]"]
end

node_user(("Clinic staff"))

node_user -->|"uses"| node_dashboard
node_dashboard -->|"renders"| node_header
node_dashboard -->|"renders"| node_patient_search
node_dashboard -->|"renders"| node_appointments
node_dashboard -->|"searches"| node_appointment_data
node_dashboard -->|"opens"| node_add_patient
node_dashboard -->|"opens"| node_create_appointment
node_dashboard -->|"uses"| node_modal_state
node_appointments -->|"displays"| node_appointment_data
node_appointments -->|"renders"| node_appointment_rows
node_appointments -->|"renders"| node_appointment_status
node_appointments -->|"renders"| node_paper_status
node_appointments -->|"renders"| node_pagination
node_create_appointment -->|"opens"| node_clinic_type
node_create_appointment -->|"opens"| node_appointment_type
node_create_appointment -->|"renders"| node_appointment_calendar
node_create_appointment -->|"validates with"| node_appointment_validation
node_patient_form -->|"renders"| node_user_avatar
node_patient_form -->|"opens"| node_image_capture
node_image_capture -->|"uses"| node_image_picker
node_header -->|"renders"| node_user_avatar
node_user_avatar -->|"uses"| node_avatar_ui
node_image_capture -->|"uses"| node_dialog_ui
node_create_appointment -->|"renders"| node_button_ui
node_appointments -->|"uses"| node_dropdown_ui
node_appointment_calendar -->|"uses"| node_calendar_ui

click node_dashboard "https://github.com/sammy-black/plural-health/blob/main/app/(dashboard)/page.tsx"
click node_header "https://github.com/sammy-black/plural-health/blob/main/components/layout/Header.tsx"
click node_patient_search "https://github.com/sammy-black/plural-health/blob/main/components/form/AutoCompleteField.tsx"
click node_appointment_data "https://github.com/sammy-black/plural-health/blob/main/lib/dummyData.ts"
click node_appointments "https://github.com/sammy-black/plural-health/blob/main/components/appointments/index.tsx"
click node_appointment_rows "https://github.com/sammy-black/plural-health/blob/main/components/appointments/AppointmentsTable.tsx"
click node_appointment_status "https://github.com/sammy-black/plural-health/blob/main/components/appointments/AppointmentStatusBox.tsx"
click node_paper_status "https://github.com/sammy-black/plural-health/blob/main/components/appointments/PaperRecordStatusBox.tsx"
click node_pagination "https://github.com/sammy-black/plural-health/blob/main/components/appointments/AppointmentsTablePagination.tsx"
click node_create_appointment "https://github.com/sammy-black/plural-health/blob/main/components/modal/CreateAppointmentModal.tsx"
click node_clinic_type "https://github.com/sammy-black/plural-health/blob/main/components/modal/ClinicTypeModal.tsx"
click node_appointment_type "https://github.com/sammy-black/plural-health/blob/main/components/modal/AppointmentTypeModal.tsx"
click node_appointment_calendar "https://github.com/sammy-black/plural-health/blob/main/components/shared/CreateAppointmentCalendar.tsx"
click node_appointment_validation "https://github.com/sammy-black/plural-health/blob/main/validations/createAppointmentSchema.ts"
click node_add_patient "https://github.com/sammy-black/plural-health/blob/main/components/modal/AddPatientModal.tsx"
click node_patient_form "https://github.com/sammy-black/plural-health/blob/main/components/forms/AddPatientForm.tsx"
click node_image_capture "https://github.com/sammy-black/plural-health/blob/main/components/modal/ImageCaptureModal.tsx"
click node_image_picker "https://github.com/sammy-black/plural-health/blob/main/hooks/useImagePicker.ts"
click node_modal_state "https://github.com/sammy-black/plural-health/blob/main/hooks/useModal.ts"
click node_user_avatar "https://github.com/sammy-black/plural-health/blob/main/components/shared/UserAvatar.tsx"
click node_avatar_ui "https://github.com/sammy-black/plural-health/blob/main/components/ui/avatar.tsx"
click node_dialog_ui "https://github.com/sammy-black/plural-health/blob/main/components/ui/dialog.tsx"
click node_button_ui "https://github.com/sammy-black/plural-health/blob/main/components/ui/button.tsx"
click node_dropdown_ui "https://github.com/sammy-black/plural-health/blob/main/components/ui/dropdown-menu.tsx"
click node_calendar_ui "https://github.com/sammy-black/plural-health/blob/main/components/ui/calendar.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_dashboard,node_header,node_patient_search toneBlue
class node_appointment_data,node_appointments,node_appointment_rows,node_appointment_status,node_paper_status,node_pagination,node_create_appointment,node_clinic_type,node_appointment_type,node_appointment_calendar,node_appointment_validation toneAmber
class node_add_patient,node_patient_form,node_image_capture,node_image_picker toneMint
class node_modal_state,node_user_avatar,node_avatar_ui,node_dialog_ui,node_button_ui,node_dropdown_ui,node_calendar_ui toneRose
class node_user toneIndigo
```

## Components

### Dashboard

- [Appointments page](https://github.com/sammy-black/plural-health/blob/main/app/(dashboard)/page.tsx): `app/(dashboard)/page.tsx`
- [Staff header](https://github.com/sammy-black/plural-health/blob/main/components/layout/Header.tsx): `components/layout/Header.tsx`
- [Patient search](https://github.com/sammy-black/plural-health/blob/main/components/form/AutoCompleteField.tsx): `components/form/AutoCompleteField.tsx`

### Appointment workflow

- [Sample appointments](https://github.com/sammy-black/plural-health/blob/main/lib/dummyData.ts): `lib/dummyData.ts`
- [Appointment table](https://github.com/sammy-black/plural-health/blob/main/components/appointments/index.tsx): `components/appointments/index.tsx`
- [Appointment rows](https://github.com/sammy-black/plural-health/blob/main/components/appointments/AppointmentsTable.tsx): `components/appointments/AppointmentsTable.tsx`
- [Appointment status](https://github.com/sammy-black/plural-health/blob/main/components/appointments/AppointmentStatusBox.tsx): `components/appointments/AppointmentStatusBox.tsx`
- [Paper record status](https://github.com/sammy-black/plural-health/blob/main/components/appointments/PaperRecordStatusBox.tsx): `components/appointments/PaperRecordStatusBox.tsx`
- [Table pagination](https://github.com/sammy-black/plural-health/blob/main/components/appointments/AppointmentsTablePagination.tsx): `components/appointments/AppointmentsTablePagination.tsx`
- [Create appointment](https://github.com/sammy-black/plural-health/blob/main/components/modal/CreateAppointmentModal.tsx): `components/modal/CreateAppointmentModal.tsx`
- [Clinic selection](https://github.com/sammy-black/plural-health/blob/main/components/modal/ClinicTypeModal.tsx): `components/modal/ClinicTypeModal.tsx`
- [Appointment type](https://github.com/sammy-black/plural-health/blob/main/components/modal/AppointmentTypeModal.tsx): `components/modal/AppointmentTypeModal.tsx`
- [Appointment calendar](https://github.com/sammy-black/plural-health/blob/main/components/shared/CreateAppointmentCalendar.tsx): `components/shared/CreateAppointmentCalendar.tsx`
- [Appointment validation](https://github.com/sammy-black/plural-health/blob/main/validations/createAppointmentSchema.ts): `validations/createAppointmentSchema.ts`

### Patient intake

- [Add patient modal](https://github.com/sammy-black/plural-health/blob/main/components/modal/AddPatientModal.tsx): `components/modal/AddPatientModal.tsx`
- [Patient form](https://github.com/sammy-black/plural-health/blob/main/components/forms/AddPatientForm.tsx): `components/forms/AddPatientForm.tsx`
- [Image capture](https://github.com/sammy-black/plural-health/blob/main/components/modal/ImageCaptureModal.tsx): `components/modal/ImageCaptureModal.tsx`
- [Image picker](https://github.com/sammy-black/plural-health/blob/main/hooks/useImagePicker.ts): `hooks/useImagePicker.ts`

### Shared UI

- [Modal state hook](https://github.com/sammy-black/plural-health/blob/main/hooks/useModal.ts): `hooks/useModal.ts`
- [User avatar](https://github.com/sammy-black/plural-health/blob/main/components/shared/UserAvatar.tsx): `components/shared/UserAvatar.tsx`
- [Avatar primitive](https://github.com/sammy-black/plural-health/blob/main/components/ui/avatar.tsx): `components/ui/avatar.tsx`
- [Dialog primitive](https://github.com/sammy-black/plural-health/blob/main/components/ui/dialog.tsx): `components/ui/dialog.tsx`
- [Button primitive](https://github.com/sammy-black/plural-health/blob/main/components/ui/button.tsx): `components/ui/button.tsx`
- [Dropdown primitive](https://github.com/sammy-black/plural-health/blob/main/components/ui/dropdown-menu.tsx): `components/ui/dropdown-menu.tsx`
- [Calendar primitive](https://github.com/sammy-black/plural-health/blob/main/components/ui/calendar.tsx): `components/ui/calendar.tsx`

### Other components

- **Clinic staff**

## Connections

- Clinic staff → Appointments page: uses (evidence: `app/(dashboard)/page.tsx`)
- Appointments page → Staff header: renders (evidence: `app/(dashboard)/page.tsx`)
- Appointments page → Patient search: renders (evidence: `app/(dashboard)/page.tsx`)
- Appointments page → Appointment table: renders (evidence: `app/(dashboard)/page.tsx`)
- Appointments page → Sample appointments: searches (evidence: `app/(dashboard)/page.tsx`)
- Appointments page → Add patient modal: opens (evidence: `app/(dashboard)/page.tsx`)
- Appointments page → Create appointment: opens (evidence: `app/(dashboard)/page.tsx`)
- Appointments page → Modal state hook: uses (evidence: `app/(dashboard)/page.tsx`)
- Appointment table → Sample appointments: displays (evidence: `components/appointments/index.tsx`)
- Appointment table → Appointment rows: renders (evidence: `components/appointments/index.tsx`)
- Appointment table → Appointment status: renders (evidence: `components/appointments/index.tsx`)
- Appointment table → Paper record status: renders (evidence: `components/appointments/index.tsx`)
- Appointment table → Table pagination: renders (evidence: `components/appointments/index.tsx`)
- Create appointment → Clinic selection: opens (evidence: `components/modal/CreateAppointmentModal.tsx`)
- Create appointment → Appointment type: opens (evidence: `components/modal/CreateAppointmentModal.tsx`)
- Create appointment → Appointment calendar: renders (evidence: `components/modal/CreateAppointmentModal.tsx`)
- Create appointment → Appointment validation: validates with (evidence: `components/modal/CreateAppointmentModal.tsx`)
- Patient form → User avatar: renders (evidence: `components/forms/AddPatientForm.tsx`)
- Patient form → Image capture: opens (evidence: `components/forms/AddPatientForm.tsx`)
- Image capture → Image picker: uses (evidence: `components/modal/ImageCaptureModal.tsx`)
- Staff header → User avatar: renders (evidence: `components/layout/Header.tsx`)
- User avatar → Avatar primitive: uses (evidence: `components/shared/UserAvatar.tsx`)
- Image capture → Dialog primitive: uses (evidence: `components/modal/ImageCaptureModal.tsx`)
- Create appointment → Button primitive: renders (evidence: `components/modal/CreateAppointmentModal.tsx`)
- Appointment table → Dropdown primitive: uses (evidence: `components/appointments/index.tsx`)
- Appointment calendar → Calendar primitive: uses (evidence: `components/shared/CreateAppointmentCalendar.tsx`)
