# demadrian/welldent architecture

> Architecture diagram of the GitHub repository demadrian/welldent, 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/demadrian/welldent
- Repository: https://github.com/demadrian/welldent

## Overview

WellDent+ is a local-network dental clinic management app. Staff sign in, review the dashboard, and move among patient records, chair-aware appointments, treatment and billing, inventory, and reminders. The PHP pages handle their own requests; shared includes provide authentication, booking rules, reminders, rendering, and database access. The README documents reporting, administration, and optional message delivery as additional capabilities. Several page implementations were not sampled, so their internal calls are not inferred beyond documented bootstrap wiring.

Main entry points: [`includes/bootstrap.php`](https://github.com/demadrian/welldent/blob/main/includes/bootstrap.php) (Page bootstrap), [`includes/reminders.php`](https://github.com/demadrian/welldent/blob/main/includes/reminders.php) (Reminder scheduling), [`patient.php`](https://github.com/demadrian/welldent/blob/main/patient.php) (Patient record), [`index.php`](https://github.com/demadrian/welldent/blob/main/index.php) (Clinic dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and overview"]
  node_login["Sign in<br/>[login.php]"]
  node_dashboard["Clinic dashboard<br/>[index.php]"]
end

subgraph group_care["Patient care"]
  node_patients["Patient directory<br/>[patients.php]"]
  node_patient_form["Patient intake<br/>[patient_form.php]"]
  node_patient_record["Patient record<br/>[patient.php]"]
  node_dental_chart["Dental chart<br/>[dental_chart.php]"]
end

subgraph group_clinic_ops["Clinic operations"]
  node_appointments["Schedule<br/>[appointments.php]"]
  node_appointment_form["Appointment booking"]
  node_payment["Payments<br/>[payment.php]"]
  node_inventory["Inventory<br/>[inventory.php]"]
  node_reminders_page["Reminder management<br/>[reminders.php]"]
  node_cron["Scheduled sender<br/>[send_reminders.php]"]
  node_reports["Reports<br/>[reports.php]"]
  node_settings["Clinic settings<br/>[settings.php]"]
end

subgraph group_shared["Shared runtime"]
  node_booking_rules["Booking rules<br/>[appointments.php]"]
  node_reminder_engine["Reminder scheduling<br/>[reminders.php]"]
  node_auth["Authentication and roles<br/>[auth.php]"]
  node_bootstrap["Page bootstrap<br/>[bootstrap.php]"]
  node_layout["Page layout<br/>[layout.php]"]
  node_db_access["Database access<br/>[db.php]"]
end

subgraph group_data["Data and delivery"]
  node_mysql[("Clinic database<br/>[schema.sql]")]
  node_outbox["Test message log"]
end

node_staff(("Clinic staff"))
node_sms_gateway["Semaphore SMS"]
node_email_service["Email delivery"]

node_staff -->|"signs in"| node_login
node_staff -->|"uses clinic app"| node_dashboard
node_dashboard -->|"opens patient"| node_patient_record
node_patient_record -->|"renders chart"| node_dental_chart
node_appointment_form -->|"checks overlap"| node_booking_rules
node_patient_record -->|"schedules reminders"| node_reminder_engine
node_reminders_page -.->|"manages delivery"| node_reminder_engine
node_cron -.->|"processes due"| node_reminder_engine
node_reminder_engine -->|"writes test messages"| node_outbox
node_reminder_engine -->|"sends SMS"| node_sms_gateway
node_reminder_engine -->|"sends email"| node_email_service
node_login -->|"loads"| node_bootstrap
node_dashboard -->|"loads"| node_bootstrap
node_appointments -->|"loads"| node_bootstrap
node_appointment_form -->|"loads"| node_bootstrap
node_patient_record -->|"loads"| node_bootstrap
node_inventory -->|"loads"| node_bootstrap
node_payment -.->|"loads"| node_bootstrap
node_reminders_page -->|"loads"| node_bootstrap
node_reports -->|"loads"| node_bootstrap
node_settings -->|"loads"| node_bootstrap
node_bootstrap -->|"loads"| node_auth
node_bootstrap -->|"loads"| node_booking_rules
node_bootstrap -->|"loads"| node_reminder_engine
node_bootstrap -->|"loads"| node_layout
node_bootstrap -->|"loads"| node_db_access
node_auth -->|"queries users"| node_db_access
node_db_access -.->|"queries clinic data"| node_mysql
node_staff -->|"manages patients"| node_patients
node_staff -->|"manages schedule"| node_appointments
node_staff -->|"tracks stock"| node_inventory
node_staff -->|"handles reminders"| node_reminders_page
node_staff -->|"views reports"| node_reports
node_staff -->|"administers clinic"| node_settings

click node_login "https://github.com/demadrian/welldent/blob/main/login.php"
click node_dashboard "https://github.com/demadrian/welldent/blob/main/index.php"
click node_patients "https://github.com/demadrian/welldent/blob/main/patients.php"
click node_patient_form "https://github.com/demadrian/welldent/blob/main/patient_form.php"
click node_patient_record "https://github.com/demadrian/welldent/blob/main/patient.php"
click node_dental_chart "https://github.com/demadrian/welldent/blob/main/includes/dental_chart.php"
click node_appointments "https://github.com/demadrian/welldent/blob/main/appointments.php"
click node_appointment_form "https://github.com/demadrian/welldent/blob/main/appointment_form.php"
click node_booking_rules "https://github.com/demadrian/welldent/blob/main/includes/appointments.php"
click node_payment "https://github.com/demadrian/welldent/blob/main/payment.php"
click node_inventory "https://github.com/demadrian/welldent/blob/main/inventory.php"
click node_reminders_page "https://github.com/demadrian/welldent/blob/main/reminders.php"
click node_reminder_engine "https://github.com/demadrian/welldent/blob/main/includes/reminders.php"
click node_cron "https://github.com/demadrian/welldent/blob/main/cron/send_reminders.php"
click node_reports "https://github.com/demadrian/welldent/blob/main/reports.php"
click node_settings "https://github.com/demadrian/welldent/blob/main/settings.php"
click node_auth "https://github.com/demadrian/welldent/blob/main/includes/auth.php"
click node_bootstrap "https://github.com/demadrian/welldent/blob/main/includes/bootstrap.php"
click node_layout "https://github.com/demadrian/welldent/blob/main/includes/layout.php"
click node_db_access "https://github.com/demadrian/welldent/blob/main/includes/db.php"
click node_mysql "https://github.com/demadrian/welldent/blob/main/database/schema.sql"
click node_outbox "https://github.com/demadrian/welldent/tree/main/storage"

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_login,node_dashboard toneBlue
class node_patients,node_patient_form,node_patient_record,node_dental_chart toneAmber
class node_appointments,node_appointment_form,node_payment,node_inventory,node_reminders_page,node_cron,node_reports,node_settings toneMint
class node_booking_rules,node_reminder_engine,node_auth,node_bootstrap,node_layout,node_db_access toneRose
class node_mysql,node_outbox,node_staff,node_sms_gateway,node_email_service toneIndigo
```

## Components

### Access and overview

- [Sign in](https://github.com/demadrian/welldent/blob/main/login.php): `login.php`
- [Clinic dashboard](https://github.com/demadrian/welldent/blob/main/index.php): `index.php`

### Patient care

- [Patient directory](https://github.com/demadrian/welldent/blob/main/patients.php): `patients.php`
- [Patient intake](https://github.com/demadrian/welldent/blob/main/patient_form.php): `patient_form.php`
- [Patient record](https://github.com/demadrian/welldent/blob/main/patient.php): `patient.php`
- [Dental chart](https://github.com/demadrian/welldent/blob/main/includes/dental_chart.php): `includes/dental_chart.php`

### Clinic operations

- [Schedule](https://github.com/demadrian/welldent/blob/main/appointments.php): `appointments.php`
- [Appointment booking](https://github.com/demadrian/welldent/blob/main/appointment_form.php): `appointment_form.php`
- [Payments](https://github.com/demadrian/welldent/blob/main/payment.php): `payment.php`
- [Inventory](https://github.com/demadrian/welldent/blob/main/inventory.php): `inventory.php`
- [Reminder management](https://github.com/demadrian/welldent/blob/main/reminders.php): `reminders.php`
- [Scheduled sender](https://github.com/demadrian/welldent/blob/main/cron/send_reminders.php): `cron/send_reminders.php`
- [Reports](https://github.com/demadrian/welldent/blob/main/reports.php): `reports.php`
- [Clinic settings](https://github.com/demadrian/welldent/blob/main/settings.php): `settings.php`

### Shared runtime

- [Booking rules](https://github.com/demadrian/welldent/blob/main/includes/appointments.php): `includes/appointments.php`
- [Reminder scheduling](https://github.com/demadrian/welldent/blob/main/includes/reminders.php): `includes/reminders.php`
- [Authentication and roles](https://github.com/demadrian/welldent/blob/main/includes/auth.php): `includes/auth.php`
- [Page bootstrap](https://github.com/demadrian/welldent/blob/main/includes/bootstrap.php): `includes/bootstrap.php`
- [Page layout](https://github.com/demadrian/welldent/blob/main/includes/layout.php): `includes/layout.php`
- [Database access](https://github.com/demadrian/welldent/blob/main/includes/db.php): `includes/db.php`

### Data and delivery

- [Clinic database](https://github.com/demadrian/welldent/blob/main/database/schema.sql): `database/schema.sql`
- [Test message log](https://github.com/demadrian/welldent/tree/main/storage): `storage`

### Other components

- **Clinic staff**
- **Semaphore SMS**
- **Email delivery**

## Connections

- Clinic staff → Sign in: signs in (evidence: `README.md`)
- Clinic staff → Clinic dashboard: uses clinic app (evidence: `README.md`)
- Clinic dashboard → Patient record: opens patient (evidence: `index.php`)
- Patient record → Dental chart: renders chart (evidence: `patient.php`)
- Appointment booking → Booking rules: checks overlap (evidence: `includes/appointments.php`)
- Patient record → Reminder scheduling: schedules reminders (evidence: `patient.php`)
- Reminder management → Reminder scheduling: manages delivery
- Scheduled sender → Reminder scheduling: processes due
- Reminder scheduling → Test message log: writes test messages (evidence: `includes/reminders.php`)
- Reminder scheduling → Semaphore SMS: sends SMS (evidence: `includes/reminders.php`)
- Reminder scheduling → Email delivery: sends email (evidence: `includes/reminders.php`)
- Sign in → Page bootstrap: loads (evidence: `login.php`)
- Clinic dashboard → Page bootstrap: loads (evidence: `index.php`)
- Schedule → Page bootstrap: loads (evidence: `appointments.php`)
- Appointment booking → Page bootstrap: loads (evidence: `appointment_form.php`)
- Patient record → Page bootstrap: loads (evidence: `patient.php`)
- Inventory → Page bootstrap: loads (evidence: `inventory.php`)
- Payments → Page bootstrap: loads (evidence: `payment.php`)
- Reminder management → Page bootstrap: loads (evidence: `reminders.php`)
- Reports → Page bootstrap: loads (evidence: `reports.php`)
- Clinic settings → Page bootstrap: loads (evidence: `settings.php`)
- Page bootstrap → Authentication and roles: loads (evidence: `includes/bootstrap.php`)
- Page bootstrap → Booking rules: loads (evidence: `includes/bootstrap.php`)
- Page bootstrap → Reminder scheduling: loads (evidence: `includes/bootstrap.php`)
- Page bootstrap → Page layout: loads (evidence: `includes/bootstrap.php`)
- Page bootstrap → Database access: loads (evidence: `includes/bootstrap.php`)
- Authentication and roles → Database access: queries users (evidence: `includes/auth.php`)
- Database access → Clinic database: queries clinic data
- Clinic staff → Patient directory: manages patients (evidence: `README.md`)
- Clinic staff → Schedule: manages schedule (evidence: `README.md`)
- Clinic staff → Inventory: tracks stock (evidence: `README.md`)
- Clinic staff → Reminder management: handles reminders (evidence: `README.md`)
- Clinic staff → Reports: views reports (evidence: `README.md`)
- Clinic staff → Clinic settings: administers clinic (evidence: `README.md`)
