# loydzzz/alavaren-auto-electrical-services- architecture

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

- Interactive diagram: https://gitdiagram.com/loydzzz/alavaren-auto-electrical-services-
- Repository: https://github.com/loydzzz/alavaren-auto-electrical-services-

## Overview

Alavaren appears to be an automotive electrical service application with customer, administrator, and technician interfaces. The visible workflow is customer sign-in and service booking, followed by appointment management and technician task handling; administrators also manage inventory, transactions, customers, announcements, and warranties. The React router and role guards organize these screens, while Supabase is the shared backend and an edge function provides appointment SMS. The README is only a Vite template, and most page implementations were not excerpted, so backend actions beyond the shown SMS call are not mapped as verified flows.

Main entry points: [`src/App.jsx`](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/App.jsx) (Route application), [`src/lib/supabase.js`](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/lib/supabase.js) (Supabase client), [`src/pages/admin/Appointments.jsx`](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/admin/Appointments.jsx) (Appointment management), [`src/pages/technician/Tasks.jsx`](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/technician/Tasks.jsx) (Technician tasks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and access"]
  node_app["Route application<br/>[App.jsx]"]
  node_access["Role access<br/>[ProtectedRoute.jsx]"]
  node_landing["Public landing<br/>[Landing.jsx]"]
  node_auth["Sign-in and registration<br/>[Login.jsx]"]
end

subgraph group_customer["Customer service"]
  node_customerhome["Customer home<br/>[Home.jsx]"]
  node_booking["Service booking<br/>[Booking.jsx]"]
  node_appointments["My appointments<br/>[MyAppointments.jsx]"]
end

subgraph group_operations["Service operations"]
  node_admin["Admin dashboard<br/>[Dashboard.jsx]"]
  node_adminappointments["Appointment management<br/>[Appointments.jsx]"]
  node_tasks["Technician tasks<br/>[Tasks.jsx]"]
  node_inventory["Inventory management<br/>[Inventory.jsx]"]
  node_transactions["Transactions<br/>[Transactions.jsx]"]
  node_archive["Appointment archive<br/>[Archive.jsx]"]
  node_moderation["Customer moderation"]
  node_announcements["Announcement management<br/>[Announcements.jsx]"]
  node_warranty["Warranty documents"]
end

subgraph group_platform["Shared platform"]
  node_layout["Dashboard shell"]
  node_supabaseclient["Supabase client<br/>[supabase.js]"]
  node_database[("Supabase data services")]
  node_smsclient["Appointment SMS client<br/>[appointmentSms.js]"]
  node_smsfunction["SMS edge function<br/>[index.ts]"]
end

node_visitor(("Visitor / user"))

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_auth
node_app -->|"guards routes"| node_access
node_access -->|"renders"| node_layout
node_app -->|"routes to"| node_customerhome
node_app -->|"routes to"| node_booking
node_app -->|"routes to"| node_appointments
node_app -->|"routes to"| node_admin
node_app -->|"routes to"| node_adminappointments
node_app -->|"routes to"| node_tasks
node_app -->|"routes to"| node_inventory
node_app -->|"routes to"| node_transactions
node_app -->|"routes to"| node_archive
node_app -->|"routes to"| node_moderation
node_app -->|"routes to"| node_announcements
node_app -->|"routes to"| node_warranty
node_customerhome -->|"uses client"| node_supabaseclient
node_booking -->|"uses client"| node_supabaseclient
node_appointments -->|"uses client"| node_supabaseclient
node_adminappointments -->|"uses client"| node_supabaseclient
node_tasks -->|"uses client"| node_supabaseclient
node_inventory -->|"uses client"| node_supabaseclient
node_transactions -->|"uses client"| node_supabaseclient
node_archive -->|"uses client"| node_supabaseclient
node_moderation -->|"uses client"| node_supabaseclient
node_announcements -->|"uses client"| node_supabaseclient
node_supabaseclient -.->|"connects to"| node_database
node_tasks -->|"requests SMS"| node_smsclient
node_adminappointments -->|"imports helper"| node_smsclient
node_smsclient -->|"invokes"| node_smsfunction
node_smsfunction -.->|"handles via backend"| node_database

click node_app "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/App.jsx"
click node_access "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/components/ProtectedRoute.jsx"
click node_landing "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/Landing%20page/Landing.jsx"
click node_auth "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/Login.jsx"
click node_customerhome "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/customer/Home.jsx"
click node_booking "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/customer/Booking.jsx"
click node_appointments "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/customer/MyAppointments.jsx"
click node_admin "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/admin/Dashboard.jsx"
click node_adminappointments "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/admin/Appointments.jsx"
click node_tasks "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/technician/Tasks.jsx"
click node_inventory "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/admin/Inventory.jsx"
click node_transactions "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/admin/Transactions.jsx"
click node_archive "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/admin/Archive.jsx"
click node_moderation "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/admin/CustomerModeration.jsx"
click node_announcements "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/admin/Announcements.jsx"
click node_warranty "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/admin/HomeServiceWarranty.jsx"
click node_layout "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/layouts/DashboardLayout.jsx"
click node_supabaseclient "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/lib/supabase.js"
click node_smsclient "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/lib/appointmentSms.js"
click node_smsfunction "https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/supabase/functions/send-appointment-sms/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_access,node_landing,node_auth,node_visitor toneBlue
class node_customerhome,node_booking,node_appointments toneAmber
class node_admin,node_adminappointments,node_tasks,node_inventory,node_transactions,node_archive,node_moderation,node_announcements,node_warranty toneMint
class node_layout,node_supabaseclient,node_database,node_smsclient,node_smsfunction toneRose
```

## Components

### Entry and access

- [Route application](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/App.jsx): `src/App.jsx`
- [Role access](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/components/ProtectedRoute.jsx): `src/components/ProtectedRoute.jsx`
- [Public landing](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/Landing%20page/Landing.jsx): `src/pages/Landing page/Landing.jsx`
- [Sign-in and registration](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`

### Customer service

- [Customer home](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/customer/Home.jsx): `src/pages/customer/Home.jsx`
- [Service booking](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/customer/Booking.jsx): `src/pages/customer/Booking.jsx`
- [My appointments](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/customer/MyAppointments.jsx): `src/pages/customer/MyAppointments.jsx`

### Service operations

- [Admin dashboard](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/admin/Dashboard.jsx): `src/pages/admin/Dashboard.jsx`
- [Appointment management](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/admin/Appointments.jsx): `src/pages/admin/Appointments.jsx`
- [Technician tasks](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/technician/Tasks.jsx): `src/pages/technician/Tasks.jsx`
- [Inventory management](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/admin/Inventory.jsx): `src/pages/admin/Inventory.jsx`
- [Transactions](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/admin/Transactions.jsx): `src/pages/admin/Transactions.jsx`
- [Appointment archive](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/admin/Archive.jsx): `src/pages/admin/Archive.jsx`
- [Customer moderation](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/admin/CustomerModeration.jsx): `src/pages/admin/CustomerModeration.jsx`
- [Announcement management](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/admin/Announcements.jsx): `src/pages/admin/Announcements.jsx`
- [Warranty documents](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/pages/admin/HomeServiceWarranty.jsx): `src/pages/admin/HomeServiceWarranty.jsx`

### Shared platform

- [Dashboard shell](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/layouts/DashboardLayout.jsx): `src/layouts/DashboardLayout.jsx`
- [Supabase client](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/lib/supabase.js): `src/lib/supabase.js`
- **Supabase data services**
- [Appointment SMS client](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/src/lib/appointmentSms.js): `src/lib/appointmentSms.js`
- [SMS edge function](https://github.com/loydzzz/alavaren-auto-electrical-services-/blob/main/supabase/functions/send-appointment-sms/index.ts): `supabase/functions/send-appointment-sms/index.ts`

### Other components

- **Visitor / user**

## Connections

- Visitor / user → Route application: opens
- Route application → Public landing: routes to (evidence: `src/App.jsx`)
- Route application → Sign-in and registration: routes to (evidence: `src/App.jsx`)
- Route application → Role access: guards routes (evidence: `src/App.jsx`)
- Role access → Dashboard shell: renders (evidence: `src/App.jsx`)
- Route application → Customer home: routes to (evidence: `src/App.jsx`)
- Route application → Service booking: routes to (evidence: `src/App.jsx`)
- Route application → My appointments: routes to (evidence: `src/App.jsx`)
- Route application → Admin dashboard: routes to (evidence: `src/App.jsx`)
- Route application → Appointment management: routes to (evidence: `src/App.jsx`)
- Route application → Technician tasks: routes to (evidence: `src/App.jsx`)
- Route application → Inventory management: routes to (evidence: `src/App.jsx`)
- Route application → Transactions: routes to (evidence: `src/App.jsx`)
- Route application → Appointment archive: routes to (evidence: `src/App.jsx`)
- Route application → Customer moderation: routes to (evidence: `src/App.jsx`)
- Route application → Announcement management: routes to (evidence: `src/App.jsx`)
- Route application → Warranty documents: routes to (evidence: `src/App.jsx`)
- Customer home → Supabase client: uses client (evidence: `src/pages/customer/Home.jsx`)
- Service booking → Supabase client: uses client (evidence: `src/pages/customer/Booking.jsx`)
- My appointments → Supabase client: uses client (evidence: `src/pages/customer/MyAppointments.jsx`)
- Appointment management → Supabase client: uses client (evidence: `src/pages/admin/Appointments.jsx`)
- Technician tasks → Supabase client: uses client (evidence: `src/pages/technician/Tasks.jsx`)
- Inventory management → Supabase client: uses client (evidence: `src/pages/admin/Inventory.jsx`)
- Transactions → Supabase client: uses client (evidence: `src/pages/admin/Transactions.jsx`)
- Appointment archive → Supabase client: uses client (evidence: `src/pages/admin/Archive.jsx`)
- Customer moderation → Supabase client: uses client (evidence: `src/pages/admin/CustomerModeration.jsx`)
- Announcement management → Supabase client: uses client (evidence: `src/pages/admin/Announcements.jsx`)
- Supabase client → Supabase data services: connects to
- Technician tasks → Appointment SMS client: requests SMS (evidence: `src/pages/technician/Tasks.jsx`)
- Appointment management → Appointment SMS client: imports helper (evidence: `src/pages/admin/Appointments.jsx`)
- Appointment SMS client → SMS edge function: invokes (evidence: `src/lib/appointmentSms.js`)
- SMS edge function → Supabase data services: handles via backend
