# pundavels/pundavels-agape-physical-therapy-clinic-main architecture

> Architecture diagram of the GitHub repository pundavels/pundavels-agape-physical-therapy-clinic-main, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pundavels/pundavels-agape-physical-therapy-clinic-main
- Repository: https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main

## Overview

AgapeCare is a multi-branch physical therapy clinic management system. Staff use branch-scoped workspaces to manage patients, scheduling, clinical documentation, inventory and financial operations; patients and the public can request bookings and access a client portal. The graph emphasizes those domain stages and the service layer behind them. Relationships are limited to README statements and SOURCE INDEX references; unsampled modules are represented only where documented, so some internal connections are intentionally omitted.

Main entry points: [`app/blueprints/clinical/routes.py`](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/clinical/routes.py) (Clinical records), [`app/models`](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/tree/main/app/models) (Clinic database), [`app/blueprints/admin/routes.py`](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/admin/routes.py) (Administration), [`app/blueprints/appointments/routes.py`](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/appointments/routes.py) (Appointment workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Identity and access"]
  node_auth["Authentication<br/>[auth_service.py]"]
  node_access_control["Branch permissions<br/>[policies.py]"]
  node_audit["Audit records<br/>[audit_service.py]"]
end

subgraph group_operations["Clinic operations"]
  node_admin["Administration<br/>[routes.py]"]
  node_patient_registry["Patient registry<br/>[routes.py]"]
  node_patient360["Patient 360<br/>[patient360.py]"]
  node_reception["Front desk<br/>[front_desk.py]"]
  node_appointments["Appointment workflows<br/>[routes.py]"]
  node_availability["Availability engine<br/>[availability.py]"]
  node_sms["SMS reminders<br/>[service.py]"]
end

subgraph group_care["Patient care"]
  node_clinical_routes["Clinical records<br/>[routes.py]"]
  node_clinical_service["Clinical service<br/>[clinical.py]"]
end

subgraph group_finance["Finance and stock"]
  node_billing_routes["Billing workspace<br/>[routes.py]"]
  node_billing_service["Invoice service<br/>[billing.py]"]
  node_cashier["Cashier and POS<br/>[routes.py]"]
  node_inventory["Inventory<br/>[routes.py]"]
  node_reports["Reports<br/>[reports.py]"]
end

subgraph group_public["Public and portal"]
  node_patient_portal["Patient portal<br/>[routes.py]"]
  node_public_site["Public website<br/>[routes.py]"]
end

node_staff(("Clinic staff"))
node_patients_actor(("Patients"))
node_public_visitor(("Public visitors"))
node_clinic_data[("Clinic database")]

node_staff -->|"signs in"| node_auth
node_patients_actor -->|"requests bookings"| node_patient_portal
node_public_visitor -->|"views services"| node_public_site
node_public_visitor -->|"starts booking"| node_patient_portal
node_staff -->|"manages clinic"| node_admin
node_staff -->|"finds patients"| node_patient_registry
node_patient_registry -->|"opens overview"| node_patient360
node_staff -->|"handles front desk"| node_reception
node_staff -->|"books appointments"| node_appointments
node_appointments -->|"checks slots"| node_availability
node_patient_portal -->|"checks slots"| node_availability
node_staff -->|"documents care"| node_clinical_routes
node_clinical_routes -->|"records clinical data"| node_clinical_service
node_patients_actor -->|"views own exercises"| node_clinical_routes
node_staff -->|"manages invoices"| node_billing_routes
node_billing_routes -->|"issues invoices"| node_billing_service
node_staff -->|"takes payments"| node_cashier
node_cashier -->|"records sales"| node_billing_service
node_staff -->|"manages stock"| node_inventory
node_staff -->|"reviews reports"| node_reports
node_staff -.->|"configures reminders"| node_sms
node_admin -->|"enforces access"| node_access_control
node_appointments -->|"reads and writes"| node_clinic_data
node_clinical_routes -->|"reads and writes"| node_clinic_data
node_billing_routes -->|"reads and writes"| node_clinic_data
node_inventory -->|"reads and writes"| node_clinic_data
node_admin -->|"records changes"| node_audit
node_clinical_routes -.->|"audits access"| node_audit

click node_auth "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/services/auth_service.py"
click node_access_control "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/auth/policies.py"
click node_admin "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/admin/routes.py"
click node_patient_registry "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/patients/routes.py"
click node_patient360 "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/services/patient360.py"
click node_reception "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/services/front_desk.py"
click node_appointments "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/appointments/routes.py"
click node_availability "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/services/availability.py"
click node_clinical_routes "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/clinical/routes.py"
click node_clinical_service "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/services/clinical.py"
click node_patient_portal "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/patient/routes.py"
click node_public_site "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/public/routes.py"
click node_billing_routes "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/billing/routes.py"
click node_billing_service "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/services/billing.py"
click node_cashier "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/pos/routes.py"
click node_inventory "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/inventory/routes.py"
click node_reports "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/services/reports.py"
click node_sms "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/sms_reminders/service.py"
click node_audit "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/services/audit_service.py"
click node_clinic_data "https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/tree/main/app/models"

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_auth,node_access_control,node_audit toneBlue
class node_admin,node_patient_registry,node_patient360,node_reception,node_appointments,node_availability,node_sms,node_clinic_data toneAmber
class node_clinical_routes,node_clinical_service toneMint
class node_billing_routes,node_billing_service,node_cashier,node_inventory,node_reports toneRose
class node_patient_portal,node_public_site,node_staff,node_patients_actor,node_public_visitor toneIndigo
```

## Components

### Identity and access

- [Authentication](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/services/auth_service.py): `app/services/auth_service.py`
- [Branch permissions](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/auth/policies.py): `app/auth/policies.py`
- [Audit records](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/services/audit_service.py): `app/services/audit_service.py`

### Clinic operations

- [Administration](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/admin/routes.py): `app/blueprints/admin/routes.py`
- [Patient registry](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/patients/routes.py): `app/blueprints/patients/routes.py`
- [Patient 360](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/services/patient360.py): `app/services/patient360.py`
- [Front desk](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/services/front_desk.py): `app/services/front_desk.py`
- [Appointment workflows](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/appointments/routes.py): `app/blueprints/appointments/routes.py`
- [Availability engine](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/services/availability.py): `app/services/availability.py`
- [SMS reminders](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/sms_reminders/service.py): `app/sms_reminders/service.py`

### Patient care

- [Clinical records](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/clinical/routes.py): `app/blueprints/clinical/routes.py`
- [Clinical service](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/services/clinical.py): `app/services/clinical.py`

### Finance and stock

- [Billing workspace](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/billing/routes.py): `app/blueprints/billing/routes.py`
- [Invoice service](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/services/billing.py): `app/services/billing.py`
- [Cashier and POS](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/pos/routes.py): `app/blueprints/pos/routes.py`
- [Inventory](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/inventory/routes.py): `app/blueprints/inventory/routes.py`
- [Reports](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/services/reports.py): `app/services/reports.py`

### Public and portal

- [Patient portal](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/patient/routes.py): `app/blueprints/patient/routes.py`
- [Public website](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/blob/main/app/blueprints/public/routes.py): `app/blueprints/public/routes.py`

### Other components

- **Clinic staff**
- **Patients**
- **Public visitors**
- [Clinic database](https://github.com/pundavels/pundavels-agape-physical-therapy-clinic-main/tree/main/app/models): `app/models`

## Connections

- Clinic staff → Authentication: signs in
- Patients → Patient portal: requests bookings
- Public visitors → Public website: views services
- Public visitors → Patient portal: starts booking
- Clinic staff → Administration: manages clinic
- Clinic staff → Patient registry: finds patients
- Patient registry → Patient 360: opens overview (evidence: `app/blueprints/patients/routes.py`)
- Clinic staff → Front desk: handles front desk
- Clinic staff → Appointment workflows: books appointments
- Appointment workflows → Availability engine: checks slots (evidence: `app/blueprints/appointments/routes.py`)
- Patient portal → Availability engine: checks slots (evidence: `app/blueprints/patient/routes.py`)
- Clinic staff → Clinical records: documents care
- Clinical records → Clinical service: records clinical data (evidence: `app/blueprints/clinical/routes.py`)
- Patients → Clinical records: views own exercises
- Clinic staff → Billing workspace: manages invoices
- Billing workspace → Invoice service: issues invoices (evidence: `app/blueprints/billing/routes.py`)
- Clinic staff → Cashier and POS: takes payments
- Cashier and POS → Invoice service: records sales (evidence: `app/blueprints/pos/routes.py`)
- Clinic staff → Inventory: manages stock
- Clinic staff → Reports: reviews reports
- Clinic staff → SMS reminders: configures reminders
- Administration → Branch permissions: enforces access (evidence: `app/blueprints/admin/routes.py`)
- Appointment workflows → Clinic database: reads and writes (evidence: `app/blueprints/appointments/routes.py`)
- Clinical records → Clinic database: reads and writes (evidence: `app/blueprints/clinical/routes.py`)
- Billing workspace → Clinic database: reads and writes (evidence: `app/blueprints/billing/routes.py`)
- Inventory → Clinic database: reads and writes (evidence: `app/blueprints/inventory/routes.py`)
- Administration → Audit records: records changes (evidence: `app/blueprints/admin/routes.py`)
- Clinical records → Audit records: audits access
