# ph4n70mc0de/dentcare architecture

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

- Interactive diagram: https://gitdiagram.com/ph4n70mc0de/dentcare
- Repository: https://github.com/ph4n70mc0de/dentcare

## Overview

DentCare is a role-based dental appointment and patient-management application. Users enter through the app’s role-specific portals; patients can book or join a waitlist, while front-desk staff manage appointment-day events and dentists record consultations. The shared store exposes these operations and retains application state. The README documents lifecycle, exception, notification, and reminder capabilities; some corresponding source files were not sampled, so those links are documented rather than asserted as inspected implementation calls.

Main entry points: [`src/App.tsx`](https://github.com/ph4n70mc0de/dentcare/blob/main/src/App.tsx) (Role router), [`src/services/useDentalStore.ts`](https://github.com/ph4n70mc0de/dentcare/blob/main/src/services/useDentalStore.ts) (Store hook), [`src/components/patient/BookingWizard.tsx`](https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/patient/BookingWizard.tsx) (Booking wizard), [`src/services/store.ts`](https://github.com/ph4n70mc0de/dentcare/blob/main/src/services/store.ts) (Dental state store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portals["Role Portals"]
  node_app["Role router<br/>[App.tsx]"]
  node_patient["Patient portal"]
  node_frontdesk["Front-desk portal"]
  node_dentist["Dentist portal"]
  node_admin["Admin portal<br/>[AdminDashboard.tsx]"]
end

subgraph group_booking["Booking and Exceptions"]
  node_bookingwizard["Booking wizard<br/>[BookingWizard.tsx]"]
  node_waitlist["Waitlist management<br/>[WaitlistEngine.tsx]"]
  node_exceptions["Exception flows"]
end

subgraph group_care["Clinic Operations"]
  node_dayflow["Appointment day flow"]
  node_payments["Payment and insurance"]
  node_notifications["Notifications"]
  node_adminfeatures["Clinic administration"]
end

subgraph group_clinical["Clinical Records"]
  node_consultation["Consultation and exam"]
  node_patientrecords["Patient directory"]
  node_clinicalhistory["Clinical histories"]
end

subgraph group_state["Shared State"]
  node_hook["Store hook<br/>[useDentalStore.ts]"]
  node_store["Dental state store<br/>[store.ts]"]
  node_seed["Seed records<br/>[seedData.ts]"]
  node_common["Shared UI components"]
end

node_user(("Clinic users"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_patient
node_app -->|"renders"| node_bookingwizard
node_app -->|"routes to"| node_frontdesk
node_app -->|"routes to"| node_dentist
node_app -->|"routes to"| node_admin
node_patient -->|"offers booking"| node_bookingwizard
node_bookingwizard -->|"offers waitlist"| node_waitlist
node_bookingwizard -.->|"checks availability"| node_store
node_bookingwizard -.->|"supports exceptions"| node_exceptions
node_frontdesk -.->|"manages appointments"| node_dayflow
node_dayflow -->|"handles payment"| node_payments
node_dayflow -->|"opens exception flows"| node_exceptions
node_dentist -->|"offers consultation"| node_consultation
node_dentist -->|"offers histories"| node_clinicalhistory
node_admin -->|"provides settings"| node_adminfeatures
node_admin -->|"provides directory"| node_patientrecords
node_hook -->|"delegates actions"| node_store
node_store -->|"loads seed data"| node_seed
node_app -->|"reads state"| node_hook
node_bookingwizard -->|"reads and updates"| node_hook
node_dayflow -->|"reads and updates"| node_hook
node_consultation -->|"reads and updates"| node_hook
node_notifications -->|"reads and updates"| node_hook
node_patientrecords -->|"reads and updates"| node_hook
node_payments -->|"reads and updates"| node_hook
node_store -.->|"dispatches reminders"| node_notifications
node_store -.->|"enforces lifecycle"| node_exceptions
node_bookingwizard -->|"uses controls"| node_common

click node_app "https://github.com/ph4n70mc0de/dentcare/blob/main/src/App.tsx"
click node_patient "https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/patient/PatientDashboard.tsx"
click node_frontdesk "https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/frontdesk/FrontDeskDashboard.tsx"
click node_dentist "https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/dentist/DentistDashboard.tsx"
click node_admin "https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/admin/AdminDashboard.tsx"
click node_bookingwizard "https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/patient/BookingWizard.tsx"
click node_waitlist "https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/admin/WaitlistEngine.tsx"
click node_exceptions "https://github.com/ph4n70mc0de/dentcare/tree/main/src/components/exceptions"
click node_dayflow "https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/frontdesk/AppointmentDayFlow.tsx"
click node_payments "https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/frontdesk/PaymentAndInsurance.tsx"
click node_notifications "https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/notifications/NotificationCenter.tsx"
click node_adminfeatures "https://github.com/ph4n70mc0de/dentcare/tree/main/src/components/admin"
click node_consultation "https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/dentist/ConsultationAndExam.tsx"
click node_patientrecords "https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/patient/PatientDirectory.tsx"
click node_clinicalhistory "https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/dentist/ClinicalHistories.tsx"
click node_hook "https://github.com/ph4n70mc0de/dentcare/blob/main/src/services/useDentalStore.ts"
click node_store "https://github.com/ph4n70mc0de/dentcare/blob/main/src/services/store.ts"
click node_seed "https://github.com/ph4n70mc0de/dentcare/blob/main/src/data/seedData.ts"
click node_common "https://github.com/ph4n70mc0de/dentcare/tree/main/src/components/common"

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_patient,node_frontdesk,node_dentist,node_admin,node_user toneBlue
class node_bookingwizard,node_waitlist,node_exceptions toneAmber
class node_dayflow,node_payments,node_notifications,node_adminfeatures toneMint
class node_consultation,node_patientrecords,node_clinicalhistory toneRose
class node_hook,node_store,node_seed,node_common toneIndigo
```

## Components

### Role Portals

- [Role router](https://github.com/ph4n70mc0de/dentcare/blob/main/src/App.tsx): `src/App.tsx`
- [Patient portal](https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/patient/PatientDashboard.tsx): `src/components/patient/PatientDashboard.tsx`
- [Front-desk portal](https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/frontdesk/FrontDeskDashboard.tsx): `src/components/frontdesk/FrontDeskDashboard.tsx`
- [Dentist portal](https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/dentist/DentistDashboard.tsx): `src/components/dentist/DentistDashboard.tsx`
- [Admin portal](https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/admin/AdminDashboard.tsx): `src/components/admin/AdminDashboard.tsx`

### Booking and Exceptions

- [Booking wizard](https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/patient/BookingWizard.tsx): `src/components/patient/BookingWizard.tsx`
- [Waitlist management](https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/admin/WaitlistEngine.tsx): `src/components/admin/WaitlistEngine.tsx`
- [Exception flows](https://github.com/ph4n70mc0de/dentcare/tree/main/src/components/exceptions): `src/components/exceptions`

### Clinic Operations

- [Appointment day flow](https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/frontdesk/AppointmentDayFlow.tsx): `src/components/frontdesk/AppointmentDayFlow.tsx`
- [Payment and insurance](https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/frontdesk/PaymentAndInsurance.tsx): `src/components/frontdesk/PaymentAndInsurance.tsx`
- [Notifications](https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/notifications/NotificationCenter.tsx): `src/components/notifications/NotificationCenter.tsx`
- [Clinic administration](https://github.com/ph4n70mc0de/dentcare/tree/main/src/components/admin): `src/components/admin`

### Clinical Records

- [Consultation and exam](https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/dentist/ConsultationAndExam.tsx): `src/components/dentist/ConsultationAndExam.tsx`
- [Patient directory](https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/patient/PatientDirectory.tsx): `src/components/patient/PatientDirectory.tsx`
- [Clinical histories](https://github.com/ph4n70mc0de/dentcare/blob/main/src/components/dentist/ClinicalHistories.tsx): `src/components/dentist/ClinicalHistories.tsx`

### Shared State

- [Store hook](https://github.com/ph4n70mc0de/dentcare/blob/main/src/services/useDentalStore.ts): `src/services/useDentalStore.ts`
- [Dental state store](https://github.com/ph4n70mc0de/dentcare/blob/main/src/services/store.ts): `src/services/store.ts`
- [Seed records](https://github.com/ph4n70mc0de/dentcare/blob/main/src/data/seedData.ts): `src/data/seedData.ts`
- [Shared UI components](https://github.com/ph4n70mc0de/dentcare/tree/main/src/components/common): `src/components/common`

### Other components

- **Clinic users**

## Connections

- Clinic users → Role router: uses (evidence: `README.md`)
- Role router → Patient portal: routes to (evidence: `src/App.tsx`)
- Role router → Booking wizard: renders (evidence: `src/App.tsx`)
- Role router → Front-desk portal: routes to (evidence: `src/App.tsx`)
- Role router → Dentist portal: routes to (evidence: `src/App.tsx`)
- Role router → Admin portal: routes to (evidence: `src/App.tsx`)
- Patient portal → Booking wizard: offers booking (evidence: `README.md`)
- Booking wizard → Waitlist management: offers waitlist (evidence: `README.md`)
- Booking wizard → Dental state store: checks availability (evidence: `README.md`)
- Booking wizard → Exception flows: supports exceptions (evidence: `README.md`)
- Front-desk portal → Appointment day flow: manages appointments (evidence: `README.md`)
- Appointment day flow → Payment and insurance: handles payment (evidence: `src/components/frontdesk/AppointmentDayFlow.tsx`)
- Appointment day flow → Exception flows: opens exception flows (evidence: `src/components/frontdesk/AppointmentDayFlow.tsx`)
- Dentist portal → Consultation and exam: offers consultation (evidence: `src/components/dentist/DentistDashboard.tsx`)
- Dentist portal → Clinical histories: offers histories (evidence: `src/components/dentist/DentistDashboard.tsx`)
- Admin portal → Clinic administration: provides settings (evidence: `src/components/admin/AdminDashboard.tsx`)
- Admin portal → Patient directory: provides directory (evidence: `src/components/admin/AdminDashboard.tsx`)
- Store hook → Dental state store: delegates actions (evidence: `src/services/useDentalStore.ts`)
- Dental state store → Seed records: loads seed data (evidence: `src/services/store.ts`)
- Role router → Store hook: reads state (evidence: `src/App.tsx`)
- Booking wizard → Store hook: reads and updates (evidence: `src/components/patient/BookingWizard.tsx`)
- Appointment day flow → Store hook: reads and updates (evidence: `src/components/frontdesk/AppointmentDayFlow.tsx`)
- Consultation and exam → Store hook: reads and updates (evidence: `src/components/dentist/ConsultationAndExam.tsx`)
- Notifications → Store hook: reads and updates (evidence: `src/components/notifications/NotificationCenter.tsx`)
- Patient directory → Store hook: reads and updates (evidence: `src/components/patient/PatientDirectory.tsx`)
- Payment and insurance → Store hook: reads and updates (evidence: `src/components/frontdesk/PaymentAndInsurance.tsx`)
- Dental state store → Notifications: dispatches reminders (evidence: `README.md`)
- Dental state store → Exception flows: enforces lifecycle (evidence: `README.md`)
- Booking wizard → Shared UI components: uses controls (evidence: `src/components/patient/BookingWizard.tsx`)
