# mohammed2592002/clincsys-ar-en architecture

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

- Interactive diagram: https://gitdiagram.com/mohammed2592002/clincsys-ar-en
- Repository: https://github.com/mohammed2592002/clincsys-ar-en

## Overview

This is a dental-clinic management application, with a platform-owner administration area. The main user journey runs through the application shell and clinic login into patient, appointment, treatment, prescription, laboratory, and financial workspaces, with clinic data persisted through a database client. The graph preserves these major product areas and the offline, backup, and administration layers indicated by the source index. Some screens were not sampled, so their internal call paths are omitted; dashed edges mark only unverified integration points.

Main entry points: [`src/dbClient.ts`](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/dbClient.ts) (Database client), [`src/App.tsx`](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/App.tsx) (Application shell), [`src/components/ClinicSettings.tsx`](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/ClinicSettings.tsx) (Clinic settings), [`src/components/ClinicFinancials.tsx`](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/ClinicFinancials.tsx) (Clinic financials)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clinical["Clinical workflows"]
  node_patients["Patient records"]
  node_medical["Medical files"]
  node_dental["Dental charting<br/>[DentalChart.tsx]"]
  node_consult["Consultations"]
  node_prescriptions["Prescriptions"]
end

subgraph group_operations["Clinic operations"]
  node_appointments["Appointments"]
  node_reception["Reception desk"]
  node_billing["Clinic financials"]
  node_patientfinance["Patient financials"]
  node_labs["Lab tracking"]
  node_pharmacy["Pharmacy inventory<br/>[PharmacyView.tsx]"]
end

subgraph group_platform["Platform and administration"]
  node_app["Application shell<br/>[App.tsx]"]
  node_login["Clinic login<br/>[LoginScreen.tsx]"]
  node_settings["Clinic settings<br/>[ClinicSettings.tsx]"]
  node_superadmin["Platform administration"]
end

subgraph group_data["Persistence and support"]
  node_db[("Database client<br/>[dbClient.ts]")]
  node_offline[("Offline database<br/>[offlineDb.ts]")]
  node_storage["Safe local storage<br/>[storage.ts]"]
  node_dentalservice["Dental data service<br/>[dentalService.ts]"]
  node_backup["Backup service<br/>[backupService.ts]"]
  node_reminder["Backup reminder"]
  node_r2["File storage integration<br/>[r2Upload.ts]"]
end

node_user(("Clinic user"))

node_user -->|"uses"| node_app
node_app -->|"presents"| node_login
node_app -->|"routes to"| node_patients
node_app -->|"routes to"| node_medical
node_app -->|"routes to"| node_appointments
node_app -->|"routes to"| node_prescriptions
node_app -->|"routes to"| node_billing
node_app -->|"routes to"| node_labs
node_app -->|"routes to"| node_settings
node_app -->|"routes to"| node_superadmin
node_patients -->|"reads and writes"| node_db
node_appointments -->|"uses"| node_db
node_billing -->|"uses"| node_db
node_billing -->|"opens"| node_patientfinance
node_labs -->|"uses"| node_dentalservice
node_dentalservice -->|"reads and writes"| node_db
node_settings -->|"uses"| node_db
node_settings -->|"uses"| node_backup
node_reminder -->|"invokes"| node_backup
node_backup -->|"reads clinic data"| node_db
node_db -->|"uses"| node_offline
node_db -->|"uploads files"| node_r2
node_offline -->|"uses"| node_storage
node_settings -->|"persists settings"| node_storage
node_medical -.->|"uses"| node_db
node_dental -.->|"uses"| node_db
node_consult -.->|"uses"| node_db
node_prescriptions -.->|"uses"| node_db
node_reception -.->|"uses"| node_db
node_pharmacy -.->|"uses"| node_db
node_superadmin -.->|"uses"| node_db

