# ardhikaxx/klinik-hewan-web architecture

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

- Interactive diagram: https://gitdiagram.com/ardhikaxx/klinik-hewan-web
- Repository: https://github.com/ardhikaxx/klinik-hewan-web

## Overview

This is a Laravel web application for day-to-day veterinary clinic operations. Staff register owners, pets, and visits; a queue assigns visits to doctors, who record examinations and prescriptions; cashier staff settle invoices, while inventory, reporting, and audit functions support clinic operations. The README documents additional capabilities not represented by sampled controller code. Edges are limited to relationships shown in excerpts or explicitly described in the README; unsampled feature wiring is left unspecified.

Main entry points: [`app/Http/Controllers/CashierController.php`](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Http/Controllers/CashierController.php) (Cashier POS), [`app/Http/Controllers/ExaminationController.php`](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Http/Controllers/ExaminationController.php) (Examination), [`app/Models/Visit.php`](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Models/Visit.php) (Visit queue), [`app/Http/Controllers/ReportController.php`](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Http/Controllers/ReportController.php) (Operational reports)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_care["Patient care"]
  node_owners["Owners<br/>[Owner.php]"]
  node_pets["Pet records<br/>[Pet.php]"]
  node_visits[("Visit queue<br/>[Visit.php]")]
  node_queue["Queue service<br/>[QueueService.php]"]
  node_examination["Examination"]
  node_medical[("Medical records<br/>[MedicalRecord.php]")]
  node_prescription[("Prescriptions<br/>[Prescription.php]")]
  node_visitservices[("Visit services<br/>[VisitService.php]")]
end

subgraph group_billing["Billing and stock"]
  node_cashier["Cashier POS"]
  node_billingservice["Billing service<br/>[BillingService.php]"]
  node_invoices[("Invoices<br/>[Invoice.php]")]
  node_inventory["Inventory management"]
  node_medications[("Medication catalog<br/>[Medication.php]")]
  node_stock["Stock service<br/>[StockService.php]"]
end

subgraph group_operations["Clinic operations"]
  node_services[("Service catalog<br/>[Service.php]")]
  node_reports["Operational reports"]
  node_dashboard["Role dashboards"]
end

