# mostafasayed2022/premier_health architecture

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

- Interactive diagram: https://gitdiagram.com/mostafasayed2022/premier_health
- Repository: https://github.com/mostafasayed2022/premier_health

## Overview

This is a bilingual healthcare website with patient booking and profile experiences, alongside staff-facing dashboards and a headless admin panel. The principal patient workflow is browsing care offerings, choosing appointment details, and managing a patient account; the repository also includes clinic content, IV therapy packages, doctor scheduling, and file/content administration. Several domain areas are represented by unsampled route trees, so those nodes are included without speculative call relationships; edges cite the excerpts or source-index references that establish them.

Main entry points: [`front_end/src/app/[locale]`](https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/app/%5Blocale%5D) (Localized pages), [`front_end/src/admin/api/client.ts`](https://github.com/mostafasayed2022/premier_health/blob/tefa/front_end/src/admin/api/client.ts) (Admin HTTP client), [`front_end/src/app/(admin)/admin`](https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/app/(admin)/admin) (Admin routes), [`front_end/src/admin/hooks/useImagePicker.ts`](https://github.com/mostafasayed2022/premier_health/blob/tefa/front_end/src/admin/hooks/useImagePicker.ts) (Image picker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public care website"]
  node_public_pages["Localized pages"]
  node_service_catalog["Services and departments"]
  node_iv_packages["IV therapy packages"]
  node_articles["Articles and categories"]
  node_branches_doctors["Branches and doctors"]
end

subgraph group_booking["Booking and accounts"]
  node_booking_flow["Appointment wizard"]
  node_booking_state["Booking state<br/>[useBookingState.ts]"]
  node_patient_auth["Patient authentication"]
  node_patient_profile["Patient profile"]
end

subgraph group_operations["Clinic operations"]
  node_doctor_profile["Doctor profile"]
  node_doctor_schedule["Doctor schedule manager"]
  node_api_hooks["API query hooks<br/>[hooks.ts]"]
  node_staff_dashboard["Staff dashboard"]
end

subgraph group_admin["Admin and content"]
  node_admin_shell["Admin interface"]
  node_admin_routes["Admin routes"]
  node_admin_dashboard["Admin overview<br/>[Dashboard.tsx]"]
  node_schema_api["Admin schema API<br/>[admin.ts]"]
  node_admin_client["Admin HTTP client<br/>[client.ts]"]
  node_file_management["File management"]
  node_image_picker["Image picker<br/>[useImagePicker.ts]"]
  node_dynamic_admin["Dynamic model admin"]
end

node_visitor(("Site visitor"))
node_backend[("Application API")]

node_visitor -->|"browses"| node_public_pages
node_public_pages -.->|"presents"| node_service_catalog
node_public_pages -.->|"presents"| node_iv_packages
node_public_pages -.->|"presents"| node_articles
node_public_pages -.->|"presents"| node_branches_doctors
node_visitor -->|"starts booking"| node_booking_flow
node_booking_flow -.->|"manages state"| node_booking_state
node_booking_state -->|"checks status"| node_backend
node_visitor -.->|"signs in"| node_patient_auth
node_patient_auth -.->|"unlocks"| node_patient_profile
node_doctor_profile -.->|"manages availability"| node_doctor_schedule
node_doctor_schedule -->|"queries appointments"| node_api_hooks
node_staff_dashboard -.->|"loads operations data"| node_backend
node_admin_routes -.->|"uses shell"| node_admin_shell
node_admin_routes -.->|"renders overview"| node_admin_dashboard
node_admin_dashboard -->|"requests schemas"| node_schema_api
node_schema_api -.->|"uses HTTP client"| node_admin_client
node_admin_client -->|"sends requests"| node_backend
node_file_management -->|"loads and deletes files"| node_admin_client
node_image_picker -.->|"loads file library"| node_admin_client
node_image_picker -->|"uploads files"| node_backend
node_admin_routes -.->|"renders model pages"| node_dynamic_admin

click node_public_pages "https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/app/%5Blocale%5D"
click node_service_catalog "https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/components/services"
click node_iv_packages "https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/components/iv-packages"
click node_articles "https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/components/articles"
click node_branches_doctors "https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/components/branches"
click node_booking_flow "https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/components/booking"
click node_booking_state "https://github.com/mostafasayed2022/premier_health/blob/tefa/front_end/src/components/booking/useBookingState.ts"
click node_patient_auth "https://github.com/mostafasayed2022/premier_health/blob/tefa/front_end/src/context/PatientAuthContext.tsx"
click node_patient_profile "https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/components/profile/patient"
click node_doctor_profile "https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/components/profile/doctor"
click node_doctor_schedule "https://github.com/mostafasayed2022/premier_health/blob/tefa/front_end/src/components/profile/doctor/DoctorScheduleManager/DoctorScheduleManager.tsx"
click node_api_hooks "https://github.com/mostafasayed2022/premier_health/blob/tefa/front_end/src/lib/api/hooks.ts"
click node_staff_dashboard "https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/app/(dashboard)/dashboard"
click node_admin_shell "https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/admin/components/shell"
click node_admin_routes "https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/app/(admin)/admin"
click node_admin_dashboard "https://github.com/mostafasayed2022/premier_health/blob/tefa/front_end/src/admin/components/dashboard/Dashboard.tsx"
click node_schema_api "https://github.com/mostafasayed2022/premier_health/blob/tefa/front_end/src/admin/api/admin.ts"
click node_admin_client "https://github.com/mostafasayed2022/premier_health/blob/tefa/front_end/src/admin/api/client.ts"
click node_file_management "https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/admin/components/files"
click node_image_picker "https://github.com/mostafasayed2022/premier_health/blob/tefa/front_end/src/admin/hooks/useImagePicker.ts"
click node_dynamic_admin "https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/admin/components/dynamic"

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_public_pages,node_service_catalog,node_iv_packages,node_articles,node_branches_doctors toneBlue
class node_booking_flow,node_booking_state,node_patient_auth,node_patient_profile,node_backend toneAmber
class node_doctor_profile,node_doctor_schedule,node_api_hooks,node_staff_dashboard toneMint
class node_admin_shell,node_admin_routes,node_admin_dashboard,node_schema_api,node_admin_client,node_file_management,node_image_picker,node_dynamic_admin toneRose
class node_visitor toneIndigo
```

## Components

### Public care website

- [Localized pages](https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/app/%5Blocale%5D): `front_end/src/app/[locale]`
- [Services and departments](https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/components/services): `front_end/src/components/services`
- [IV therapy packages](https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/components/iv-packages): `front_end/src/components/iv-packages`
- [Articles and categories](https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/components/articles): `front_end/src/components/articles`
- [Branches and doctors](https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/components/branches): `front_end/src/components/branches`

### Booking and accounts

- [Appointment wizard](https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/components/booking): `front_end/src/components/booking`
- [Booking state](https://github.com/mostafasayed2022/premier_health/blob/tefa/front_end/src/components/booking/useBookingState.ts): `front_end/src/components/booking/useBookingState.ts`
- [Patient authentication](https://github.com/mostafasayed2022/premier_health/blob/tefa/front_end/src/context/PatientAuthContext.tsx): `front_end/src/context/PatientAuthContext.tsx`
- [Patient profile](https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/components/profile/patient): `front_end/src/components/profile/patient`

### Clinic operations

- [Doctor profile](https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/components/profile/doctor): `front_end/src/components/profile/doctor`
- [Doctor schedule manager](https://github.com/mostafasayed2022/premier_health/blob/tefa/front_end/src/components/profile/doctor/DoctorScheduleManager/DoctorScheduleManager.tsx): `front_end/src/components/profile/doctor/DoctorScheduleManager/DoctorScheduleManager.tsx`
- [API query hooks](https://github.com/mostafasayed2022/premier_health/blob/tefa/front_end/src/lib/api/hooks.ts): `front_end/src/lib/api/hooks.ts`
- [Staff dashboard](https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/app/(dashboard)/dashboard): `front_end/src/app/(dashboard)/dashboard`

### Admin and content

- [Admin interface](https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/admin/components/shell): `front_end/src/admin/components/shell`
- [Admin routes](https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/app/(admin)/admin): `front_end/src/app/(admin)/admin`
- [Admin overview](https://github.com/mostafasayed2022/premier_health/blob/tefa/front_end/src/admin/components/dashboard/Dashboard.tsx): `front_end/src/admin/components/dashboard/Dashboard.tsx`
- [Admin schema API](https://github.com/mostafasayed2022/premier_health/blob/tefa/front_end/src/admin/api/admin.ts): `front_end/src/admin/api/admin.ts`
- [Admin HTTP client](https://github.com/mostafasayed2022/premier_health/blob/tefa/front_end/src/admin/api/client.ts): `front_end/src/admin/api/client.ts`
- [File management](https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/admin/components/files): `front_end/src/admin/components/files`
- [Image picker](https://github.com/mostafasayed2022/premier_health/blob/tefa/front_end/src/admin/hooks/useImagePicker.ts): `front_end/src/admin/hooks/useImagePicker.ts`
- [Dynamic model admin](https://github.com/mostafasayed2022/premier_health/tree/tefa/front_end/src/admin/components/dynamic): `front_end/src/admin/components/dynamic`

### Other components

- **Site visitor**
- **Application API**

## Connections

- Site visitor → Localized pages: browses
- Localized pages → Services and departments: presents
- Localized pages → IV therapy packages: presents
- Localized pages → Articles and categories: presents
- Localized pages → Branches and doctors: presents
- Site visitor → Appointment wizard: starts booking
- Appointment wizard → Booking state: manages state (evidence: `front_end/src/components/booking/useBookingState.ts`)
- Booking state → Application API: checks status (evidence: `front_end/src/components/booking/useBookingState.ts`)
- Site visitor → Patient authentication: signs in
- Patient authentication → Patient profile: unlocks
- Doctor profile → Doctor schedule manager: manages availability (evidence: `front_end/src/components/profile/doctor/DoctorScheduleManager/DoctorScheduleManager.tsx`)
- Doctor schedule manager → API query hooks: queries appointments (evidence: `front_end/src/components/profile/doctor/DoctorScheduleManager/DoctorScheduleManager.tsx`)
- Staff dashboard → Application API: loads operations data
- Admin routes → Admin interface: uses shell
- Admin routes → Admin overview: renders overview
- Admin overview → Admin schema API: requests schemas (evidence: `front_end/src/admin/components/dashboard/DashboardClientWrapper.tsx`)
- Admin schema API → Admin HTTP client: uses HTTP client
- Admin HTTP client → Application API: sends requests (evidence: `front_end/src/admin/api/client.ts`)
- File management → Admin HTTP client: loads and deletes files (evidence: `front_end/src/admin/components/files/useFilesPage.ts`)
- Image picker → Admin HTTP client: loads file library (evidence: `front_end/src/admin/hooks/useImagePicker.ts`)
- Image picker → Application API: uploads files (evidence: `front_end/src/admin/hooks/useImagePicker.ts`)
- Admin routes → Dynamic model admin: renders model pages
