# aakxsh706/freelance-dental architecture

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

- Interactive diagram: https://gitdiagram.com/aakxsh706/freelance-dental
- Repository: https://github.com/aakxsh706/freelance-dental

## Overview

Belin’s Dental Clinic combines a public dental website and online appointment requests with a staff-only clinic management app, backed by one Django REST API and shared database. The main workflow is patient booking → appointment request and cautious patient matching → staff review and scheduling → clinical visit and records. The graph also includes availability management, notifications, audit, clinic settings, and the documented patient contact-sheet sync. Some backend routes and frontend pages were not sampled; those links are shown only where the README or source index supports them.

Main entry points: [`backend/clinic/models`](https://github.com/aakxsh706/freelance-dental/tree/main/backend/clinic/models) (Central database), [`frontend/src/pages/clinic`](https://github.com/aakxsh706/freelance-dental/tree/main/frontend/src/pages/clinic) (Clinic app), [`backend/clinic/views/scheduling.py`](https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/views/scheduling.py) (Scheduling views), [`backend/clinic/views/appointment_actions.py`](https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/views/appointment_actions.py) (Appointment actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public website"]
  node_app_routes["App routes<br/>[App.tsx]"]
  node_public_site["Public website<br/>[HomePage.tsx]"]
  node_booking["Booking flow"]
end

subgraph group_staff["Clinic management"]
  node_clinic_ui["Clinic app"]
  node_availability_ui["Availability manager"]
  node_api_client["API client<br/>[client.ts]"]
end

subgraph group_backend["Django API"]
  node_api_routes["API routing<br/>[urls.py]"]
  node_scheduling_views["Scheduling views<br/>[scheduling.py]"]
  node_appointment_actions["Appointment actions"]
  node_patient_views["Patient management<br/>[patients.py]"]
  node_clinical_views["Clinical records API<br/>[clinical.py]"]
end

subgraph group_records["Clinic records"]
  node_availability["Slot availability<br/>[availability.py]"]
  node_matching["Patient matching<br/>[matching.py]"]
  node_notifications["Email notifications<br/>[notifications.py]"]
  node_audit["Audit trail<br/>[audit.py]"]
  node_records_db[("Central database")]
end

subgraph group_integrations["External services"]
  node_sheet_sync["Patient sheet sync<br/>[sheet_sync.py]"]
end

node_patient(("Patient"))
node_staff_user(("Clinic staff"))
node_google_sheet[("Google Sheet")]

node_patient -->|"views"| node_public_site
node_public_site -->|"starts booking"| node_booking
node_patient -->|"requests visit"| node_booking
node_booking -.->|"submits request"| node_api_client
node_clinic_ui -.->|"uses API"| node_api_client
node_availability_ui -->|"loads and changes"| node_api_client
node_api_client -->|"sends requests"| node_api_routes
node_api_routes -.->|"routes requests"| node_scheduling_views
node_scheduling_views -->|"checks slots"| node_availability
node_scheduling_views -->|"resolves patient"| node_matching
node_scheduling_views -->|"creates request"| node_records_db
node_matching -->|"finds patient"| node_records_db
node_staff_user -->|"manages clinic"| node_clinic_ui
node_clinic_ui -.->|"manages appointments"| node_appointment_actions
node_appointment_actions -->|"updates appointments"| node_records_db
node_appointment_actions -->|"sends email"| node_notifications
node_appointment_actions -->|"records events"| node_audit
node_clinic_ui -.->|"manages patients"| node_patient_views
node_clinic_ui -.->|"manages clinical records"| node_clinical_views
node_patient_views -->|"reads and writes"| node_records_db
node_clinical_views -->|"reads and writes"| node_records_db
node_sheet_sync -->|"reads contacts"| node_records_db
node_sheet_sync -.->|"pushes contacts"| node_google_sheet

click node_app_routes "https://github.com/aakxsh706/freelance-dental/blob/main/frontend/src/App.tsx"
click node_public_site "https://github.com/aakxsh706/freelance-dental/blob/main/frontend/src/pages/HomePage.tsx"
click node_booking "https://github.com/aakxsh706/freelance-dental/blob/main/frontend/src/pages/AppointmentSchedulePage.tsx"
click node_clinic_ui "https://github.com/aakxsh706/freelance-dental/tree/main/frontend/src/pages/clinic"
click node_availability_ui "https://github.com/aakxsh706/freelance-dental/blob/main/frontend/src/components/dashboard/AvailabilityManager.tsx"
click node_api_client "https://github.com/aakxsh706/freelance-dental/blob/main/frontend/src/api/client.ts"
click node_api_routes "https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/urls.py"
click node_scheduling_views "https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/views/scheduling.py"
click node_appointment_actions "https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/views/appointment_actions.py"
click node_patient_views "https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/views/patients.py"
click node_clinical_views "https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/views/clinical.py"
click node_availability "https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/availability.py"
click node_matching "https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/matching.py"
click node_notifications "https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/notifications.py"
click node_audit "https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/audit.py"
click node_records_db "https://github.com/aakxsh706/freelance-dental/tree/main/backend/clinic/models"
click node_sheet_sync "https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/sheet_sync.py"

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_routes,node_public_site,node_booking toneBlue
class node_clinic_ui,node_availability_ui,node_api_client,node_google_sheet toneAmber
class node_api_routes,node_scheduling_views,node_appointment_actions,node_patient_views,node_clinical_views toneMint
class node_availability,node_matching,node_notifications,node_audit,node_records_db toneRose
class node_sheet_sync,node_patient,node_staff_user toneIndigo
```

## Components

### Public website

- [App routes](https://github.com/aakxsh706/freelance-dental/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Public website](https://github.com/aakxsh706/freelance-dental/blob/main/frontend/src/pages/HomePage.tsx): `frontend/src/pages/HomePage.tsx`
- [Booking flow](https://github.com/aakxsh706/freelance-dental/blob/main/frontend/src/pages/AppointmentSchedulePage.tsx): `frontend/src/pages/AppointmentSchedulePage.tsx`

### Clinic management

- [Clinic app](https://github.com/aakxsh706/freelance-dental/tree/main/frontend/src/pages/clinic): `frontend/src/pages/clinic`
- [Availability manager](https://github.com/aakxsh706/freelance-dental/blob/main/frontend/src/components/dashboard/AvailabilityManager.tsx): `frontend/src/components/dashboard/AvailabilityManager.tsx`
- [API client](https://github.com/aakxsh706/freelance-dental/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### Django API

- [API routing](https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/urls.py): `backend/clinic/urls.py`
- [Scheduling views](https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/views/scheduling.py): `backend/clinic/views/scheduling.py`
- [Appointment actions](https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/views/appointment_actions.py): `backend/clinic/views/appointment_actions.py`
- [Patient management](https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/views/patients.py): `backend/clinic/views/patients.py`
- [Clinical records API](https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/views/clinical.py): `backend/clinic/views/clinical.py`

### Clinic records

- [Slot availability](https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/availability.py): `backend/clinic/availability.py`
- [Patient matching](https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/matching.py): `backend/clinic/matching.py`
- [Email notifications](https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/notifications.py): `backend/clinic/notifications.py`
- [Audit trail](https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/audit.py): `backend/clinic/audit.py`
- [Central database](https://github.com/aakxsh706/freelance-dental/tree/main/backend/clinic/models): `backend/clinic/models`

### External services

- [Patient sheet sync](https://github.com/aakxsh706/freelance-dental/blob/main/backend/clinic/sheet_sync.py): `backend/clinic/sheet_sync.py`

### Other components

- **Patient**
- **Clinic staff**
- **Google Sheet**

## Connections

- Patient → Public website: views
- Public website → Booking flow: starts booking (evidence: `frontend/src/App.tsx`)
- Patient → Booking flow: requests visit
- Booking flow → API client: submits request
- Clinic app → API client: uses API (evidence: `frontend/src/pages/clinic/VisitDetailPage.tsx`)
- Availability manager → API client: loads and changes (evidence: `frontend/src/components/dashboard/AvailabilityManager.tsx`)
- API client → API routing: sends requests
- API routing → Scheduling views: routes requests
- Scheduling views → Slot availability: checks slots
- Scheduling views → Patient matching: resolves patient
- Scheduling views → Central database: creates request
- Patient matching → Central database: finds patient (evidence: `backend/clinic/matching.py`)
- Clinic staff → Clinic app: manages clinic
- Clinic app → Appointment actions: manages appointments
- Appointment actions → Central database: updates appointments (evidence: `backend/clinic/views/appointment_actions.py`)
- Appointment actions → Email notifications: sends email (evidence: `backend/clinic/views/appointment_actions.py`)
- Appointment actions → Audit trail: records events (evidence: `backend/clinic/views/appointment_actions.py`)
- Clinic app → Patient management: manages patients
- Clinic app → Clinical records API: manages clinical records
- Patient management → Central database: reads and writes
- Clinical records API → Central database: reads and writes
- Patient sheet sync → Central database: reads contacts
- Patient sheet sync → Google Sheet: pushes contacts
