# m-wonder/physio-clinic-velma architecture

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

- Interactive diagram: https://gitdiagram.com/m-wonder/physio-clinic-velma
- Repository: https://github.com/m-wonder/physio-clinic-velma

## Overview

PhysioClinic is a full-stack clinic management system. Patients browse services and doctors, authenticate, choose a doctor and available slot, and book or manage appointments; staff also support walk-ins and treatment records. The React application calls a Django REST API, which provides account, catalog, appointment, and treatment capabilities. Celery handles appointment reminders and notification delivery by email or SMS. The README documents the major capabilities; some backend views and models were not excerpted, so links to those subsystems are limited to documented or indexed evidence.

Main entry points: [`backend/physio_clinic/apps/notifications/tasks.py`](https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/notifications/tasks.py) (Notification delivery), [`frontend/src/pages/BookAppointmentPage.jsx`](https://github.com/m-wonder/physio-clinic-velma/blob/main/frontend/src/pages/BookAppointmentPage.jsx) (Booking flow), [`backend/physio_clinic/urls.py`](https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/urls.py) (Django REST API), [`backend/physio_clinic/apps/appointments/models.py`](https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/appointments/models.py) (Appointment records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Patient Web App"]
  node_web["React routes<br/>[App.jsx]"]
  node_authstate["Session auth<br/>[authStore.js]"]
  node_api["API endpoints<br/>[endpoints.js]"]
  node_bookingui["Booking flow"]
  node_serviceui["Service catalog UI<br/>[ServicesPage.jsx]"]
end

subgraph group_clinic["Clinic API"]
  node_clinicapi["Django REST API<br/>[urls.py]"]
  node_accounts["Accounts and access<br/>[views.py]"]
  node_encryption["Patient-data encryption<br/>[encryption.py]"]
  node_services[("Service catalog<br/>[models.py]")]
  node_doctors[("Doctor profiles<br/>[models.py]")]
  node_appointments[("Appointment records<br/>[models.py]")]
  node_availability["Slot availability<br/>[utils.py]"]
  node_treatments[("Treatment records")]
end

subgraph group_async["Notifications"]
  node_celery["Celery task setup<br/>[celery.py]"]
  node_reminders["Appointment reminders<br/>[tasks.py]"]
  node_notificationtasks["Notification delivery<br/>[tasks.py]"]
  node_notificationlog[("Notification logs<br/>[models.py]")]
end

node_patient(("Patients and staff"))
node_email["Email service"]
node_sms["SMS provider"]

node_patient -->|"uses"| node_web
node_web -->|"checks auth"| node_authstate
node_web -->|"routes to"| node_bookingui
node_bookingui -->|"requests booking"| node_api
node_serviceui -->|"loads services"| node_api
node_api -->|"HTTP requests"| node_clinicapi
node_clinicapi -.->|"routes auth"| node_accounts
node_clinicapi -.->|"routes appointments"| node_appointments
node_clinicapi -.->|"routes services"| node_services
node_accounts -->|"uses"| node_encryption
node_bookingui -->|"lists doctors"| node_doctors
node_bookingui -->|"requests slots"| node_availability
node_bookingui -->|"books appointment"| node_appointments
node_reminders -->|"reads appointments"| node_appointments
node_reminders -->|"queues reminders"| node_notificationtasks
node_notificationtasks -->|"reads appointment"| node_appointments
node_notificationtasks -->|"writes logs"| node_notificationlog
node_notificationtasks -->|"sends email"| node_email
node_notificationtasks -->|"sends SMS"| node_sms
node_celery -.->|"runs tasks"| node_reminders
node_celery -->|"runs tasks"| node_notificationtasks
node_patient -.->|"views records"| node_treatments

click node_web "https://github.com/m-wonder/physio-clinic-velma/blob/main/frontend/src/App.jsx"
click node_authstate "https://github.com/m-wonder/physio-clinic-velma/blob/main/frontend/src/store/authStore.js"
click node_api "https://github.com/m-wonder/physio-clinic-velma/blob/main/frontend/src/api/endpoints.js"
click node_bookingui "https://github.com/m-wonder/physio-clinic-velma/blob/main/frontend/src/pages/BookAppointmentPage.jsx"
click node_serviceui "https://github.com/m-wonder/physio-clinic-velma/blob/main/frontend/src/pages/ServicesPage.jsx"
click node_clinicapi "https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/urls.py"
click node_accounts "https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/accounts/views.py"
click node_encryption "https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/accounts/encryption.py"
click node_services "https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/services/models.py"
click node_doctors "https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/accounts/models.py"
click node_appointments "https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/appointments/models.py"
click node_availability "https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/appointments/utils.py"
click node_treatments "https://github.com/m-wonder/physio-clinic-velma/tree/main/backend/physio_clinic/apps/treatments"
click node_celery "https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/celery.py"
click node_reminders "https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/appointments/tasks.py"
click node_notificationtasks "https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/notifications/tasks.py"
click node_notificationlog "https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/notifications/models.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_web,node_authstate,node_api,node_bookingui,node_serviceui toneBlue
class node_clinicapi,node_accounts,node_encryption,node_services,node_doctors,node_appointments,node_availability,node_treatments toneAmber
class node_celery,node_reminders,node_notificationtasks,node_notificationlog toneMint
class node_patient,node_email,node_sms toneIndigo
```

## Components

### Patient Web App

- [React routes](https://github.com/m-wonder/physio-clinic-velma/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Session auth](https://github.com/m-wonder/physio-clinic-velma/blob/main/frontend/src/store/authStore.js): `frontend/src/store/authStore.js`
- [API endpoints](https://github.com/m-wonder/physio-clinic-velma/blob/main/frontend/src/api/endpoints.js): `frontend/src/api/endpoints.js`
- [Booking flow](https://github.com/m-wonder/physio-clinic-velma/blob/main/frontend/src/pages/BookAppointmentPage.jsx): `frontend/src/pages/BookAppointmentPage.jsx`
- [Service catalog UI](https://github.com/m-wonder/physio-clinic-velma/blob/main/frontend/src/pages/ServicesPage.jsx): `frontend/src/pages/ServicesPage.jsx`

### Clinic API

- [Django REST API](https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/urls.py): `backend/physio_clinic/urls.py`
- [Accounts and access](https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/accounts/views.py): `backend/physio_clinic/apps/accounts/views.py`
- [Patient-data encryption](https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/accounts/encryption.py): `backend/physio_clinic/apps/accounts/encryption.py`
- [Service catalog](https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/services/models.py): `backend/physio_clinic/apps/services/models.py`
- [Doctor profiles](https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/accounts/models.py): `backend/physio_clinic/apps/accounts/models.py`
- [Appointment records](https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/appointments/models.py): `backend/physio_clinic/apps/appointments/models.py`
- [Slot availability](https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/appointments/utils.py): `backend/physio_clinic/apps/appointments/utils.py`
- [Treatment records](https://github.com/m-wonder/physio-clinic-velma/tree/main/backend/physio_clinic/apps/treatments): `backend/physio_clinic/apps/treatments`

### Notifications

- [Celery task setup](https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/celery.py): `backend/physio_clinic/celery.py`
- [Appointment reminders](https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/appointments/tasks.py): `backend/physio_clinic/apps/appointments/tasks.py`
- [Notification delivery](https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/notifications/tasks.py): `backend/physio_clinic/apps/notifications/tasks.py`
- [Notification logs](https://github.com/m-wonder/physio-clinic-velma/blob/main/backend/physio_clinic/apps/notifications/models.py): `backend/physio_clinic/apps/notifications/models.py`

### Other components

- **Patients and staff**
- **Email service**
- **SMS provider**

## Connections

- Patients and staff → React routes: uses (evidence: `frontend/src/App.jsx`)
- React routes → Session auth: checks auth (evidence: `frontend/src/App.jsx`)
- React routes → Booking flow: routes to (evidence: `frontend/src/App.jsx`)
- Booking flow → API endpoints: requests booking (evidence: `frontend/src/api/endpoints.js`)
- Service catalog UI → API endpoints: loads services (evidence: `frontend/src/pages/ServicesPage.jsx`)
- API endpoints → Django REST API: HTTP requests (evidence: `frontend/src/api/endpoints.js`)
- Django REST API → Accounts and access: routes auth
- Django REST API → Appointment records: routes appointments
- Django REST API → Service catalog: routes services
- Accounts and access → Patient-data encryption: uses
- Booking flow → Doctor profiles: lists doctors
- Booking flow → Slot availability: requests slots
- Booking flow → Appointment records: books appointment
- Appointment reminders → Appointment records: reads appointments (evidence: `backend/physio_clinic/apps/appointments/tasks.py`)
- Appointment reminders → Notification delivery: queues reminders (evidence: `backend/physio_clinic/apps/appointments/tasks.py`)
- Notification delivery → Appointment records: reads appointment (evidence: `backend/physio_clinic/apps/notifications/tasks.py`)
- Notification delivery → Notification logs: writes logs (evidence: `backend/physio_clinic/apps/notifications/tasks.py`)
- Notification delivery → Email service: sends email (evidence: `backend/physio_clinic/apps/notifications/tasks.py`)
- Notification delivery → SMS provider: sends SMS (evidence: `backend/physio_clinic/apps/notifications/tasks.py`)
- Celery task setup → Appointment reminders: runs tasks (evidence: `backend/physio_clinic/apps/appointments/tasks.py`)
- Celery task setup → Notification delivery: runs tasks (evidence: `backend/physio_clinic/apps/notifications/tasks.py`)
- Patients and staff → Treatment records: views records (evidence: `README.md`)