click node_app "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/App.tsx"
click node_login "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/LoginScreen.tsx"
click node_patients "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/PatientsManager.tsx"
click node_medical "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/PatientMedicalFile.tsx"
click node_dental "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/DentalChart.tsx"
click node_consult "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/ConsultationView.tsx"
click node_prescriptions "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/PrescriptionGenerator.tsx"
click node_appointments "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/InteractiveCalendar.tsx"
click node_reception "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/ReceptionDeskView.tsx"
click node_billing "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/ClinicFinancials.tsx"
click node_patientfinance "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/PatientFinancialsModal.tsx"
click node_labs "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/LabTrackingView.tsx"
click node_pharmacy "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/PharmacyView.tsx"
click node_settings "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/ClinicSettings.tsx"
click node_superadmin "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/SuperAdminDashboard.tsx"
click node_db "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/dbClient.ts"
click node_offline "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/utils/offlineDb.ts"
click node_storage "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/utils/storage.ts"
click node_dentalservice "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/services/dentalService.ts"
click node_backup "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/utils/backupService.ts"
click node_reminder "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/DailyBackupReminderBanner.tsx"
click node_r2 "https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/utils/r2Upload.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_patients,node_medical,node_dental,node_consult,node_prescriptions,node_user toneBlue
class node_appointments,node_reception,node_billing,node_patientfinance,node_labs,node_pharmacy toneAmber
class node_app,node_login,node_settings,node_superadmin toneMint
class node_db,node_offline,node_storage,node_dentalservice,node_backup,node_reminder,node_r2 toneRose
```

## Components

### Clinical workflows

- [Patient records](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/PatientsManager.tsx): `src/components/PatientsManager.tsx`
- [Medical files](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/PatientMedicalFile.tsx): `src/components/PatientMedicalFile.tsx`
- [Dental charting](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/DentalChart.tsx): `src/components/DentalChart.tsx`
- [Consultations](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/ConsultationView.tsx): `src/components/ConsultationView.tsx`
- [Prescriptions](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/PrescriptionGenerator.tsx): `src/components/PrescriptionGenerator.tsx`

### Clinic operations

- [Appointments](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/InteractiveCalendar.tsx): `src/components/InteractiveCalendar.tsx`
- [Reception desk](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/ReceptionDeskView.tsx): `src/components/ReceptionDeskView.tsx`
- [Clinic financials](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/ClinicFinancials.tsx): `src/components/ClinicFinancials.tsx`
- [Patient financials](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/PatientFinancialsModal.tsx): `src/components/PatientFinancialsModal.tsx`
- [Lab tracking](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/LabTrackingView.tsx): `src/components/LabTrackingView.tsx`
- [Pharmacy inventory](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/PharmacyView.tsx): `src/components/PharmacyView.tsx`

### Platform and administration

- [Application shell](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/App.tsx): `src/App.tsx`
- [Clinic login](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/LoginScreen.tsx): `src/components/LoginScreen.tsx`
- [Clinic settings](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/ClinicSettings.tsx): `src/components/ClinicSettings.tsx`
- [Platform administration](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/SuperAdminDashboard.tsx): `src/components/SuperAdminDashboard.tsx`

### Persistence and support

- [Database client](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/dbClient.ts): `src/dbClient.ts`
- [Offline database](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/utils/offlineDb.ts): `src/utils/offlineDb.ts`
- [Safe local storage](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/utils/storage.ts): `src/utils/storage.ts`
- [Dental data service](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/services/dentalService.ts): `src/services/dentalService.ts`
- [Backup service](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/utils/backupService.ts): `src/utils/backupService.ts`
- [Backup reminder](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/components/DailyBackupReminderBanner.tsx): `src/components/DailyBackupReminderBanner.tsx`
- [File storage integration](https://github.com/mohammed2592002/clincsys-ar-en/blob/main/src/utils/r2Upload.ts): `src/utils/r2Upload.ts`

### Other components

- **Clinic user**

## Connections

- Clinic user → Application shell: uses (evidence: `src/App.tsx`)
- Application shell → Clinic login: presents (evidence: `src/App.tsx`)
- Application shell → Patient records: routes to (evidence: `src/App.tsx`)
- Application shell → Medical files: routes to (evidence: `src/App.tsx`)
- Application shell → Appointments: routes to (evidence: `src/App.tsx`)
- Application shell → Prescriptions: routes to (evidence: `src/App.tsx`)
- Application shell → Clinic financials: routes to (evidence: `src/App.tsx`)
- Application shell → Lab tracking: routes to (evidence: `src/App.tsx`)
- Application shell → Clinic settings: routes to (evidence: `src/App.tsx`)
- Application shell → Platform administration: routes to (evidence: `src/App.tsx`)
- Patient records → Database client: reads and writes (evidence: `src/components/PatientsManager.tsx`)
- Appointments → Database client: uses (evidence: `src/components/InteractiveCalendar.tsx`)
- Clinic financials → Database client: uses (evidence: `src/components/ClinicFinancials.tsx`)
- Clinic financials → Patient financials: opens (evidence: `src/components/ClinicFinancials.tsx`)
- Lab tracking → Dental data service: uses (evidence: `src/components/LabTrackingView.tsx`)
- Dental data service → Database client: reads and writes (evidence: `src/services/dentalService.ts`)
- Clinic settings → Database client: uses (evidence: `src/components/ClinicSettings.tsx`)
- Clinic settings → Backup service: uses (evidence: `src/components/ClinicSettings.tsx`)
- Backup reminder → Backup service: invokes (evidence: `src/components/DailyBackupReminderBanner.tsx`)
- Backup service → Database client: reads clinic data (evidence: `src/utils/backupService.ts`)
- Database client → Offline database: uses (evidence: `src/dbClient.ts`)
- Database client → File storage integration: uploads files (evidence: `src/dbClient.ts`)
- Offline database → Safe local storage: uses (evidence: `src/utils/offlineDb.ts`)
- Clinic settings → Safe local storage: persists settings (evidence: `src/components/ClinicSettings.tsx`)
- Medical files → Database client: uses
- Dental charting → Database client: uses
- Consultations → Database client: uses
- Prescriptions → Database client: uses
- Reception desk → Database client: uses
- Pharmacy inventory → Database client: uses
- Platform administration → Database client: uses
