# notjofe/musuqdent architecture

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

- Interactive diagram: https://gitdiagram.com/notjofe/musuqdent
- Repository: https://github.com/notjofe/musuqdent

## Overview

MusuqDent is a backend-free dental clinic management app. Staff sign in with Google or enter demo mode, then use routed clinic pages to manage patients, doctors, appointments, care records and payments; data is persisted in Google Sheets or browser-local demo storage. The graph preserves the documented import, finance, appointment-sharing and patient-balance capabilities. Some page behavior is documented but its implementation was not sampled, so those links cite the README; other relationships rely on the source index or excerpts.

Main entry points: [`src/data/DataContext.jsx`](https://github.com/notjofe/musuqdent/blob/main/src/data/DataContext.jsx) (Clinic data access), [`src/App.jsx`](https://github.com/notjofe/musuqdent/blob/main/src/App.jsx) (Router and access), [`src/auth/AuthContext.jsx`](https://github.com/notjofe/musuqdent/blob/main/src/auth/AuthContext.jsx) (Session and OAuth), [`src/components/AppointmentModal.jsx`](https://github.com/notjofe/musuqdent/blob/main/src/components/AppointmentModal.jsx) (Appointment actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Application"]
  node_app["Router and access<br/>[App.jsx]"]
  node_dashboard["Clinic overview<br/>[Dashboard.jsx]"]
  node_settings["Clinic settings<br/>[Settings.jsx]"]
end

subgraph group_clinical["Clinic records"]
  node_patients["Patient records<br/>[Patients.jsx]"]
  node_patientdetail["Patient history<br/>[PatientDetail.jsx]"]
  node_doctors["Doctor records<br/>[Doctors.jsx]"]
  node_calendar["Appointment calendar<br/>[CalendarPage.jsx]"]
  node_appointment["Appointment actions"]
  node_attended["Visit and payment actions"]
end

subgraph group_operations["Clinic operations"]
  node_financepage["Finance view<br/>[Finance.jsx]"]
  node_report["Payment reporting<br/>[report.js]"]
  node_chart["Finance chart<br/>[BarChart.jsx]"]
  node_importpage["Import workflow<br/>[ImportPage.jsx]"]
  node_importer["File mapping and validation<br/>[importer.js]"]
end

subgraph group_platform["Access and sharing"]
  node_login["Sign-in<br/>[Login.jsx]"]
  node_auth["Session and OAuth<br/>[AuthContext.jsx]"]
  node_google["Google Identity<br/>[google.js]"]
  node_share["Appointment sharing<br/>[share.js]"]
end

subgraph group_data["Data services"]
  node_datacontext["Clinic data access<br/>[DataContext.jsx]"]
  node_schema["Record schema<br/>[schema.js]"]
  node_finance["Patient balances<br/>[finance.js]"]
  node_sheets["Google Sheets store<br/>[sheetsStore.js]"]
  node_localstore[("Demo local store<br/>[localStore.js]")]
end

node_staff(("Clinic staff"))
node_sheetservice[("Google Sheets")]
node_browser[("Browser storage")]

node_staff -->|"opens app"| node_app
node_app -->|"provides session"| node_auth
node_app -->|"routes unauthenticated"| node_login
node_login -->|"signs in"| node_auth
node_auth -->|"checks identity"| node_google
node_auth -->|"stores session"| node_browser
node_auth -->|"gates clinic routes"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_patients
node_app -->|"routes to"| node_patientdetail
node_app -->|"routes to"| node_doctors
node_app -->|"routes to"| node_calendar
node_app -->|"routes to"| node_financepage
node_app -->|"routes to"| node_importpage
node_app -->|"routes to"| node_settings
node_datacontext -->|"gets session token"| node_auth
node_datacontext -->|"uses Google mode"| node_sheets
node_datacontext -->|"uses demo mode"| node_localstore
node_sheets -->|"reads and writes"| node_sheetservice
node_localstore -->|"persists demo data"| node_browser
node_patients -->|"reads and updates"| node_datacontext
node_patientdetail -->|"reads and updates"| node_datacontext
node_doctors -->|"reads and updates"| node_datacontext
node_dashboard -->|"reads clinic data"| node_datacontext
node_calendar -->|"reads clinic data"| node_datacontext
node_calendar -->|"opens appointment"| node_appointment
node_appointment -->|"creates and updates"| node_datacontext
node_appointment -->|"shows actions"| node_attended
node_attended -->|"records visit or payment"| node_datacontext
node_appointment -->|"builds reminders"| node_share
node_patientdetail -->|"opens appointment editor"| node_appointment
node_patientdetail -->|"shows account balance"| node_finance
node_financepage -->|"reads clinic data"| node_datacontext
node_financepage -->|"filters and groups payments"| node_report
node_financepage -->|"renders results"| node_chart
node_importpage -->|"maps import rows"| node_importer
node_importpage -->|"saves imported records"| node_datacontext
node_importer -->|"maps table fields"| node_schema
node_datacontext -->|"uses table definitions"| node_schema
node_settings -->|"refreshes data"| node_datacontext
node_settings -->|"manages session"| node_auth
node_settings -->|"saves configuration"| node_browser

click node_app "https://github.com/notjofe/musuqdent/blob/main/src/App.jsx"
click node_login "https://github.com/notjofe/musuqdent/blob/main/src/pages/Login.jsx"
click node_auth "https://github.com/notjofe/musuqdent/blob/main/src/auth/AuthContext.jsx"
click node_google "https://github.com/notjofe/musuqdent/blob/main/src/auth/google.js"
click node_dashboard "https://github.com/notjofe/musuqdent/blob/main/src/pages/Dashboard.jsx"
click node_patients "https://github.com/notjofe/musuqdent/blob/main/src/pages/Patients.jsx"
click node_patientdetail "https://github.com/notjofe/musuqdent/blob/main/src/pages/PatientDetail.jsx"
click node_doctors "https://github.com/notjofe/musuqdent/blob/main/src/pages/Doctors.jsx"
click node_calendar "https://github.com/notjofe/musuqdent/blob/main/src/pages/CalendarPage.jsx"
click node_appointment "https://github.com/notjofe/musuqdent/blob/main/src/components/AppointmentModal.jsx"
click node_attended "https://github.com/notjofe/musuqdent/blob/main/src/components/AttendedActions.jsx"
click node_financepage "https://github.com/notjofe/musuqdent/blob/main/src/pages/Finance.jsx"
click node_report "https://github.com/notjofe/musuqdent/blob/main/src/lib/report.js"
click node_chart "https://github.com/notjofe/musuqdent/blob/main/src/components/BarChart.jsx"
click node_importpage "https://github.com/notjofe/musuqdent/blob/main/src/pages/ImportPage.jsx"
click node_importer "https://github.com/notjofe/musuqdent/blob/main/src/lib/importer.js"
click node_settings "https://github.com/notjofe/musuqdent/blob/main/src/pages/Settings.jsx"
click node_datacontext "https://github.com/notjofe/musuqdent/blob/main/src/data/DataContext.jsx"
click node_schema "https://github.com/notjofe/musuqdent/blob/main/src/lib/schema.js"
click node_finance "https://github.com/notjofe/musuqdent/blob/main/src/lib/finance.js"
click node_sheets "https://github.com/notjofe/musuqdent/blob/main/src/data/sheetsStore.js"
click node_localstore "https://github.com/notjofe/musuqdent/blob/main/src/data/localStore.js"
click node_share "https://github.com/notjofe/musuqdent/blob/main/src/lib/share.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_app,node_dashboard,node_settings toneBlue
class node_patients,node_patientdetail,node_doctors,node_calendar,node_appointment,node_attended,node_sheetservice,node_browser toneAmber
class node_financepage,node_report,node_chart,node_importpage,node_importer toneMint
class node_login,node_auth,node_google,node_share toneRose
class node_datacontext,node_schema,node_finance,node_sheets,node_localstore,node_staff toneIndigo
```

## Components

### Application

- [Router and access](https://github.com/notjofe/musuqdent/blob/main/src/App.jsx): `src/App.jsx`
- [Clinic overview](https://github.com/notjofe/musuqdent/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Clinic settings](https://github.com/notjofe/musuqdent/blob/main/src/pages/Settings.jsx): `src/pages/Settings.jsx`

### Clinic records

- [Patient records](https://github.com/notjofe/musuqdent/blob/main/src/pages/Patients.jsx): `src/pages/Patients.jsx`
- [Patient history](https://github.com/notjofe/musuqdent/blob/main/src/pages/PatientDetail.jsx): `src/pages/PatientDetail.jsx`
- [Doctor records](https://github.com/notjofe/musuqdent/blob/main/src/pages/Doctors.jsx): `src/pages/Doctors.jsx`
- [Appointment calendar](https://github.com/notjofe/musuqdent/blob/main/src/pages/CalendarPage.jsx): `src/pages/CalendarPage.jsx`
- [Appointment actions](https://github.com/notjofe/musuqdent/blob/main/src/components/AppointmentModal.jsx): `src/components/AppointmentModal.jsx`
- [Visit and payment actions](https://github.com/notjofe/musuqdent/blob/main/src/components/AttendedActions.jsx): `src/components/AttendedActions.jsx`

### Clinic operations

- [Finance view](https://github.com/notjofe/musuqdent/blob/main/src/pages/Finance.jsx): `src/pages/Finance.jsx`
- [Payment reporting](https://github.com/notjofe/musuqdent/blob/main/src/lib/report.js): `src/lib/report.js`
- [Finance chart](https://github.com/notjofe/musuqdent/blob/main/src/components/BarChart.jsx): `src/components/BarChart.jsx`
- [Import workflow](https://github.com/notjofe/musuqdent/blob/main/src/pages/ImportPage.jsx): `src/pages/ImportPage.jsx`
- [File mapping and validation](https://github.com/notjofe/musuqdent/blob/main/src/lib/importer.js): `src/lib/importer.js`

### Access and sharing

- [Sign-in](https://github.com/notjofe/musuqdent/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`
- [Session and OAuth](https://github.com/notjofe/musuqdent/blob/main/src/auth/AuthContext.jsx): `src/auth/AuthContext.jsx`
- [Google Identity](https://github.com/notjofe/musuqdent/blob/main/src/auth/google.js): `src/auth/google.js`
- [Appointment sharing](https://github.com/notjofe/musuqdent/blob/main/src/lib/share.js): `src/lib/share.js`

### Data services

- [Clinic data access](https://github.com/notjofe/musuqdent/blob/main/src/data/DataContext.jsx): `src/data/DataContext.jsx`
- [Record schema](https://github.com/notjofe/musuqdent/blob/main/src/lib/schema.js): `src/lib/schema.js`
- [Patient balances](https://github.com/notjofe/musuqdent/blob/main/src/lib/finance.js): `src/lib/finance.js`
- [Google Sheets store](https://github.com/notjofe/musuqdent/blob/main/src/data/sheetsStore.js): `src/data/sheetsStore.js`
- [Demo local store](https://github.com/notjofe/musuqdent/blob/main/src/data/localStore.js): `src/data/localStore.js`

### Other components

- **Clinic staff**
- **Google Sheets**
- **Browser storage**

## Connections

- Clinic staff → Router and access: opens app (evidence: `README.md`)
- Router and access → Session and OAuth: provides session (evidence: `src/App.jsx`)
- Router and access → Sign-in: routes unauthenticated (evidence: `src/App.jsx`)
- Sign-in → Session and OAuth: signs in (evidence: `src/pages/Login.jsx`)
- Session and OAuth → Google Identity: checks identity (evidence: `src/auth/AuthContext.jsx`)
- Session and OAuth → Browser storage: stores session (evidence: `src/auth/AuthContext.jsx`)
- Session and OAuth → Router and access: gates clinic routes (evidence: `src/App.jsx`)
- Router and access → Clinic overview: routes to (evidence: `src/App.jsx`)
- Router and access → Patient records: routes to (evidence: `src/App.jsx`)
- Router and access → Patient history: routes to (evidence: `src/App.jsx`)
- Router and access → Doctor records: routes to (evidence: `src/App.jsx`)
- Router and access → Appointment calendar: routes to (evidence: `src/App.jsx`)
- Router and access → Finance view: routes to (evidence: `src/App.jsx`)
- Router and access → Import workflow: routes to (evidence: `src/App.jsx`)
- Router and access → Clinic settings: routes to (evidence: `src/App.jsx`)
- Clinic data access → Session and OAuth: gets session token (evidence: `src/data/DataContext.jsx`)
- Clinic data access → Google Sheets store: uses Google mode (evidence: `src/data/DataContext.jsx`)
- Clinic data access → Demo local store: uses demo mode (evidence: `src/data/DataContext.jsx`)
- Google Sheets store → Google Sheets: reads and writes (evidence: `README.md`)
- Demo local store → Browser storage: persists demo data (evidence: `README.md`)
- Patient records → Clinic data access: reads and updates (evidence: `src/pages/Patients.jsx`)
- Patient history → Clinic data access: reads and updates (evidence: `src/pages/PatientDetail.jsx`)
- Doctor records → Clinic data access: reads and updates (evidence: `src/pages/Doctors.jsx`)
- Clinic overview → Clinic data access: reads clinic data (evidence: `src/pages/Dashboard.jsx`)
- Appointment calendar → Clinic data access: reads clinic data (evidence: `src/pages/CalendarPage.jsx`)
- Appointment calendar → Appointment actions: opens appointment (evidence: `src/pages/CalendarPage.jsx`)
- Appointment actions → Clinic data access: creates and updates (evidence: `src/components/AppointmentModal.jsx`)
- Appointment actions → Visit and payment actions: shows actions (evidence: `src/components/AppointmentModal.jsx`)
- Visit and payment actions → Clinic data access: records visit or payment (evidence: `src/components/AttendedActions.jsx`)
- Appointment actions → Appointment sharing: builds reminders (evidence: `src/components/AppointmentModal.jsx`)
- Patient history → Appointment actions: opens appointment editor (evidence: `src/pages/PatientDetail.jsx`)
- Patient history → Patient balances: shows account balance (evidence: `README.md`)
- Finance view → Clinic data access: reads clinic data (evidence: `src/pages/Finance.jsx`)
- Finance view → Payment reporting: filters and groups payments (evidence: `src/pages/Finance.jsx`)
- Finance view → Finance chart: renders results (evidence: `src/pages/Finance.jsx`)
- Import workflow → File mapping and validation: maps import rows (evidence: `src/pages/ImportPage.jsx`)
- Import workflow → Clinic data access: saves imported records (evidence: `src/pages/ImportPage.jsx`)
- File mapping and validation → Record schema: maps table fields (evidence: `src/lib/importer.js`)
- Clinic data access → Record schema: uses table definitions (evidence: `src/data/DataContext.jsx`)
- Clinic settings → Clinic data access: refreshes data (evidence: `src/pages/Settings.jsx`)
- Clinic settings → Session and OAuth: manages session (evidence: `src/pages/Settings.jsx`)
- Clinic settings → Browser storage: saves configuration
