# mohammadnasas/dentalcloud architecture

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

- Interactive diagram: https://gitdiagram.com/mohammadnasas/dentalcloud
- Repository: https://github.com/mohammadnasas/dentalcloud

## Overview

DentaCare is a bilingual dental-clinic management application with local/offline and optional Supabase-backed accounts. Its main workflow is clinic sign-in, navigating practice and patient records, recording clinical findings and treatment, and managing appointments, payments, and reporting. The README documents the major clinical and administrative capabilities; the source index and excerpts establish application routing, shared state, and parts of the persistence and payment layers. Several feature implementations are unsampled, so their internal call paths are not asserted.

Main entry points: [`src/App.jsx`](https://github.com/mohammadnasas/dentalcloud/blob/main/src/App.jsx) (App routes), [`src/pages/PatientProfile.jsx`](https://github.com/mohammadnasas/dentalcloud/blob/main/src/pages/PatientProfile.jsx) (Patient profile), [`src/context/StoreContext.jsx`](https://github.com/mohammadnasas/dentalcloud/blob/main/src/context/StoreContext.jsx) (Clinic state), [`src/lib/backend.js`](https://github.com/mohammadnasas/dentalcloud/blob/main/src/lib/backend.js) (Backend adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_entry["App routes<br/>[App.jsx]"]
  node_language["Bilingual UI<br/>[I18nContext.jsx]"]
  node_login["Clinic login<br/>[Login.jsx]"]
end

subgraph group_clinical["Clinical records"]
  node_patients["Patient directory<br/>[Patients.jsx]"]
  node_profile["Patient profile<br/>[PatientProfile.jsx]"]
  node_dental["Dental chart<br/>[DentalChart.jsx]"]
  node_periodontal["Perio chart<br/>[PerioChart.jsx]"]
  node_history["Medical history<br/>[HistoryForm.jsx]"]
  node_treatments["Treatments"]
  node_gallery["Images and X-rays<br/>[Gallery.jsx]"]
end

subgraph group_operations["Practice operations"]
  node_appointments["Appointments<br/>[Appointments.jsx]"]
  node_payments["Payments<br/>[Payments.jsx]"]
  node_lab["Lab orders<br/>[Lab.jsx]"]
  node_reports["Clinic reports<br/>[Reports.jsx]"]
  node_instructions["Treatment instructions<br/>[Instructions.jsx]"]
  node_export["Patient exports<br/>[wordExport.js]"]
end

subgraph group_platform["Data and services"]
  node_store["Clinic state<br/>[StoreContext.jsx]"]
  node_localdb[("Local records<br/>[db.js]")]
  node_backend["Backend adapter<br/>[backend.js]"]
  node_supabase[("Supabase service<br/>[supabaseClient.js]")]
  node_media[("Media storage<br/>[media.js]")]
  node_paypal["PayPal billing<br/>[payments.js]"]
end

node_clinician(("Clinic user"))

node_clinician -.->|"uses"| node_entry
node_entry -.->|"routes to"| node_login
node_entry -->|"routes to"| node_patients
node_entry -.->|"routes to"| node_profile
node_entry -->|"routes to"| node_appointments
node_entry -.->|"routes to"| node_payments
node_entry -.->|"routes to"| node_lab
node_entry -.->|"routes to"| node_reports
node_entry -->|"routes to"| node_instructions
node_entry -->|"reads state"| node_store
node_store -->|"calls"| node_backend
node_store -->|"uses"| node_localdb
node_backend -->|"uses"| node_supabase
node_backend -->|"uses"| node_localdb
node_store -->|"syncs billing"| node_paypal
node_profile -.->|"shows"| node_dental
node_profile -.->|"shows"| node_periodontal
node_profile -.->|"shows"| node_history
node_profile -.->|"shows"| node_treatments
node_profile -.->|"shows"| node_gallery
node_gallery -->|"uses"| node_media
node_dental -->|"uses"| node_treatments
node_profile -.->|"exports records"| node_export
node_entry -->|"provides context"| node_language

click node_entry "https://github.com/mohammadnasas/dentalcloud/blob/main/src/App.jsx"
click node_store "https://github.com/mohammadnasas/dentalcloud/blob/main/src/context/StoreContext.jsx"
click node_language "https://github.com/mohammadnasas/dentalcloud/blob/main/src/i18n/I18nContext.jsx"
click node_login "https://github.com/mohammadnasas/dentalcloud/blob/main/src/pages/Login.jsx"
click node_patients "https://github.com/mohammadnasas/dentalcloud/blob/main/src/pages/Patients.jsx"
click node_profile "https://github.com/mohammadnasas/dentalcloud/blob/main/src/pages/PatientProfile.jsx"
click node_dental "https://github.com/mohammadnasas/dentalcloud/blob/main/src/components/patient/DentalChart.jsx"
click node_periodontal "https://github.com/mohammadnasas/dentalcloud/blob/main/src/components/patient/PerioChart.jsx"
click node_history "https://github.com/mohammadnasas/dentalcloud/blob/main/src/components/patient/HistoryForm.jsx"
click node_treatments "https://github.com/mohammadnasas/dentalcloud/blob/main/src/components/patient/TreatmentsPanel.jsx"
click node_gallery "https://github.com/mohammadnasas/dentalcloud/blob/main/src/components/patient/Gallery.jsx"
click node_appointments "https://github.com/mohammadnasas/dentalcloud/blob/main/src/pages/Appointments.jsx"
click node_payments "https://github.com/mohammadnasas/dentalcloud/blob/main/src/pages/Payments.jsx"
click node_lab "https://github.com/mohammadnasas/dentalcloud/blob/main/src/pages/Lab.jsx"
click node_reports "https://github.com/mohammadnasas/dentalcloud/blob/main/src/pages/Reports.jsx"
click node_instructions "https://github.com/mohammadnasas/dentalcloud/blob/main/src/pages/Instructions.jsx"
click node_export "https://github.com/mohammadnasas/dentalcloud/blob/main/src/lib/wordExport.js"
click node_localdb "https://github.com/mohammadnasas/dentalcloud/blob/main/src/lib/db.js"
click node_backend "https://github.com/mohammadnasas/dentalcloud/blob/main/src/lib/backend.js"
click node_supabase "https://github.com/mohammadnasas/dentalcloud/blob/main/src/lib/supabaseClient.js"
click node_media "https://github.com/mohammadnasas/dentalcloud/blob/main/src/lib/media.js"
click node_paypal "https://github.com/mohammadnasas/dentalcloud/blob/main/src/lib/payments.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_entry,node_language,node_login,node_clinician toneBlue
class node_patients,node_profile,node_dental,node_periodontal,node_history,node_treatments,node_gallery toneAmber
class node_appointments,node_payments,node_lab,node_reports,node_instructions,node_export toneMint
class node_store,node_localdb,node_backend,node_supabase,node_media,node_paypal toneRose
```

## Components

### Application shell

- [App routes](https://github.com/mohammadnasas/dentalcloud/blob/main/src/App.jsx): `src/App.jsx`
- [Bilingual UI](https://github.com/mohammadnasas/dentalcloud/blob/main/src/i18n/I18nContext.jsx): `src/i18n/I18nContext.jsx`
- [Clinic login](https://github.com/mohammadnasas/dentalcloud/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`

### Clinical records

- [Patient directory](https://github.com/mohammadnasas/dentalcloud/blob/main/src/pages/Patients.jsx): `src/pages/Patients.jsx`
- [Patient profile](https://github.com/mohammadnasas/dentalcloud/blob/main/src/pages/PatientProfile.jsx): `src/pages/PatientProfile.jsx`
- [Dental chart](https://github.com/mohammadnasas/dentalcloud/blob/main/src/components/patient/DentalChart.jsx): `src/components/patient/DentalChart.jsx`
- [Perio chart](https://github.com/mohammadnasas/dentalcloud/blob/main/src/components/patient/PerioChart.jsx): `src/components/patient/PerioChart.jsx`
- [Medical history](https://github.com/mohammadnasas/dentalcloud/blob/main/src/components/patient/HistoryForm.jsx): `src/components/patient/HistoryForm.jsx`
- [Treatments](https://github.com/mohammadnasas/dentalcloud/blob/main/src/components/patient/TreatmentsPanel.jsx): `src/components/patient/TreatmentsPanel.jsx`
- [Images and X-rays](https://github.com/mohammadnasas/dentalcloud/blob/main/src/components/patient/Gallery.jsx): `src/components/patient/Gallery.jsx`

### Practice operations

- [Appointments](https://github.com/mohammadnasas/dentalcloud/blob/main/src/pages/Appointments.jsx): `src/pages/Appointments.jsx`
- [Payments](https://github.com/mohammadnasas/dentalcloud/blob/main/src/pages/Payments.jsx): `src/pages/Payments.jsx`
- [Lab orders](https://github.com/mohammadnasas/dentalcloud/blob/main/src/pages/Lab.jsx): `src/pages/Lab.jsx`
- [Clinic reports](https://github.com/mohammadnasas/dentalcloud/blob/main/src/pages/Reports.jsx): `src/pages/Reports.jsx`
- [Treatment instructions](https://github.com/mohammadnasas/dentalcloud/blob/main/src/pages/Instructions.jsx): `src/pages/Instructions.jsx`
- [Patient exports](https://github.com/mohammadnasas/dentalcloud/blob/main/src/lib/wordExport.js): `src/lib/wordExport.js`

### Data and services

- [Clinic state](https://github.com/mohammadnasas/dentalcloud/blob/main/src/context/StoreContext.jsx): `src/context/StoreContext.jsx`
- [Local records](https://github.com/mohammadnasas/dentalcloud/blob/main/src/lib/db.js): `src/lib/db.js`
- [Backend adapter](https://github.com/mohammadnasas/dentalcloud/blob/main/src/lib/backend.js): `src/lib/backend.js`
- [Supabase service](https://github.com/mohammadnasas/dentalcloud/blob/main/src/lib/supabaseClient.js): `src/lib/supabaseClient.js`
- [Media storage](https://github.com/mohammadnasas/dentalcloud/blob/main/src/lib/media.js): `src/lib/media.js`
- [PayPal billing](https://github.com/mohammadnasas/dentalcloud/blob/main/src/lib/payments.js): `src/lib/payments.js`

### Other components

- **Clinic user**

## Connections

- Clinic user → App routes: uses (evidence: `README.md`)
- App routes → Clinic login: routes to (evidence: `src/App.jsx`)
- App routes → Patient directory: routes to (evidence: `src/App.jsx`)
- App routes → Patient profile: routes to (evidence: `src/App.jsx`)
- App routes → Appointments: routes to (evidence: `src/App.jsx`)
- App routes → Payments: routes to (evidence: `src/App.jsx`)
- App routes → Lab orders: routes to (evidence: `src/App.jsx`)
- App routes → Clinic reports: routes to (evidence: `README.md`)
- App routes → Treatment instructions: routes to (evidence: `src/App.jsx`)
- App routes → Clinic state: reads state (evidence: `src/App.jsx`)
- Clinic state → Backend adapter: calls (evidence: `src/context/StoreContext.jsx`)
- Clinic state → Local records: uses (evidence: `src/context/StoreContext.jsx`)
- Backend adapter → Supabase service: uses (evidence: `src/lib/backend.js`)
- Backend adapter → Local records: uses (evidence: `src/lib/backend.js`)
- Clinic state → PayPal billing: syncs billing (evidence: `src/context/StoreContext.jsx`)
- Patient profile → Dental chart: shows
- Patient profile → Perio chart: shows (evidence: `README.md`)
- Patient profile → Medical history: shows (evidence: `README.md`)
- Patient profile → Treatments: shows (evidence: `README.md`)
- Patient profile → Images and X-rays: shows (evidence: `README.md`)
- Images and X-rays → Media storage: uses (evidence: `src/components/patient/Gallery.jsx`)
- Dental chart → Treatments: uses (evidence: `src/components/patient/DentalChart.jsx`)
- Patient profile → Patient exports: exports records (evidence: `README.md`)
- App routes → Bilingual UI: provides context (evidence: `src/main.jsx`)
