# lukyeesu/anping architecture

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

- Interactive diagram: https://gitdiagram.com/lukyeesu/anping
- Repository: https://github.com/lukyeesu/anping

## Overview

The tree and sampled UI identify Anping as a clinic-management application, with staff, appointments, patients, inventory, point of sale, reporting and administration workflows. Users enter through the React app; its domain screens handle clinic tasks and use shared Supabase and offline-storage layers. Appointment notifications and settings integrations provide a separate messaging branch. The README is only the Vite template, and most page implementations and data wiring were not sampled, so uncertain links are omitted.

Main entry points: [`src/App.jsx`](https://github.com/lukyeesu/anping/blob/main/src/App.jsx) (App shell), [`supabase/functions/line-messaging/index.ts`](https://github.com/lukyeesu/anping/blob/main/supabase/functions/line-messaging/index.ts) (LINE messaging function), [`src/lib/notificationHub.js`](https://github.com/lukyeesu/anping/blob/main/src/lib/notificationHub.js) (Notification hub), [`src/main.jsx`](https://github.com/lukyeesu/anping/blob/main/src/main.jsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_entry["React entry<br/>[main.jsx]"]
  node_app_shell["App shell<br/>[App.jsx]"]
  node_login["Login screen<br/>[LoginScreen.jsx]"]
end

subgraph group_clinic["Clinic workflows"]
  node_appointments["Appointments"]
  node_staff["Staff management<br/>[StaffManager.jsx]"]
  node_patients["Medical records<br/>[MedicalRecords.jsx]"]
  node_inventory["Inventory"]
  node_catalog["Catalog<br/>[CatalogManager.jsx]"]
  node_pos["Point of sale<br/>[POSSystem.jsx]"]
  node_calendar["Calendar<br/>[CalendarView.jsx]"]
  node_finance["Finance<br/>[FinancePage.jsx]"]
  node_reports["Reports<br/>[ReportsManager.jsx]"]
  node_dashboard["Dashboards<br/>[Dashboard.jsx]"]
  node_executive["Executive dashboard"]
  node_settings["Settings"]
end

subgraph group_data["Data services"]
  node_supabase_client["Supabase client<br/>[supabase.js]"]
  node_supabase_db[("Supabase<br/>[db.js]")]
  node_offline[("Offline store<br/>[offlineStore.js]")]
end

subgraph group_messaging["Messaging"]
  node_notifications["Notification hub<br/>[notificationHub.js]"]
  node_line_fn["LINE messaging function<br/>[index.ts]"]
end

node_user(("Clinic user"))
node_line(("LINE service"))

node_user -->|"opens app"| node_entry
node_entry -->|"renders"| node_app_shell
node_app_shell -->|"presents login"| node_login
node_app_shell -->|"presents"| node_appointments
node_app_shell -->|"presents"| node_staff
node_app_shell -->|"presents"| node_patients
node_app_shell -->|"presents"| node_inventory
node_app_shell -->|"presents"| node_catalog
node_app_shell -->|"presents"| node_pos
node_app_shell -->|"presents"| node_calendar
node_app_shell -->|"presents"| node_finance
node_app_shell -->|"presents"| node_reports
node_app_shell -->|"presents"| node_dashboard
node_app_shell -->|"presents"| node_executive
node_app_shell -->|"presents"| node_settings
node_app_shell -->|"calls"| node_supabase_client
node_app_shell -->|"clears on logout"| node_offline
node_reports -->|"reads reports data"| node_offline
node_appointments -->|"dispatches alerts"| node_notifications
node_settings -->|"sends test alert"| node_notifications
node_notifications -.->|"routes LINE alerts"| node_line_fn
node_line_fn -->|"reads settings"| node_supabase_db
node_line_fn -->|"sends messages"| node_line

click node_entry "https://github.com/lukyeesu/anping/blob/main/src/main.jsx"
click node_app_shell "https://github.com/lukyeesu/anping/blob/main/src/App.jsx"
click node_login "https://github.com/lukyeesu/anping/blob/main/src/pages/LoginScreen.jsx"
click node_appointments "https://github.com/lukyeesu/anping/blob/main/src/pages/AppointmentManager.jsx"
click node_staff "https://github.com/lukyeesu/anping/blob/main/src/pages/StaffManager.jsx"
click node_patients "https://github.com/lukyeesu/anping/blob/main/src/pages/MedicalRecords.jsx"
click node_inventory "https://github.com/lukyeesu/anping/blob/main/src/pages/InventoryManager.jsx"
click node_catalog "https://github.com/lukyeesu/anping/blob/main/src/pages/CatalogManager.jsx"
click node_pos "https://github.com/lukyeesu/anping/blob/main/src/pages/POSSystem.jsx"
click node_calendar "https://github.com/lukyeesu/anping/blob/main/src/pages/CalendarView.jsx"
click node_finance "https://github.com/lukyeesu/anping/blob/main/src/pages/FinancePage.jsx"
click node_reports "https://github.com/lukyeesu/anping/blob/main/src/pages/ReportsManager.jsx"
click node_dashboard "https://github.com/lukyeesu/anping/blob/main/src/pages/Dashboard.jsx"
click node_executive "https://github.com/lukyeesu/anping/blob/main/src/pages/ExecutiveDashboard.jsx"
click node_settings "https://github.com/lukyeesu/anping/blob/main/src/pages/SettingsManager.jsx"
click node_supabase_client "https://github.com/lukyeesu/anping/blob/main/src/lib/supabase.js"
click node_supabase_db "https://github.com/lukyeesu/anping/blob/main/api/db.js"
click node_offline "https://github.com/lukyeesu/anping/blob/main/src/lib/offlineStore.js"
click node_notifications "https://github.com/lukyeesu/anping/blob/main/src/lib/notificationHub.js"
click node_line_fn "https://github.com/lukyeesu/anping/blob/main/supabase/functions/line-messaging/index.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_entry,node_app_shell,node_login,node_user toneBlue
class node_appointments,node_staff,node_patients,node_inventory,node_catalog,node_pos,node_calendar,node_finance,node_reports,node_dashboard,node_executive,node_settings toneAmber
class node_supabase_client,node_supabase_db,node_offline toneMint
class node_notifications,node_line_fn toneRose
class node_line toneIndigo
```

## Components

### Application

- [React entry](https://github.com/lukyeesu/anping/blob/main/src/main.jsx): `src/main.jsx`
- [App shell](https://github.com/lukyeesu/anping/blob/main/src/App.jsx): `src/App.jsx`
- [Login screen](https://github.com/lukyeesu/anping/blob/main/src/pages/LoginScreen.jsx): `src/pages/LoginScreen.jsx`

### Clinic workflows

- [Appointments](https://github.com/lukyeesu/anping/blob/main/src/pages/AppointmentManager.jsx): `src/pages/AppointmentManager.jsx`
- [Staff management](https://github.com/lukyeesu/anping/blob/main/src/pages/StaffManager.jsx): `src/pages/StaffManager.jsx`
- [Medical records](https://github.com/lukyeesu/anping/blob/main/src/pages/MedicalRecords.jsx): `src/pages/MedicalRecords.jsx`
- [Inventory](https://github.com/lukyeesu/anping/blob/main/src/pages/InventoryManager.jsx): `src/pages/InventoryManager.jsx`
- [Catalog](https://github.com/lukyeesu/anping/blob/main/src/pages/CatalogManager.jsx): `src/pages/CatalogManager.jsx`
- [Point of sale](https://github.com/lukyeesu/anping/blob/main/src/pages/POSSystem.jsx): `src/pages/POSSystem.jsx`
- [Calendar](https://github.com/lukyeesu/anping/blob/main/src/pages/CalendarView.jsx): `src/pages/CalendarView.jsx`
- [Finance](https://github.com/lukyeesu/anping/blob/main/src/pages/FinancePage.jsx): `src/pages/FinancePage.jsx`
- [Reports](https://github.com/lukyeesu/anping/blob/main/src/pages/ReportsManager.jsx): `src/pages/ReportsManager.jsx`
- [Dashboards](https://github.com/lukyeesu/anping/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Executive dashboard](https://github.com/lukyeesu/anping/blob/main/src/pages/ExecutiveDashboard.jsx): `src/pages/ExecutiveDashboard.jsx`
- [Settings](https://github.com/lukyeesu/anping/blob/main/src/pages/SettingsManager.jsx): `src/pages/SettingsManager.jsx`

### Data services

- [Supabase client](https://github.com/lukyeesu/anping/blob/main/src/lib/supabase.js): `src/lib/supabase.js`
- [Supabase](https://github.com/lukyeesu/anping/blob/main/api/db.js): `api/db.js`
- [Offline store](https://github.com/lukyeesu/anping/blob/main/src/lib/offlineStore.js): `src/lib/offlineStore.js`

### Messaging

- [Notification hub](https://github.com/lukyeesu/anping/blob/main/src/lib/notificationHub.js): `src/lib/notificationHub.js`
- [LINE messaging function](https://github.com/lukyeesu/anping/blob/main/supabase/functions/line-messaging/index.ts): `supabase/functions/line-messaging/index.ts`

### Other components

- **Clinic user**
- **LINE service**

## Connections

- Clinic user → React entry: opens app
- React entry → App shell: renders
- App shell → Login screen: presents login
- App shell → Appointments: presents
- App shell → Staff management: presents
- App shell → Medical records: presents
- App shell → Inventory: presents
- App shell → Catalog: presents
- App shell → Point of sale: presents
- App shell → Calendar: presents
- App shell → Finance: presents
- App shell → Reports: presents
- App shell → Dashboards: presents
- App shell → Executive dashboard: presents
- App shell → Settings: presents
- App shell → Supabase client: calls
- App shell → Offline store: clears on logout
- Reports → Offline store: reads reports data
- Appointments → Notification hub: dispatches alerts
- Settings → Notification hub: sends test alert
- Notification hub → LINE messaging function: routes LINE alerts
- LINE messaging function → Supabase: reads settings
- LINE messaging function → LINE service: sends messages
