# adrianhajdin/healthcare architecture

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

- Interactive diagram: https://gitdiagram.com/adrianhajdin/healthcare
- Repository: https://github.com/adrianhajdin/healthcare

## Overview

This is a Next.js healthcare patient-management application. Patients submit a profile, then request appointments; administrators review appointments and can schedule or cancel them, with SMS confirmation documented as a capability. The graph separates patient workflows, administration, backend services, and shared form components. Sampled source confirms form-to-action calls and Appwrite operations; some admin actions and SMS wiring are represented from README documentation, not inspected implementation.

Main entry points: [`components/forms/RegisterForm.tsx`](https://github.com/adrianhajdin/healthcare/blob/main/components/forms/RegisterForm.tsx) (Patient registration), [`components/forms/AppointmentForm.tsx`](https://github.com/adrianhajdin/healthcare/blob/main/components/forms/AppointmentForm.tsx) (Appointment request), [`lib/actions/appointment.actions.ts`](https://github.com/adrianhajdin/healthcare/blob/main/lib/actions/appointment.actions.ts) (Appointment operations), [`app/admin/page.tsx`](https://github.com/adrianhajdin/healthcare/blob/main/app/admin/page.tsx) (Admin dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patient["Patient workflows"]
  node_home["Patient entry<br/>[page.tsx]"]
  node_profile_page["Profile page<br/>[page.tsx]"]
  node_profile_form["Patient registration<br/>[RegisterForm.tsx]"]
  node_booking_page["Booking page<br/>[page.tsx]"]
  node_booking_form["Appointment request"]
  node_success_page["Booking confirmation<br/>[page.tsx]"]
end

subgraph group_admin["Appointment administration"]
  node_admin_page["Admin dashboard<br/>[page.tsx]"]
  node_appointments_table["Appointment table<br/>[DataTable.tsx]"]
  node_table_columns["Appointment actions<br/>[columns.tsx]"]
  node_appointment_modal["Schedule or cancel"]
end

subgraph group_services["Backend services"]
  node_patient_actions["Patient operations<br/>[patient.actions.ts]"]
  node_appointment_actions["Appointment operations"]
  node_appwrite_config["Appwrite client setup<br/>[appwrite.config.ts]"]
  node_appwrite[("Appwrite services")]
  node_sms["SMS provider"]
  node_monitoring["Sentry monitoring"]
end

subgraph group_shared["Shared components"]
  node_validation["Form validation<br/>[validation.ts]"]
  node_form_fields["Form field renderer"]
  node_file_upload["Identification upload<br/>[FileUploader.tsx]"]
end

node_patient_actor(("Patient"))
node_admin_actor(("Administrator"))

node_patient_actor -->|"starts registration"| node_home
node_home -->|"renders"| node_profile_form
node_profile_page -->|"renders"| node_profile_form
node_profile_form -->|"registers patient"| node_patient_actions
node_profile_form -->|"validates with"| node_validation
node_profile_form -->|"renders fields"| node_form_fields
node_profile_form -->|"uploads document"| node_file_upload
node_patient_actions -->|"uses client"| node_appwrite_config
node_patient_actions -->|"stores profiles and files"| node_appwrite
node_booking_page -->|"renders"| node_booking_form
node_booking_form -->|"creates or updates"| node_appointment_actions
node_booking_form -->|"validates with"| node_validation
node_booking_form -->|"renders fields"| node_form_fields
node_appointment_actions -->|"uses client"| node_appwrite_config
node_appointment_actions -->|"reads and writes appointments"| node_appwrite
node_booking_form -->|"routes after booking"| node_success_page
node_admin_actor -->|"manages appointments"| node_admin_page
node_admin_page -->|"renders"| node_appointments_table
node_admin_page -->|"loads appointments"| node_appointment_actions
node_appointments_table -->|"uses columns"| node_table_columns
node_table_columns -->|"opens editor"| node_appointment_modal
node_appointment_modal -->|"renders editor"| node_booking_form
node_appointment_modal -->|"schedules or cancels"| node_appointment_actions
node_appointment_actions -.->|"sends confirmation"| node_sms
node_patient_actor -.->|"app monitored"| node_monitoring

click node_home "https://github.com/adrianhajdin/healthcare/blob/main/app/page.tsx"
click node_profile_page "https://github.com/adrianhajdin/healthcare/blob/main/app/patients/%5BuserId%5D/register/page.tsx"
click node_profile_form "https://github.com/adrianhajdin/healthcare/blob/main/components/forms/RegisterForm.tsx"
click node_booking_page "https://github.com/adrianhajdin/healthcare/blob/main/app/patients/%5BuserId%5D/new-appointment/page.tsx"
click node_booking_form "https://github.com/adrianhajdin/healthcare/blob/main/components/forms/AppointmentForm.tsx"
click node_success_page "https://github.com/adrianhajdin/healthcare/blob/main/app/patients/%5BuserId%5D/new-appointment/success/page.tsx"
click node_admin_page "https://github.com/adrianhajdin/healthcare/blob/main/app/admin/page.tsx"
click node_appointments_table "https://github.com/adrianhajdin/healthcare/blob/main/components/table/DataTable.tsx"
click node_table_columns "https://github.com/adrianhajdin/healthcare/blob/main/components/table/columns.tsx"
click node_appointment_modal "https://github.com/adrianhajdin/healthcare/blob/main/components/AppointmentModal.tsx"
click node_patient_actions "https://github.com/adrianhajdin/healthcare/blob/main/lib/actions/patient.actions.ts"
click node_appointment_actions "https://github.com/adrianhajdin/healthcare/blob/main/lib/actions/appointment.actions.ts"
click node_appwrite_config "https://github.com/adrianhajdin/healthcare/blob/main/lib/appwrite.config.ts"
click node_monitoring "https://github.com/adrianhajdin/healthcare/blob/main/sentry.client.config.ts"
click node_validation "https://github.com/adrianhajdin/healthcare/blob/main/lib/validation.ts"
click node_form_fields "https://github.com/adrianhajdin/healthcare/blob/main/components/CustomFormField.tsx"
click node_file_upload "https://github.com/adrianhajdin/healthcare/blob/main/components/FileUploader.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_home,node_profile_page,node_profile_form,node_booking_page,node_booking_form,node_success_page toneBlue
class node_admin_page,node_appointments_table,node_table_columns,node_appointment_modal toneAmber
class node_patient_actions,node_appointment_actions,node_appwrite_config,node_appwrite,node_sms,node_monitoring toneMint
class node_validation,node_form_fields,node_file_upload toneRose
class node_patient_actor,node_admin_actor toneIndigo
```

## Components

### Patient workflows

- [Patient entry](https://github.com/adrianhajdin/healthcare/blob/main/app/page.tsx): `app/page.tsx`
- [Profile page](https://github.com/adrianhajdin/healthcare/blob/main/app/patients/%5BuserId%5D/register/page.tsx): `app/patients/[userId]/register/page.tsx`
- [Patient registration](https://github.com/adrianhajdin/healthcare/blob/main/components/forms/RegisterForm.tsx): `components/forms/RegisterForm.tsx`
- [Booking page](https://github.com/adrianhajdin/healthcare/blob/main/app/patients/%5BuserId%5D/new-appointment/page.tsx): `app/patients/[userId]/new-appointment/page.tsx`
- [Appointment request](https://github.com/adrianhajdin/healthcare/blob/main/components/forms/AppointmentForm.tsx): `components/forms/AppointmentForm.tsx`
- [Booking confirmation](https://github.com/adrianhajdin/healthcare/blob/main/app/patients/%5BuserId%5D/new-appointment/success/page.tsx): `app/patients/[userId]/new-appointment/success/page.tsx`

### Appointment administration

- [Admin dashboard](https://github.com/adrianhajdin/healthcare/blob/main/app/admin/page.tsx): `app/admin/page.tsx`
- [Appointment table](https://github.com/adrianhajdin/healthcare/blob/main/components/table/DataTable.tsx): `components/table/DataTable.tsx`
- [Appointment actions](https://github.com/adrianhajdin/healthcare/blob/main/components/table/columns.tsx): `components/table/columns.tsx`
- [Schedule or cancel](https://github.com/adrianhajdin/healthcare/blob/main/components/AppointmentModal.tsx): `components/AppointmentModal.tsx`

### Backend services

- [Patient operations](https://github.com/adrianhajdin/healthcare/blob/main/lib/actions/patient.actions.ts): `lib/actions/patient.actions.ts`
- [Appointment operations](https://github.com/adrianhajdin/healthcare/blob/main/lib/actions/appointment.actions.ts): `lib/actions/appointment.actions.ts`
- [Appwrite client setup](https://github.com/adrianhajdin/healthcare/blob/main/lib/appwrite.config.ts): `lib/appwrite.config.ts`
- **Appwrite services**
- **SMS provider**
- [Sentry monitoring](https://github.com/adrianhajdin/healthcare/blob/main/sentry.client.config.ts): `sentry.client.config.ts`

### Shared components

- [Form validation](https://github.com/adrianhajdin/healthcare/blob/main/lib/validation.ts): `lib/validation.ts`
- [Form field renderer](https://github.com/adrianhajdin/healthcare/blob/main/components/CustomFormField.tsx): `components/CustomFormField.tsx`
- [Identification upload](https://github.com/adrianhajdin/healthcare/blob/main/components/FileUploader.tsx): `components/FileUploader.tsx`

### Other components

- **Patient**
- **Administrator**

## Connections

- Patient → Patient entry: starts registration (evidence: `README.md`)
- Patient entry → Patient registration: renders (evidence: `app/page.tsx`)
- Profile page → Patient registration: renders (evidence: `app/patients/[userId]/register/page.tsx`)
- Patient registration → Patient operations: registers patient (evidence: `components/forms/RegisterForm.tsx`)
- Patient registration → Form validation: validates with (evidence: `components/forms/RegisterForm.tsx`)
- Patient registration → Form field renderer: renders fields (evidence: `components/forms/RegisterForm.tsx`)
- Patient registration → Identification upload: uploads document (evidence: `components/forms/RegisterForm.tsx`)
- Patient operations → Appwrite client setup: uses client (evidence: `lib/actions/patient.actions.ts`)
- Patient operations → Appwrite services: stores profiles and files (evidence: `lib/actions/patient.actions.ts`)
- Booking page → Appointment request: renders (evidence: `app/patients/[userId]/new-appointment/page.tsx`)
- Appointment request → Appointment operations: creates or updates (evidence: `components/forms/AppointmentForm.tsx`)
- Appointment request → Form validation: validates with (evidence: `components/forms/AppointmentForm.tsx`)
- Appointment request → Form field renderer: renders fields (evidence: `components/forms/AppointmentForm.tsx`)
- Appointment operations → Appwrite client setup: uses client (evidence: `lib/actions/appointment.actions.ts`)
- Appointment operations → Appwrite services: reads and writes appointments (evidence: `lib/actions/appointment.actions.ts`)
- Appointment request → Booking confirmation: routes after booking (evidence: `components/forms/AppointmentForm.tsx`)
- Administrator → Admin dashboard: manages appointments (evidence: `README.md`)
- Admin dashboard → Appointment table: renders (evidence: `app/admin/page.tsx`)
- Admin dashboard → Appointment operations: loads appointments (evidence: `app/admin/page.tsx`)
- Appointment table → Appointment actions: uses columns (evidence: `components/table/columns.tsx`)
- Appointment actions → Schedule or cancel: opens editor (evidence: `components/table/columns.tsx`)
- Schedule or cancel → Appointment request: renders editor (evidence: `components/AppointmentModal.tsx`)
- Schedule or cancel → Appointment operations: schedules or cancels (evidence: `README.md`)
- Appointment operations → SMS provider: sends confirmation (evidence: `README.md`)
- Patient → Sentry monitoring: app monitored (evidence: `README.md`)
