# tfsephyy/petfave_group architecture

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

- Interactive diagram: https://gitdiagram.com/tfsephyy/petfave_group
- Repository: https://github.com/tfsephyy/petfave_group

## Overview

PetFave is a clinic and pet-parent portal: users sign in to a role-aware workspace, then manage pets, guardians, appointments, clinical records, inventory, staff, and settings. The React frontend routes workspace pages and the Laravel backend exposes API controllers for those domains. Clinical encounters can issue stock, while backend services record audit events. The README is empty, so capabilities are inferred from the source index and sampled code; several frontend-to-API and unsampled controller relationships remain unverified.

Main entry points: [`Group-System/routes/web.php`](https://github.com/tfsephyy/petfave_group/blob/main/Group-System/routes/web.php) (API route dispatch), [`Front/src/App.jsx`](https://github.com/tfsephyy/petfave_group/blob/main/Front/src/App.jsx) (Workspace routing), [`Group-System/app/Services/Audit.php`](https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Services/Audit.php) (Audit trail), [`Group-System/app/Http/Controllers/AnimalController.php`](https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Http/Controllers/AnimalController.php) (Pet endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web workspace"]
  node_app["Workspace routing<br/>[App.jsx]"]
  node_session["Session context<br/>[context.jsx]"]
  node_api["API client<br/>[api.js]"]
  node_auth_ui["Sign-in flows<br/>[Auth.jsx]"]
  node_animal_ui["Pet records UI<br/>[Animals.jsx]"]
  node_booking_ui["Appointments UI<br/>[Appointments.jsx]"]
  node_other_pages["Other workspace pages"]
end

subgraph group_backend["API and access"]
  node_api_routes["API route dispatch<br/>[web.php]"]
  node_auth["Account access<br/>[AuthController.php]"]
  node_audit["Audit trail<br/>[Audit.php]"]
end

subgraph group_care["Patient care"]
  node_animal_controller["Pet endpoints"]
  node_booking_controller["Booking endpoints"]
  node_clinical["Clinical records"]
  node_animal_model["Pet domain model<br/>[Animal.php]"]
  node_guardian_controller["Guardian endpoints"]
  node_guardian_model["Guardian model<br/>[Guardian.php]"]
  node_booking_service["Booking scheduling<br/>[BookingService.php]"]
end

subgraph group_operations["Clinic operations"]
  node_inventory["Inventory endpoints"]
  node_stock_service["Stock movements<br/>[StockService.php]"]
  node_stock_models["Stock records<br/>[StockProduct.php]"]
  node_employees["Staff accounts"]
  node_dashboard["Clinic overview"]
  node_settings["Account settings"]
end

node_browser(("Browser user"))

node_browser -->|"uses"| node_app
node_app -->|"provides session"| node_session
node_app -->|"routes to"| node_auth_ui
node_app -->|"routes to"| node_animal_ui
node_app -->|"routes to"| node_booking_ui
node_app -->|"routes to"| node_other_pages
node_app -->|"loads resources"| node_api
node_app -.->|"sends API requests"| node_api_routes
node_api_routes -->|"dispatches"| node_auth
node_api_routes -->|"dispatches"| node_animal_controller
node_api_routes -->|"dispatches"| node_booking_controller
node_api_routes -->|"dispatches"| node_clinical
node_api_routes -->|"dispatches"| node_guardian_controller
node_api_routes -->|"dispatches"| node_inventory
node_api_routes -->|"dispatches"| node_employees
node_api_routes -->|"dispatches"| node_dashboard
node_api_routes -->|"dispatches"| node_settings
node_auth -->|"creates guardian"| node_guardian_model
node_animal_controller -->|"reads and writes"| node_animal_model
node_animal_controller -->|"loads guardian data"| node_guardian_model
node_clinical -->|"records care for"| node_animal_model
node_clinical -->|"issues supplies"| node_stock_service
node_inventory -->|"moves stock"| node_stock_service
node_stock_service -->|"updates stock"| node_stock_models
node_booking_controller -.->|"delegates booking"| node_booking_service
node_animal_controller -->|"records events"| node_audit
node_auth -->|"records events"| node_audit
node_clinical -->|"records events"| node_audit
node_inventory -->|"records events"| node_audit
node_stock_service -->|"records events"| node_audit

click node_app "https://github.com/tfsephyy/petfave_group/blob/main/Front/src/App.jsx"
click node_session "https://github.com/tfsephyy/petfave_group/blob/main/Front/src/lib/context.jsx"
click node_api "https://github.com/tfsephyy/petfave_group/blob/main/Front/src/lib/api.js"
click node_auth_ui "https://github.com/tfsephyy/petfave_group/blob/main/Front/src/pages/Auth.jsx"
click node_animal_ui "https://github.com/tfsephyy/petfave_group/blob/main/Front/src/pages/Animals.jsx"
click node_booking_ui "https://github.com/tfsephyy/petfave_group/blob/main/Front/src/pages/Appointments.jsx"
click node_other_pages "https://github.com/tfsephyy/petfave_group/tree/main/Front/src/pages"
click node_api_routes "https://github.com/tfsephyy/petfave_group/blob/main/Group-System/routes/web.php"
click node_auth "https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Http/Controllers/AuthController.php"
click node_animal_controller "https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Http/Controllers/AnimalController.php"
click node_booking_controller "https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Http/Controllers/BookingController.php"
click node_clinical "https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Http/Controllers/ClinicalController.php"
click node_animal_model "https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Models/Animal.php"
click node_guardian_controller "https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Http/Controllers/GuardianController.php"
click node_guardian_model "https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Models/Guardian.php"
click node_booking_service "https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Services/BookingService.php"
click node_inventory "https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Http/Controllers/InventoryController.php"
click node_stock_service "https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Services/StockService.php"
click node_stock_models "https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Models/StockProduct.php"
click node_employees "https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Http/Controllers/EmployeeController.php"
click node_dashboard "https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Http/Controllers/DashboardController.php"
click node_settings "https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Http/Controllers/SettingsController.php"
click node_audit "https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Services/Audit.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_app,node_session,node_api,node_auth_ui,node_animal_ui,node_booking_ui,node_other_pages,node_browser toneBlue
class node_api_routes,node_auth,node_audit toneAmber
class node_animal_controller,node_booking_controller,node_clinical,node_animal_model,node_guardian_controller,node_guardian_model,node_booking_service toneMint
class node_inventory,node_stock_service,node_stock_models,node_employees,node_dashboard,node_settings toneRose
```

## Components

### Web workspace

- [Workspace routing](https://github.com/tfsephyy/petfave_group/blob/main/Front/src/App.jsx): `Front/src/App.jsx`
- [Session context](https://github.com/tfsephyy/petfave_group/blob/main/Front/src/lib/context.jsx): `Front/src/lib/context.jsx`
- [API client](https://github.com/tfsephyy/petfave_group/blob/main/Front/src/lib/api.js): `Front/src/lib/api.js`
- [Sign-in flows](https://github.com/tfsephyy/petfave_group/blob/main/Front/src/pages/Auth.jsx): `Front/src/pages/Auth.jsx`
- [Pet records UI](https://github.com/tfsephyy/petfave_group/blob/main/Front/src/pages/Animals.jsx): `Front/src/pages/Animals.jsx`
- [Appointments UI](https://github.com/tfsephyy/petfave_group/blob/main/Front/src/pages/Appointments.jsx): `Front/src/pages/Appointments.jsx`
- [Other workspace pages](https://github.com/tfsephyy/petfave_group/tree/main/Front/src/pages): `Front/src/pages`

### API and access

- [API route dispatch](https://github.com/tfsephyy/petfave_group/blob/main/Group-System/routes/web.php): `Group-System/routes/web.php`
- [Account access](https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Http/Controllers/AuthController.php): `Group-System/app/Http/Controllers/AuthController.php`
- [Audit trail](https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Services/Audit.php): `Group-System/app/Services/Audit.php`

### Patient care

- [Pet endpoints](https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Http/Controllers/AnimalController.php): `Group-System/app/Http/Controllers/AnimalController.php`
- [Booking endpoints](https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Http/Controllers/BookingController.php): `Group-System/app/Http/Controllers/BookingController.php`
- [Clinical records](https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Http/Controllers/ClinicalController.php): `Group-System/app/Http/Controllers/ClinicalController.php`
- [Pet domain model](https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Models/Animal.php): `Group-System/app/Models/Animal.php`
- [Guardian endpoints](https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Http/Controllers/GuardianController.php): `Group-System/app/Http/Controllers/GuardianController.php`
- [Guardian model](https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Models/Guardian.php): `Group-System/app/Models/Guardian.php`
- [Booking scheduling](https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Services/BookingService.php): `Group-System/app/Services/BookingService.php`

### Clinic operations

- [Inventory endpoints](https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Http/Controllers/InventoryController.php): `Group-System/app/Http/Controllers/InventoryController.php`
- [Stock movements](https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Services/StockService.php): `Group-System/app/Services/StockService.php`
- [Stock records](https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Models/StockProduct.php): `Group-System/app/Models/StockProduct.php`
- [Staff accounts](https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Http/Controllers/EmployeeController.php): `Group-System/app/Http/Controllers/EmployeeController.php`
- [Clinic overview](https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Http/Controllers/DashboardController.php): `Group-System/app/Http/Controllers/DashboardController.php`
- [Account settings](https://github.com/tfsephyy/petfave_group/blob/main/Group-System/app/Http/Controllers/SettingsController.php): `Group-System/app/Http/Controllers/SettingsController.php`

### Other components

- **Browser user**

## Connections

- Browser user → Workspace routing: uses (evidence: `Front/src/App.jsx`)
- Workspace routing → Session context: provides session (evidence: `Front/src/App.jsx`)
- Workspace routing → Sign-in flows: routes to (evidence: `Front/src/App.jsx`)
- Workspace routing → Pet records UI: routes to (evidence: `Front/src/App.jsx`)
- Workspace routing → Appointments UI: routes to (evidence: `Front/src/App.jsx`)
- Workspace routing → Other workspace pages: routes to (evidence: `Front/src/App.jsx`)
- Workspace routing → API client: loads resources (evidence: `Front/src/App.jsx`)
- Workspace routing → API route dispatch: sends API requests
- API route dispatch → Account access: dispatches (evidence: `Group-System/routes/web.php`)
- API route dispatch → Pet endpoints: dispatches (evidence: `Group-System/routes/web.php`)
- API route dispatch → Booking endpoints: dispatches (evidence: `Group-System/routes/web.php`)
- API route dispatch → Clinical records: dispatches (evidence: `Group-System/routes/web.php`)
- API route dispatch → Guardian endpoints: dispatches (evidence: `Group-System/routes/web.php`)
- API route dispatch → Inventory endpoints: dispatches (evidence: `Group-System/routes/web.php`)
- API route dispatch → Staff accounts: dispatches (evidence: `Group-System/routes/web.php`)
- API route dispatch → Clinic overview: dispatches (evidence: `Group-System/routes/web.php`)
- API route dispatch → Account settings: dispatches (evidence: `Group-System/routes/web.php`)
- Account access → Guardian model: creates guardian (evidence: `Group-System/app/Http/Controllers/AuthController.php`)
- Pet endpoints → Pet domain model: reads and writes (evidence: `Group-System/app/Http/Controllers/AnimalController.php`)
- Pet endpoints → Guardian model: loads guardian data (evidence: `Group-System/app/Http/Controllers/AnimalController.php`)
- Clinical records → Pet domain model: records care for (evidence: `Group-System/app/Http/Controllers/ClinicalController.php`)
- Clinical records → Stock movements: issues supplies (evidence: `Group-System/app/Http/Controllers/ClinicalController.php`)
- Inventory endpoints → Stock movements: moves stock (evidence: `Group-System/app/Http/Controllers/InventoryController.php`)
- Stock movements → Stock records: updates stock (evidence: `Group-System/app/Services/StockService.php`)
- Booking endpoints → Booking scheduling: delegates booking
- Pet endpoints → Audit trail: records events (evidence: `Group-System/app/Http/Controllers/AnimalController.php`)
- Account access → Audit trail: records events (evidence: `Group-System/app/Http/Controllers/AuthController.php`)
- Clinical records → Audit trail: records events (evidence: `Group-System/app/Http/Controllers/ClinicalController.php`)
- Inventory endpoints → Audit trail: records events (evidence: `Group-System/app/Http/Controllers/InventoryController.php`)
- Stock movements → Audit trail: records events (evidence: `Group-System/app/Services/StockService.php`)
