# jhoncarl-jubilag/dental-management-system architecture

> Architecture diagram of the GitHub repository jhoncarl-jubilag/dental-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jhoncarl-jubilag/dental-management-system
- Repository: https://github.com/jhoncarl-jubilag/dental-management-system

## Overview

Diolata is a React dental-clinic system for patient bookings and treatment history, plus staff-facing clinic operations. The main workflow runs from public discovery or patient sign-in through service selection and appointment booking; clinic staff manage schedules and appointments, then billing and treatment records. Separate admin capabilities cover patients, providers, inventory, services, reports, attendance, and settings. Supabase supplies authentication and database access, with Edge Functions for account and email tasks. Edges reflect shown imports/calls or README descriptions; some unsampled feature internals are represented at their exact tree paths.

Main entry points: [`src/services/supabase.js`](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/services/supabase.js) (Supabase client), [`src/App.js`](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/App.js) (Route protection), [`src/pages/patient/bookAppointment.js`](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/patient/bookAppointment.js) (Book appointment), [`src/pages/admin/manageAppointments.js`](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/manageAppointments.js) (Appointment management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and discovery"]
  node_app["Route protection<br/>[App.js]"]
  node_auth["Authentication context<br/>[AuthContext.js]"]
  node_public["Landing and account pages"]
end

subgraph group_booking["Patient appointments"]
  node_service["Service details<br/>[serviceDetail.js]"]
  node_bookingpage["Book appointment<br/>[bookAppointment.js]"]
  node_calendar["Booking calendar"]
  node_myappointments["Patient appointments<br/>[myAppointments.js]"]
  node_scheduling["Scheduling rules"]
end

subgraph group_operations["Clinic operations"]
  node_adminappointments["Appointment management"]
  node_doctors["Provider management<br/>[manageDoctors.js]"]
  node_services["Service management<br/>[manageServices.js]"]
  node_patients["Patient management<br/>[managePatients.js]"]
  node_inventory["Inventory management<br/>[manageInventory.js]"]
  node_billing["Billing management<br/>[manageBilling.js]"]
  node_statement["Billing statement"]
  node_times["Attendance records"]
  node_settings["Clinic settings<br/>[clinicSettings.js]"]
  node_dashboard["Clinic dashboard<br/>[dashboard.js]"]
end

subgraph group_records["Clinical records and reports"]
  node_reports["Clinic reports<br/>[reports.js]"]
  node_treatment["Treatment history"]
  node_treatmentrecords["Treatment record editor"]
  node_treatmentservice["Treatment data service"]
end

subgraph group_backend["Supabase services"]
  node_supabase["Supabase client<br/>[supabase.js]"]
  node_edgefunctions["Account and email functions"]
  node_database[("Supabase services")]
end

node_visitor(("Visitor or patient"))

node_visitor -->|"uses"| node_app
node_app -->|"provides auth"| node_auth
node_app -->|"routes to"| node_public
node_app -->|"protects route"| node_bookingpage
node_app -->|"protects route"| node_adminappointments
node_public -->|"offers services"| node_service
node_service -->|"opens booking"| node_bookingpage
node_bookingpage -->|"renders"| node_calendar
node_bookingpage -->|"uses rules"| node_scheduling
node_calendar -.->|"builds slots"| node_scheduling
node_myappointments -->|"reads records"| node_treatmentservice
node_adminappointments -->|"uses rules"| node_scheduling
node_adminappointments -->|"uses calendar"| node_calendar
node_billing -->|"opens statement"| node_statement
node_patients -->|"renders editor"| node_treatmentrecords
node_treatmentrecords -->|"reads and saves"| node_treatmentservice
node_treatment -.->|"uses records"| node_treatmentservice
node_auth -->|"authenticates"| node_supabase
node_service -->|"queries services"| node_supabase
node_bookingpage -->|"stores bookings"| node_supabase
node_adminappointments -->|"manages appointments"| node_supabase
node_billing -->|"manages billing"| node_supabase
node_services -->|"manages services"| node_supabase
node_treatmentservice -.->|"accesses records"| node_supabase
node_supabase -->|"accesses"| node_database
node_edgefunctions -->|"serves account tasks"| node_database
node_dashboard -.->|"summarizes clinic"| node_database
node_reports -.->|"generates reports"| node_database

click node_app "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/App.js"
click node_auth "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/contexts/AuthContext.js"
click node_public "https://github.com/jhoncarl-jubilag/dental-management-system/tree/main/src/pages/public"
click node_service "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/patient/serviceDetail.js"
click node_bookingpage "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/patient/bookAppointment.js"
click node_calendar "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/patient/BookingCalendar.jsx"
click node_myappointments "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/patient/myAppointments.js"
click node_adminappointments "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/manageAppointments.js"
click node_doctors "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/manageDoctors.js"
click node_services "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/manageServices.js"
click node_patients "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/managePatients.js"
click node_inventory "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/manageInventory.js"
click node_billing "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/manageBilling.js"
click node_statement "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/components/admin/BillingStatement.jsx"
click node_times "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/dailyTimeRecords.js"
click node_settings "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/clinicSettings.js"
click node_dashboard "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/dashboard.js"
click node_reports "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/reports.js"
click node_treatment "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/patient/treatmentHistory.js"
click node_treatmentrecords "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/components/admin/PatientTreatmentRecords.jsx"
click node_treatmentservice "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/services/treatmentRecords.js"
click node_scheduling "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/utils/clinicScheduling.js"
click node_supabase "https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/services/supabase.js"
click node_edgefunctions "https://github.com/jhoncarl-jubilag/dental-management-system/tree/main/supabase/functions"

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_auth,node_public toneBlue
class node_service,node_bookingpage,node_calendar,node_myappointments,node_scheduling toneAmber
class node_adminappointments,node_doctors,node_services,node_patients,node_inventory,node_billing,node_statement,node_times,node_settings,node_dashboard toneMint
class node_reports,node_treatment,node_treatmentrecords,node_treatmentservice toneRose
class node_supabase,node_edgefunctions,node_database,node_visitor toneIndigo
```

## Components

### Access and discovery

- [Route protection](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/App.js): `src/App.js`
- [Authentication context](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/contexts/AuthContext.js): `src/contexts/AuthContext.js`
- [Landing and account pages](https://github.com/jhoncarl-jubilag/dental-management-system/tree/main/src/pages/public): `src/pages/public`

### Patient appointments

- [Service details](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/patient/serviceDetail.js): `src/pages/patient/serviceDetail.js`
- [Book appointment](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/patient/bookAppointment.js): `src/pages/patient/bookAppointment.js`
- [Booking calendar](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/patient/BookingCalendar.jsx): `src/pages/patient/BookingCalendar.jsx`
- [Patient appointments](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/patient/myAppointments.js): `src/pages/patient/myAppointments.js`
- [Scheduling rules](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/utils/clinicScheduling.js): `src/utils/clinicScheduling.js`

### Clinic operations

- [Appointment management](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/manageAppointments.js): `src/pages/admin/manageAppointments.js`
- [Provider management](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/manageDoctors.js): `src/pages/admin/manageDoctors.js`
- [Service management](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/manageServices.js): `src/pages/admin/manageServices.js`
- [Patient management](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/managePatients.js): `src/pages/admin/managePatients.js`
- [Inventory management](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/manageInventory.js): `src/pages/admin/manageInventory.js`
- [Billing management](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/manageBilling.js): `src/pages/admin/manageBilling.js`
- [Billing statement](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/components/admin/BillingStatement.jsx): `src/components/admin/BillingStatement.jsx`
- [Attendance records](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/dailyTimeRecords.js): `src/pages/admin/dailyTimeRecords.js`
- [Clinic settings](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/clinicSettings.js): `src/pages/admin/clinicSettings.js`
- [Clinic dashboard](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/dashboard.js): `src/pages/admin/dashboard.js`

### Clinical records and reports

- [Clinic reports](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/admin/reports.js): `src/pages/admin/reports.js`
- [Treatment history](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/pages/patient/treatmentHistory.js): `src/pages/patient/treatmentHistory.js`
- [Treatment record editor](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/components/admin/PatientTreatmentRecords.jsx): `src/components/admin/PatientTreatmentRecords.jsx`
- [Treatment data service](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/services/treatmentRecords.js): `src/services/treatmentRecords.js`

### Supabase services

- [Supabase client](https://github.com/jhoncarl-jubilag/dental-management-system/blob/main/src/services/supabase.js): `src/services/supabase.js`
- [Account and email functions](https://github.com/jhoncarl-jubilag/dental-management-system/tree/main/supabase/functions): `supabase/functions`
- **Supabase services**

### Other components

- **Visitor or patient**

## Connections

- Visitor or patient → Route protection: uses (evidence: `README.md`)
- Route protection → Authentication context: provides auth (evidence: `src/App.js`)
- Route protection → Landing and account pages: routes to (evidence: `src/App.js`)
- Route protection → Book appointment: protects route (evidence: `src/App.js`)
- Route protection → Appointment management: protects route (evidence: `src/App.js`)
- Landing and account pages → Service details: offers services (evidence: `README.md`)
- Service details → Book appointment: opens booking (evidence: `src/pages/patient/serviceDetail.js`)
- Book appointment → Booking calendar: renders (evidence: `src/pages/patient/bookAppointment.js`)
- Book appointment → Scheduling rules: uses rules (evidence: `src/pages/patient/bookAppointment.js`)
- Booking calendar → Scheduling rules: builds slots
- Patient appointments → Treatment data service: reads records (evidence: `src/pages/patient/myAppointments.js`)
- Appointment management → Scheduling rules: uses rules (evidence: `src/pages/admin/manageAppointments.js`)
- Appointment management → Booking calendar: uses calendar (evidence: `src/pages/admin/manageAppointments.js`)
- Billing management → Billing statement: opens statement (evidence: `src/pages/admin/manageBilling.js`)
- Patient management → Treatment record editor: renders editor (evidence: `src/pages/admin/managePatients.js`)
- Treatment record editor → Treatment data service: reads and saves (evidence: `src/components/admin/PatientTreatmentRecords.jsx`)
- Treatment history → Treatment data service: uses records
- Authentication context → Supabase client: authenticates (evidence: `src/contexts/AuthContext.js`)
- Service details → Supabase client: queries services (evidence: `src/pages/patient/serviceDetail.js`)
- Book appointment → Supabase client: stores bookings (evidence: `src/pages/patient/bookAppointment.js`)
- Appointment management → Supabase client: manages appointments (evidence: `src/pages/admin/manageAppointments.js`)
- Billing management → Supabase client: manages billing (evidence: `src/pages/admin/manageBilling.js`)
- Service management → Supabase client: manages services (evidence: `src/pages/admin/manageServices.js`)
- Treatment data service → Supabase client: accesses records
- Supabase client → Supabase services: accesses (evidence: `README.md`)
- Account and email functions → Supabase services: serves account tasks (evidence: `README.md`)
- Clinic dashboard → Supabase services: summarizes clinic
- Clinic reports → Supabase services: generates reports
