# lacaba-bry/testing architecture

> Architecture diagram of the GitHub repository lacaba-bry/testing, 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/lacaba-bry/testing
- Repository: https://github.com/lacaba-bry/testing

## Overview

CareFur is a staff dashboard for managing pet boarding and related operations, with administrative hardware controls. The main workflow is staff sign-in, protected navigation, and use of boarding and operational pages; booking creation is supported by dedicated hooks and a Supabase function. The tree and excerpts show the frontend, Supabase-backed services, and camera-gateway client. Several listed pages and functions were not sampled, so their internal behavior and connections are not inferred.

Main entry points: [`src/App.jsx`](https://github.com/lacaba-bry/testing/blob/main/src/App.jsx) (Route application), [`src/services/supabaseClient.js`](https://github.com/lacaba-bry/testing/blob/main/src/services/supabaseClient.js) (Supabase client), [`src/services/cameraGateway.js`](https://github.com/lacaba-bry/testing/blob/main/src/services/cameraGateway.js) (Camera gateway client), [`src/pages/NewBoarding.jsx`](https://github.com/lacaba-bry/testing/blob/main/src/pages/NewBoarding.jsx) (New boarding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Dashboard and access"]
  node_app["Route application<br/>[App.jsx]"]
  node_authctx["Authentication state<br/>[AuthContext.jsx]"]
end

subgraph group_boarding["Boarding workflow"]
  node_newboarding["New boarding<br/>[NewBoarding.jsx]"]
  node_bookinghook["Booking creation"]
  node_review["Booking review<br/>[ReviewStep.jsx]"]
  node_feedingvalidation["Feeding validation"]
  node_boardings["Boarding records<br/>[Boardings.jsx]"]
end

subgraph group_operations["Care operations"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_dashboarddata["Dashboard data<br/>[useDashboard.js]"]
  node_pets["Pet records<br/>[Pets.jsx]"]
  node_rooms["Room management<br/>[Rooms.jsx]"]
  node_feeding["Feeding schedules"]
  node_messages["Booking messages<br/>[Messages.jsx]"]
  node_messagehook["Message data<br/>[useMessages.js]"]
  node_staffmanagement["Staff management"]
end

subgraph group_hardware["Hardware controls"]
  node_cameras["Camera monitoring<br/>[Cameras.jsx]"]
  node_cameratest["Camera diagnostics<br/>[CameraTest.jsx]"]
  node_cameraclient["Camera gateway client<br/>[cameraGateway.js]"]
  node_hardwaresetup["Camera setup<br/>[HardwareSetup.jsx]"]
  node_wifi["Feeder Wi-Fi status"]
  node_motortest["Feeder motor test<br/>[MotorTest.jsx]"]
end

subgraph group_backend["Backend services"]
  node_authservice["Staff authentication<br/>[authService.js]"]
  node_supabase["Supabase client<br/>[supabaseClient.js]"]
  node_createbookingfn["Booking function<br/>[index.js]"]
  node_chatfn["Booking chat function<br/>[index.ts]"]
  node_sendmessagefn["Send message function<br/>[index.ts]"]
  node_rotatefn["Feeder rotate function<br/>[index.ts]"]
  node_feedertestfn["Feeder test function<br/>[index.ts]"]
end

node_staff(("Staff user"))
node_gateway{{"Camera gateway"}}

node_staff -->|"opens dashboard"| node_app
node_app -->|"gates routes"| node_authctx
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_newboarding
node_app -->|"routes to"| node_boardings
node_app -->|"routes to"| node_pets
node_app -->|"routes to"| node_rooms
node_app -->|"routes to"| node_feeding
node_app -->|"routes to"| node_messages
node_app -->|"admin route"| node_staffmanagement
node_app -->|"routes to"| node_cameras
node_app -->|"admin route"| node_cameratest
node_app -->|"admin route"| node_hardwaresetup
node_app -->|"admin route"| node_wifi
node_app -->|"admin route"| node_motortest
node_authctx -->|"calls"| node_authservice
node_authctx -->|"tracks auth changes"| node_supabase
node_authservice -->|"auth and profiles"| node_supabase
node_dashboard -->|"loads data"| node_dashboarddata
node_dashboarddata -->|"queries"| node_supabase
node_newboarding -->|"submits booking"| node_bookinghook
node_newboarding -->|"renders step"| node_review
node_newboarding -->|"validates feeding"| node_feedingvalidation
node_bookinghook -->|"validates schedules"| node_feedingvalidation
node_bookinghook -->|"reads and writes"| node_supabase
node_bookinghook -.-> node_createbookingfn
node_messages -->|"loads conversations"| node_messagehook
node_messagehook -->|"reads and updates"| node_supabase
node_cameras -->|"requests camera"| node_cameraclient
node_cameratest -->|"tests gateway"| node_cameraclient
node_cameraclient -->|"gets auth session"| node_supabase
node_cameraclient -->|"sends requests"| node_gateway
node_wifi -->|"checks status"| node_supabase
node_hardwaresetup -->|"uses gateway"| node_cameraclient
node_motortest -->|"uses client"| node_supabase

click node_app "https://github.com/lacaba-bry/testing/blob/main/src/App.jsx"
click node_authctx "https://github.com/lacaba-bry/testing/blob/main/src/context/AuthContext.jsx"
click node_authservice "https://github.com/lacaba-bry/testing/blob/main/src/services/authService.js"
click node_supabase "https://github.com/lacaba-bry/testing/blob/main/src/services/supabaseClient.js"
click node_dashboard "https://github.com/lacaba-bry/testing/blob/main/src/pages/Dashboard.jsx"
click node_dashboarddata "https://github.com/lacaba-bry/testing/blob/main/src/hooks/useDashboard.js"
click node_newboarding "https://github.com/lacaba-bry/testing/blob/main/src/pages/NewBoarding.jsx"
click node_bookinghook "https://github.com/lacaba-bry/testing/blob/main/src/hooks/useCreateBooking.js"
click node_review "https://github.com/lacaba-bry/testing/blob/main/src/components/boarding/ReviewStep.jsx"
click node_feedingvalidation "https://github.com/lacaba-bry/testing/blob/main/src/utils/feedingValidation.js"
click node_boardings "https://github.com/lacaba-bry/testing/blob/main/src/pages/Boardings.jsx"
click node_pets "https://github.com/lacaba-bry/testing/blob/main/src/pages/Pets.jsx"
click node_rooms "https://github.com/lacaba-bry/testing/blob/main/src/pages/Rooms.jsx"
click node_feeding "https://github.com/lacaba-bry/testing/blob/main/src/pages/FeedingSchedule.jsx"
click node_messages "https://github.com/lacaba-bry/testing/blob/main/src/pages/Messages.jsx"
click node_messagehook "https://github.com/lacaba-bry/testing/blob/main/src/hooks/useMessages.js"
click node_staffmanagement "https://github.com/lacaba-bry/testing/blob/main/src/pages/StaffManagement.jsx"
click node_cameras "https://github.com/lacaba-bry/testing/blob/main/src/pages/Cameras.jsx"
click node_cameratest "https://github.com/lacaba-bry/testing/blob/main/src/pages/CameraTest.jsx"
click node_cameraclient "https://github.com/lacaba-bry/testing/blob/main/src/services/cameraGateway.js"
click node_hardwaresetup "https://github.com/lacaba-bry/testing/blob/main/src/pages/HardwareSetup.jsx"
click node_wifi "https://github.com/lacaba-bry/testing/blob/main/src/pages/FeederWiFiManager.jsx"
click node_motortest "https://github.com/lacaba-bry/testing/blob/main/src/pages/MotorTest.jsx"
click node_createbookingfn "https://github.com/lacaba-bry/testing/blob/main/supabase/functions/create-booking/index.js"
click node_chatfn "https://github.com/lacaba-bry/testing/blob/main/supabase/functions/get-booking-chat/index.ts"
click node_sendmessagefn "https://github.com/lacaba-bry/testing/blob/main/supabase/functions/send-booking-message/index.ts"
click node_rotatefn "https://github.com/lacaba-bry/testing/blob/main/supabase/functions/feeder-rotate/index.ts"
click node_feedertestfn "https://github.com/lacaba-bry/testing/blob/main/supabase/functions/feeder-test-command/index.ts"

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_authctx,node_staff toneBlue
class node_newboarding,node_bookinghook,node_review,node_feedingvalidation,node_boardings toneAmber
class node_dashboard,node_dashboarddata,node_pets,node_rooms,node_feeding,node_messages,node_messagehook,node_staffmanagement toneMint
class node_cameras,node_cameratest,node_cameraclient,node_hardwaresetup,node_wifi,node_motortest toneRose
class node_authservice,node_supabase,node_createbookingfn,node_chatfn,node_sendmessagefn,node_rotatefn,node_feedertestfn,node_gateway toneIndigo
```

## Components

### Dashboard and access

- [Route application](https://github.com/lacaba-bry/testing/blob/main/src/App.jsx): `src/App.jsx`
- [Authentication state](https://github.com/lacaba-bry/testing/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`

### Boarding workflow

- [New boarding](https://github.com/lacaba-bry/testing/blob/main/src/pages/NewBoarding.jsx): `src/pages/NewBoarding.jsx`
- [Booking creation](https://github.com/lacaba-bry/testing/blob/main/src/hooks/useCreateBooking.js): `src/hooks/useCreateBooking.js`
- [Booking review](https://github.com/lacaba-bry/testing/blob/main/src/components/boarding/ReviewStep.jsx): `src/components/boarding/ReviewStep.jsx`
- [Feeding validation](https://github.com/lacaba-bry/testing/blob/main/src/utils/feedingValidation.js): `src/utils/feedingValidation.js`
- [Boarding records](https://github.com/lacaba-bry/testing/blob/main/src/pages/Boardings.jsx): `src/pages/Boardings.jsx`

### Care operations

- [Dashboard](https://github.com/lacaba-bry/testing/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Dashboard data](https://github.com/lacaba-bry/testing/blob/main/src/hooks/useDashboard.js): `src/hooks/useDashboard.js`
- [Pet records](https://github.com/lacaba-bry/testing/blob/main/src/pages/Pets.jsx): `src/pages/Pets.jsx`
- [Room management](https://github.com/lacaba-bry/testing/blob/main/src/pages/Rooms.jsx): `src/pages/Rooms.jsx`
- [Feeding schedules](https://github.com/lacaba-bry/testing/blob/main/src/pages/FeedingSchedule.jsx): `src/pages/FeedingSchedule.jsx`
- [Booking messages](https://github.com/lacaba-bry/testing/blob/main/src/pages/Messages.jsx): `src/pages/Messages.jsx`
- [Message data](https://github.com/lacaba-bry/testing/blob/main/src/hooks/useMessages.js): `src/hooks/useMessages.js`
- [Staff management](https://github.com/lacaba-bry/testing/blob/main/src/pages/StaffManagement.jsx): `src/pages/StaffManagement.jsx`

### Hardware controls

- [Camera monitoring](https://github.com/lacaba-bry/testing/blob/main/src/pages/Cameras.jsx): `src/pages/Cameras.jsx`
- [Camera diagnostics](https://github.com/lacaba-bry/testing/blob/main/src/pages/CameraTest.jsx): `src/pages/CameraTest.jsx`
- [Camera gateway client](https://github.com/lacaba-bry/testing/blob/main/src/services/cameraGateway.js): `src/services/cameraGateway.js`
- [Camera setup](https://github.com/lacaba-bry/testing/blob/main/src/pages/HardwareSetup.jsx): `src/pages/HardwareSetup.jsx`
- [Feeder Wi-Fi status](https://github.com/lacaba-bry/testing/blob/main/src/pages/FeederWiFiManager.jsx): `src/pages/FeederWiFiManager.jsx`
- [Feeder motor test](https://github.com/lacaba-bry/testing/blob/main/src/pages/MotorTest.jsx): `src/pages/MotorTest.jsx`

### Backend services

- [Staff authentication](https://github.com/lacaba-bry/testing/blob/main/src/services/authService.js): `src/services/authService.js`
- [Supabase client](https://github.com/lacaba-bry/testing/blob/main/src/services/supabaseClient.js): `src/services/supabaseClient.js`
- [Booking function](https://github.com/lacaba-bry/testing/blob/main/supabase/functions/create-booking/index.js): `supabase/functions/create-booking/index.js`
- [Booking chat function](https://github.com/lacaba-bry/testing/blob/main/supabase/functions/get-booking-chat/index.ts): `supabase/functions/get-booking-chat/index.ts`
- [Send message function](https://github.com/lacaba-bry/testing/blob/main/supabase/functions/send-booking-message/index.ts): `supabase/functions/send-booking-message/index.ts`
- [Feeder rotate function](https://github.com/lacaba-bry/testing/blob/main/supabase/functions/feeder-rotate/index.ts): `supabase/functions/feeder-rotate/index.ts`
- [Feeder test function](https://github.com/lacaba-bry/testing/blob/main/supabase/functions/feeder-test-command/index.ts): `supabase/functions/feeder-test-command/index.ts`

### Other components

- **Staff user**
- **Camera gateway**

## Connections

- Staff user → Route application: opens dashboard (evidence: `src/App.jsx`)
- Route application → Authentication state: gates routes (evidence: `src/App.jsx`)
- Route application → Dashboard: routes to (evidence: `src/App.jsx`)
- Route application → New boarding: routes to (evidence: `src/App.jsx`)
- Route application → Boarding records: routes to (evidence: `src/App.jsx`)
- Route application → Pet records: routes to (evidence: `src/App.jsx`)
- Route application → Room management: routes to (evidence: `src/App.jsx`)
- Route application → Feeding schedules: routes to (evidence: `src/App.jsx`)
- Route application → Booking messages: routes to (evidence: `src/App.jsx`)
- Route application → Staff management: admin route (evidence: `src/App.jsx`)
- Route application → Camera monitoring: routes to (evidence: `src/App.jsx`)
- Route application → Camera diagnostics: admin route (evidence: `src/App.jsx`)
- Route application → Camera setup: admin route (evidence: `src/App.jsx`)
- Route application → Feeder Wi-Fi status: admin route (evidence: `src/App.jsx`)
- Route application → Feeder motor test: admin route (evidence: `src/App.jsx`)
- Authentication state → Staff authentication: calls (evidence: `src/context/AuthContext.jsx`)
- Authentication state → Supabase client: tracks auth changes (evidence: `src/context/AuthContext.jsx`)
- Staff authentication → Supabase client: auth and profiles (evidence: `src/services/authService.js`)
- Dashboard → Dashboard data: loads data (evidence: `src/pages/Dashboard.jsx`)
- Dashboard data → Supabase client: queries (evidence: `src/hooks/useDashboard.js`)
- New boarding → Booking creation: submits booking (evidence: `src/pages/NewBoarding.jsx`)
- New boarding → Booking review: renders step (evidence: `src/pages/NewBoarding.jsx`)
- New boarding → Feeding validation: validates feeding (evidence: `src/pages/NewBoarding.jsx`)
- Booking creation → Feeding validation: validates schedules (evidence: `src/hooks/useCreateBooking.js`)
- Booking creation → Supabase client: reads and writes (evidence: `src/hooks/useCreateBooking.js`)
- Booking creation → Booking function
- Booking messages → Message data: loads conversations (evidence: `src/pages/Messages.jsx`)
- Message data → Supabase client: reads and updates (evidence: `src/hooks/useMessages.js`)
- Camera monitoring → Camera gateway client: requests camera (evidence: `src/pages/Cameras.jsx`)
- Camera diagnostics → Camera gateway client: tests gateway (evidence: `src/pages/CameraTest.jsx`)
- Camera gateway client → Supabase client: gets auth session (evidence: `src/services/cameraGateway.js`)
- Camera gateway client → Camera gateway: sends requests (evidence: `src/services/cameraGateway.js`)
- Feeder Wi-Fi status → Supabase client: checks status (evidence: `src/pages/FeederWiFiManager.jsx`)
- Camera setup → Camera gateway client: uses gateway (evidence: `src/pages/HardwareSetup.jsx`)
- Feeder motor test → Supabase client: uses client (evidence: `src/pages/MotorTest.jsx`)