subgraph group_platform["Access and records"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_access["Role access controls<br/>[RoleMiddleware.php]"]
  node_audit["Audit logging<br/>[AuditService.php]"]
end

node_staff(("Clinic staff"))
node_database[("Relational database")]

node_staff -.->|"maintains"| node_owners
node_staff -.->|"maintains"| node_pets
node_staff -.->|"registers"| node_visits
node_visits -.->|"assigns numbers"| node_queue
node_staff -.->|"examines patients"| node_examination
node_examination -->|"records findings"| node_medical
node_examination -.->|"creates prescriptions"| node_prescription
node_examination -->|"synchronizes charges"| node_billingservice
node_cashier -->|"recalculates totals"| node_billingservice
node_cashier -->|"records payment"| node_invoices
node_cashier -->|"advances visit"| node_queue
node_cashier -->|"logs payment"| node_audit
node_staff -.->|"settles bills"| node_cashier
node_staff -.->|"manages stock"| node_inventory
node_inventory -->|"updates stock"| node_stock
node_staff -.->|"reviews operations"| node_reports
node_staff -.->|"signs in"| node_auth
node_auth -.->|"checks roles"| node_access
node_dashboard -.->|"shows stock alerts"| node_medications
node_reports -->|"summarizes transactions"| node_invoices
node_reports -->|"summarizes visits"| node_visits
node_visits -.->|"persists visits"| node_database
node_medical -.->|"persists records"| node_database
node_invoices -.->|"persists billing"| node_database
node_medications -.->|"persists stock"| node_database

click node_owners "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Models/Owner.php"
click node_pets "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Models/Pet.php"
click node_visits "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Models/Visit.php"
click node_queue "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Services/QueueService.php"
click node_examination "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Http/Controllers/ExaminationController.php"
click node_medical "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Models/MedicalRecord.php"
click node_prescription "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Models/Prescription.php"
click node_services "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Models/Service.php"
click node_visitservices "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Models/VisitService.php"
click node_cashier "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Http/Controllers/CashierController.php"
click node_billingservice "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Services/BillingService.php"
click node_invoices "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Models/Invoice.php"
click node_inventory "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Http/Controllers/InventoryController.php"
click node_medications "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Models/Medication.php"
click node_stock "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Services/StockService.php"
click node_reports "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Http/Controllers/ReportController.php"
click node_dashboard "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Http/Controllers/DashboardController.php"
click node_auth "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Http/Controllers/AuthController.php"
click node_access "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Http/Middleware/RoleMiddleware.php"
click node_audit "https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Services/AuditService.php"

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_owners,node_pets,node_visits,node_queue,node_examination,node_medical,node_prescription,node_visitservices toneBlue
class node_cashier,node_billingservice,node_invoices,node_inventory,node_medications,node_stock,node_database toneAmber
class node_services,node_reports,node_dashboard toneMint
class node_auth,node_access,node_audit toneRose
class node_staff toneIndigo
```

## Components

### Patient care

- [Owners](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Models/Owner.php): `app/Models/Owner.php`
- [Pet records](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Models/Pet.php): `app/Models/Pet.php`
- [Visit queue](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Models/Visit.php): `app/Models/Visit.php`
- [Queue service](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Services/QueueService.php): `app/Services/QueueService.php`
- [Examination](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Http/Controllers/ExaminationController.php): `app/Http/Controllers/ExaminationController.php`
- [Medical records](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Models/MedicalRecord.php): `app/Models/MedicalRecord.php`
- [Prescriptions](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Models/Prescription.php): `app/Models/Prescription.php`
- [Visit services](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Models/VisitService.php): `app/Models/VisitService.php`

### Billing and stock

- [Cashier POS](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Http/Controllers/CashierController.php): `app/Http/Controllers/CashierController.php`
- [Billing service](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Services/BillingService.php): `app/Services/BillingService.php`
- [Invoices](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Models/Invoice.php): `app/Models/Invoice.php`
- [Inventory management](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Http/Controllers/InventoryController.php): `app/Http/Controllers/InventoryController.php`
- [Medication catalog](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Models/Medication.php): `app/Models/Medication.php`
- [Stock service](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Services/StockService.php): `app/Services/StockService.php`

### Clinic operations

- [Service catalog](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Models/Service.php): `app/Models/Service.php`
- [Operational reports](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Http/Controllers/ReportController.php): `app/Http/Controllers/ReportController.php`
- [Role dashboards](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Http/Controllers/DashboardController.php): `app/Http/Controllers/DashboardController.php`

### Access and records

- [Authentication](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Http/Controllers/AuthController.php): `app/Http/Controllers/AuthController.php`
- [Role access controls](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Http/Middleware/RoleMiddleware.php): `app/Http/Middleware/RoleMiddleware.php`
- [Audit logging](https://github.com/ardhikaxx/klinik-hewan-web/blob/main/app/Services/AuditService.php): `app/Services/AuditService.php`

### Other components

- **Clinic staff**
- **Relational database**

## Connections

- Clinic staff → Owners: maintains
- Clinic staff → Pet records: maintains
- Clinic staff → Visit queue: registers
- Visit queue → Queue service: assigns numbers (evidence: `app/Services/QueueService.php`)
- Clinic staff → Examination: examines patients
- Examination → Medical records: records findings (evidence: `app/Http/Controllers/ExaminationController.php`)
- Examination → Prescriptions: creates prescriptions (evidence: `app/Http/Controllers/ExaminationController.php`)
- Examination → Billing service: synchronizes charges (evidence: `app/Http/Controllers/ExaminationController.php`)
- Cashier POS → Billing service: recalculates totals (evidence: `app/Http/Controllers/CashierController.php`)
- Cashier POS → Invoices: records payment (evidence: `app/Http/Controllers/CashierController.php`)
- Cashier POS → Queue service: advances visit (evidence: `app/Http/Controllers/CashierController.php`)
- Cashier POS → Audit logging: logs payment (evidence: `app/Http/Controllers/CashierController.php`)
- Clinic staff → Cashier POS: settles bills
- Clinic staff → Inventory management: manages stock
- Inventory management → Stock service: updates stock (evidence: `app/Http/Controllers/InventoryController.php`)
- Clinic staff → Operational reports: reviews operations
- Clinic staff → Authentication: signs in
- Authentication → Role access controls: checks roles
- Role dashboards → Medication catalog: shows stock alerts
- Operational reports → Invoices: summarizes transactions (evidence: `app/Http/Controllers/ReportController.php`)
- Operational reports → Visit queue: summarizes visits (evidence: `app/Http/Controllers/ReportController.php`)
- Visit queue → Relational database: persists visits
- Medical records → Relational database: persists records
- Invoices → Relational database: persists billing
- Medication catalog → Relational database: persists stock
