# jiveradev/ipacussystem architecture

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

- Interactive diagram: https://gitdiagram.com/jiveradev/ipacussystem
- Repository: https://github.com/jiveradev/ipacussystem

## Overview

iPawcus is a veterinary clinic and pet-owner EMR and management system. Owners and clinic staff use role-specific dashboards to manage pets and medical records, book services, submit payment proof, and track clinic queues; administrators also manage clinic operations and reports. The React application communicates with PHP API scripts backed by MySQL, with optional Jitsi video consultations and browser push notifications. The tree and excerpts establish the application entry points and selected dispatches; many feature implementations were not sampled, so their internal connections are not asserted.

Main entry points: [`src/App.jsx`](https://github.com/jiveradev/ipacussystem/blob/master/src/App.jsx) (React app), [`php/index.php`](https://github.com/jiveradev/ipacussystem/blob/master/php/index.php) (PHP API router), [`php/db.php`](https://github.com/jiveradev/ipacussystem/blob/master/php/db.php) (Database connection), [`php/online_consultations.php`](https://github.com/jiveradev/ipacussystem/blob/master/php/online_consultations.php) (Online consultations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app_entry["React app<br/>[App.jsx]"]
  node_dashboard_routes["Role dashboards"]
end

subgraph group_care["Pet Care"]
  node_pet_registry["Pet registry<br/>[add_pet.php]"]
  node_pet_linking["Ownership linking<br/>[link_pet.php]"]
  node_clinical_records["Medical records"]
  node_consent["Consent documents"]
  node_booking["Bookings<br/>[add_booking.php]"]
  node_availability["Availability"]
  node_video_consults["Online consultations"]
end

subgraph group_clinic["Clinic Operations"]
  node_queue["Queue tracking<br/>[add_to_queue.php]"]
  node_boarding["Boarding"]
  node_inventory["Inventory<br/>[inventory.php]"]
  node_reports["Reports"]
end

subgraph group_platform["Backend Platform"]
  node_api_router["PHP API router<br/>[index.php]"]
  node_db_connection["Database connection<br/>[db.php]"]
  node_db_config["Database config<br/>[config.php]"]
end

subgraph group_shared["Shared Services"]
  node_api_client["API client<br/>[apiClient.js]"]
  node_error_handling["Error presentation"]
  node_toast["Toast feedback<br/>[toast.jsx]"]
  node_push_service["Push notifications"]
  node_pwa["PWA setup<br/>[pwaConfig.js]"]
  node_auto_refresh["Auto refresh<br/>[useAutoRefresh.js]"]
end

node_owner(("Pet owners"))
node_staff(("Clinic staff"))
node_jitsi["Jitsi service"]
node_mysql[("MySQL")]

node_owner -->|"uses"| node_app_entry
node_staff -->|"uses"| node_app_entry
node_app_entry -->|"routes by role"| node_dashboard_routes
node_app_entry -->|"checks server"| node_api_client
node_app_entry -->|"shows feedback"| node_toast
node_api_client -->|"formats errors"| node_error_handling
node_app_entry -.->|"requests API"| node_api_router
node_api_router -->|"loads config"| node_db_config
node_db_connection -->|"loads config"| node_db_config
node_db_connection -.->|"connects"| node_mysql
node_api_router -->|"dispatches pet requests"| node_pet_registry
node_api_router -->|"dispatches linking"| node_pet_linking
node_staff -->|"registers pets"| node_pet_registry
node_owner -->|"links ownership"| node_pet_linking
node_owner -->|"views history"| node_clinical_records
node_owner -->|"books services"| node_booking
node_owner -.->|"checks slots"| node_availability
node_staff -->|"tracks visits"| node_queue
node_staff -.->|"manages boarding"| node_boarding
node_staff -.->|"manages stock"| node_inventory
node_staff -.->|"reviews reports"| node_reports
node_owner -.->|"submits documents"| node_consent
node_owner -.->|"joins consultation"| node_video_consults
node_video_consults -.->|"uses meetings"| node_jitsi
node_api_router -.->|"serves push API"| node_push_service
node_push_service -->|"registers worker"| node_pwa
node_app_entry -.->|"refreshes views"| node_auto_refresh

click node_app_entry "https://github.com/jiveradev/ipacussystem/blob/master/src/App.jsx"
click node_dashboard_routes "https://github.com/jiveradev/ipacussystem/blob/master/src/components/dashboardRouter.jsx"
click node_pet_registry "https://github.com/jiveradev/ipacussystem/blob/master/php/add_pet.php"
click node_pet_linking "https://github.com/jiveradev/ipacussystem/blob/master/php/link_pet.php"
click node_clinical_records "https://github.com/jiveradev/ipacussystem/blob/master/php/pet_medical_records.php"
click node_consent "https://github.com/jiveradev/ipacussystem/blob/master/src/services/consentDocumentPdf.js"
click node_booking "https://github.com/jiveradev/ipacussystem/blob/master/php/add_booking.php"
click node_availability "https://github.com/jiveradev/ipacussystem/blob/master/php/booking_availability.php"
click node_queue "https://github.com/jiveradev/ipacussystem/blob/master/php/add_to_queue.php"
click node_boarding "https://github.com/jiveradev/ipacussystem/blob/master/php/boarding_management.php"
click node_inventory "https://github.com/jiveradev/ipacussystem/blob/master/php/inventory.php"
click node_reports "https://github.com/jiveradev/ipacussystem/blob/master/php/reports_generate.php"
click node_video_consults "https://github.com/jiveradev/ipacussystem/blob/master/php/online_consultations.php"
click node_api_router "https://github.com/jiveradev/ipacussystem/blob/master/php/index.php"
click node_db_connection "https://github.com/jiveradev/ipacussystem/blob/master/php/db.php"
click node_db_config "https://github.com/jiveradev/ipacussystem/blob/master/php/config.php"
click node_api_client "https://github.com/jiveradev/ipacussystem/blob/master/src/services/apiClient.js"
click node_error_handling "https://github.com/jiveradev/ipacussystem/blob/master/src/lib/errorPresentation.js"
click node_toast "https://github.com/jiveradev/ipacussystem/blob/master/src/reusecomponent/toast.jsx"
click node_push_service "https://github.com/jiveradev/ipacussystem/blob/master/src/services/pushNotificationService.js"
click node_pwa "https://github.com/jiveradev/ipacussystem/blob/master/src/pwa/pwaConfig.js"
click node_auto_refresh "https://github.com/jiveradev/ipacussystem/blob/master/src/hooks/useAutoRefresh.js"

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_entry,node_dashboard_routes toneBlue
class node_pet_registry,node_pet_linking,node_clinical_records,node_consent,node_booking,node_availability,node_video_consults,node_mysql toneAmber
class node_queue,node_boarding,node_inventory,node_reports toneMint
class node_api_router,node_db_connection,node_db_config toneRose
class node_api_client,node_error_handling,node_toast,node_push_service,node_pwa,node_auto_refresh,node_owner,node_staff,node_jitsi toneIndigo
```

## Components

### Application

- [React app](https://github.com/jiveradev/ipacussystem/blob/master/src/App.jsx): `src/App.jsx`
- [Role dashboards](https://github.com/jiveradev/ipacussystem/blob/master/src/components/dashboardRouter.jsx): `src/components/dashboardRouter.jsx`

### Pet Care

- [Pet registry](https://github.com/jiveradev/ipacussystem/blob/master/php/add_pet.php): `php/add_pet.php`
- [Ownership linking](https://github.com/jiveradev/ipacussystem/blob/master/php/link_pet.php): `php/link_pet.php`
- [Medical records](https://github.com/jiveradev/ipacussystem/blob/master/php/pet_medical_records.php): `php/pet_medical_records.php`
- [Consent documents](https://github.com/jiveradev/ipacussystem/blob/master/src/services/consentDocumentPdf.js): `src/services/consentDocumentPdf.js`
- [Bookings](https://github.com/jiveradev/ipacussystem/blob/master/php/add_booking.php): `php/add_booking.php`
- [Availability](https://github.com/jiveradev/ipacussystem/blob/master/php/booking_availability.php): `php/booking_availability.php`
- [Online consultations](https://github.com/jiveradev/ipacussystem/blob/master/php/online_consultations.php): `php/online_consultations.php`

### Clinic Operations

- [Queue tracking](https://github.com/jiveradev/ipacussystem/blob/master/php/add_to_queue.php): `php/add_to_queue.php`
- [Boarding](https://github.com/jiveradev/ipacussystem/blob/master/php/boarding_management.php): `php/boarding_management.php`
- [Inventory](https://github.com/jiveradev/ipacussystem/blob/master/php/inventory.php): `php/inventory.php`
- [Reports](https://github.com/jiveradev/ipacussystem/blob/master/php/reports_generate.php): `php/reports_generate.php`

### Backend Platform

- [PHP API router](https://github.com/jiveradev/ipacussystem/blob/master/php/index.php): `php/index.php`
- [Database connection](https://github.com/jiveradev/ipacussystem/blob/master/php/db.php): `php/db.php`
- [Database config](https://github.com/jiveradev/ipacussystem/blob/master/php/config.php): `php/config.php`

### Shared Services

- [API client](https://github.com/jiveradev/ipacussystem/blob/master/src/services/apiClient.js): `src/services/apiClient.js`
- [Error presentation](https://github.com/jiveradev/ipacussystem/blob/master/src/lib/errorPresentation.js): `src/lib/errorPresentation.js`
- [Toast feedback](https://github.com/jiveradev/ipacussystem/blob/master/src/reusecomponent/toast.jsx): `src/reusecomponent/toast.jsx`
- [Push notifications](https://github.com/jiveradev/ipacussystem/blob/master/src/services/pushNotificationService.js): `src/services/pushNotificationService.js`
- [PWA setup](https://github.com/jiveradev/ipacussystem/blob/master/src/pwa/pwaConfig.js): `src/pwa/pwaConfig.js`
- [Auto refresh](https://github.com/jiveradev/ipacussystem/blob/master/src/hooks/useAutoRefresh.js): `src/hooks/useAutoRefresh.js`

### Other components

- **Pet owners**
- **Clinic staff**
- **Jitsi service**
- **MySQL**

## Connections

- Pet owners → React app: uses (evidence: `README.md`)
- Clinic staff → React app: uses (evidence: `README.md`)
- React app → Role dashboards: routes by role (evidence: `src/App.jsx`)
- React app → API client: checks server (evidence: `src/App.jsx`)
- React app → Toast feedback: shows feedback (evidence: `src/App.jsx`)
- API client → Error presentation: formats errors (evidence: `src/services/apiClient.js`)
- React app → PHP API router: requests API
- PHP API router → Database config: loads config (evidence: `php/index.php`)
- Database connection → Database config: loads config (evidence: `php/db.php`)
- Database connection → MySQL: connects
- PHP API router → Pet registry: dispatches pet requests (evidence: `php/index.php`)
- PHP API router → Ownership linking: dispatches linking (evidence: `php/index.php`)
- Clinic staff → Pet registry: registers pets (evidence: `README.md`)
- Pet owners → Ownership linking: links ownership (evidence: `README.md`)
- Pet owners → Medical records: views history (evidence: `README.md`)
- Pet owners → Bookings: books services (evidence: `README.md`)
- Pet owners → Availability: checks slots
- Clinic staff → Queue tracking: tracks visits (evidence: `README.md`)
- Clinic staff → Boarding: manages boarding
- Clinic staff → Inventory: manages stock
- Clinic staff → Reports: reviews reports
- Pet owners → Consent documents: submits documents
- Pet owners → Online consultations: joins consultation
- Online consultations → Jitsi service: uses meetings
- PHP API router → Push notifications: serves push API
- Push notifications → PWA setup: registers worker (evidence: `src/services/pushNotificationService.js`)
- React app → Auto refresh: refreshes views
