# shadowzach142/car-diagnostics architecture

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

- Interactive diagram: https://gitdiagram.com/shadowzach142/car-diagnostics
- Repository: https://github.com/shadowzach142/car-diagnostics

## Overview

This is a React fleet-management application for cooperative vehicle operations. Users work through a dashboard and dedicated workspaces to register and profile vehicles, manage drivers and bookings, monitor maintenance, complete work orders, and review repair expenses and audit records. App selects the active workspace and mounts shared dialogs; FleetContext supplies shared application state. The README describes browser localStorage persistence and mapping capabilities, but the sampled code does not show the map implementation or storage calls, so those links are documented rather than inferred from unsampled code.

Main entry points: [`src/App.jsx`](https://github.com/shadowzach142/car-diagnostics/blob/main/src/App.jsx) (Workspace Router), [`src/context/FleetContext.jsx`](https://github.com/shadowzach142/car-diagnostics/blob/main/src/context/FleetContext.jsx) (Fleet State), [`src/components/VehicleProfiling.jsx`](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/VehicleProfiling.jsx) (Vehicle Profiling), [`src/components/MaintenanceHub.jsx`](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/MaintenanceHub.jsx) (Maintenance Hub)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application Runtime"]
  node_app["Workspace Router<br/>[App.jsx]"]
end

subgraph group_fleet["Fleet Operations"]
  node_dashboard["Operations Dashboard<br/>[Dashboard.jsx]"]
  node_directory["Fleet Directory<br/>[FleetDirectory.jsx]"]
  node_profiling["Vehicle Profiling"]
  node_vehiclemodal["Vehicle Detail"]
  node_drivers["Driver Roster<br/>[DriverRoster.jsx]"]
  node_bookings["Bookings Calendar"]
  node_bookingmodal["Booking Dialogs<br/>[BookingModal.jsx]"]
  node_map["Branch Asset Map<br/>[MapView.jsx]"]
end

subgraph group_maintenance["Maintenance Lifecycle"]
  node_health["Vehicle Health<br/>[OngoingHealth.jsx]"]
  node_maintenancehub["Maintenance Hub<br/>[MaintenanceHub.jsx]"]
  node_workorder["Work Order Dialogs"]
  node_completion["Work Completion"]
end

subgraph group_oversight["Records and Governance"]
  node_ledger["Repair Ledger<br/>[RepairArchive.jsx]"]
  node_ledgerentry["Ledger Entry<br/>[AddLedgerModal.jsx]"]
  node_audit["Security Audit<br/>[SecurityAudit.jsx]"]
end

subgraph group_shared["Shared Data and Controls"]
  node_state["Fleet State<br/>[FleetContext.jsx]"]
  node_defaults["Fleet Dataset<br/>[fleetData.js]"]
  node_configuration["Fleet Configuration"]
  node_employeeaccess["Employee Access"]
  node_vehicleaccess["Vehicle Access"]
  node_formatters["Display Utilities<br/>[formatters.js]"]
end

node_operator(("Fleet User"))
node_browser[("Browser Storage")]

node_operator -->|"uses"| node_app
node_app -->|"provides state"| node_state
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_profiling
node_app -->|"routes to"| node_drivers
node_app -->|"routes to"| node_bookings
node_app -->|"routes to"| node_health
node_app -->|"routes to"| node_maintenancehub
node_app -->|"routes to"| node_ledger
node_app -->|"routes to"| node_audit
node_app -->|"routes to"| node_configuration
node_app -->|"mounts"| node_vehiclemodal
node_app -->|"mounts"| node_bookingmodal
node_app -->|"mounts"| node_workorder
node_app -->|"mounts"| node_completion
node_app -->|"mounts"| node_ledgerentry
node_app -->|"mounts"| node_employeeaccess
node_app -->|"mounts"| node_vehicleaccess
node_state -->|"uses defaults"| node_defaults
node_state -.->|"persists state"| node_browser
node_dashboard -->|"reads state"| node_state
node_profiling -->|"reads state"| node_state
node_drivers -->|"reads state"| node_state
node_bookings -->|"reads state"| node_state
node_health -->|"reads state"| node_state
node_maintenancehub -->|"reads state"| node_state
node_ledger -->|"reads state"| node_state
node_audit -->|"reads state"| node_state
node_configuration -->|"reads state"| node_state
node_vehiclemodal -->|"reads state"| node_state
node_bookingmodal -->|"updates bookings"| node_state
node_workorder -->|"creates work orders"| node_state
node_completion -->|"updates work orders"| node_state
node_ledgerentry -->|"updates ledger"| node_state
node_map -->|"reads fleet data"| node_state
node_profiling -.->|"opens details"| node_vehiclemodal
node_bookings -->|"schedules trips"| node_bookingmodal
node_maintenancehub -.->|"issues orders"| node_workorder
node_maintenancehub -.->|"completes orders"| node_completion
node_ledger -.->|"adds expenses"| node_ledgerentry
node_operator -.->|"views branches"| node_map
node_profiling -.->|"formats vehicle labels"| node_formatters

click node_app "https://github.com/shadowzach142/car-diagnostics/blob/main/src/App.jsx"
click node_state "https://github.com/shadowzach142/car-diagnostics/blob/main/src/context/FleetContext.jsx"
click node_defaults "https://github.com/shadowzach142/car-diagnostics/blob/main/src/data/fleetData.js"
click node_dashboard "https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/Dashboard.jsx"
click node_directory "https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/FleetDirectory.jsx"
click node_profiling "https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/VehicleProfiling.jsx"
click node_vehiclemodal "https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/modals/VehicleDetailModal.jsx"
click node_drivers "https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/DriverRoster.jsx"
click node_bookings "https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/BookingsCalendar.jsx"
click node_bookingmodal "https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/modals/BookingModal.jsx"
click node_map "https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/MapView.jsx"
click node_health "https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/OngoingHealth.jsx"
click node_maintenancehub "https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/MaintenanceHub.jsx"
click node_workorder "https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/modals/NewWorkOrderModal.jsx"
click node_completion "https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/modals/CompleteWorkOrderModal.jsx"
click node_ledger "https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/RepairArchive.jsx"
click node_ledgerentry "https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/modals/AddLedgerModal.jsx"
click node_audit "https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/SecurityAudit.jsx"
click node_configuration "https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/EditablesConfig.jsx"
click node_employeeaccess "https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/modals/EmployeeAccessModal.jsx"
click node_vehicleaccess "https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/modals/VehicleAccessModal.jsx"
click node_formatters "https://github.com/shadowzach142/car-diagnostics/blob/main/src/utils/formatters.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,node_operator toneBlue
class node_dashboard,node_directory,node_profiling,node_vehiclemodal,node_drivers,node_bookings,node_bookingmodal,node_map,node_browser toneAmber
class node_health,node_maintenancehub,node_workorder,node_completion toneMint
class node_ledger,node_ledgerentry,node_audit toneRose
class node_state,node_defaults,node_configuration,node_employeeaccess,node_vehicleaccess,node_formatters toneIndigo
```

## Components

### Application Runtime

- [Workspace Router](https://github.com/shadowzach142/car-diagnostics/blob/main/src/App.jsx): `src/App.jsx`

### Fleet Operations

- [Operations Dashboard](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/Dashboard.jsx): `src/components/Dashboard.jsx`
- [Fleet Directory](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/FleetDirectory.jsx): `src/components/FleetDirectory.jsx`
- [Vehicle Profiling](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/VehicleProfiling.jsx): `src/components/VehicleProfiling.jsx`
- [Vehicle Detail](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/modals/VehicleDetailModal.jsx): `src/components/modals/VehicleDetailModal.jsx`
- [Driver Roster](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/DriverRoster.jsx): `src/components/DriverRoster.jsx`
- [Bookings Calendar](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/BookingsCalendar.jsx): `src/components/BookingsCalendar.jsx`
- [Booking Dialogs](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/modals/BookingModal.jsx): `src/components/modals/BookingModal.jsx`
- [Branch Asset Map](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/MapView.jsx): `src/components/MapView.jsx`

### Maintenance Lifecycle

- [Vehicle Health](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/OngoingHealth.jsx): `src/components/OngoingHealth.jsx`
- [Maintenance Hub](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/MaintenanceHub.jsx): `src/components/MaintenanceHub.jsx`
- [Work Order Dialogs](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/modals/NewWorkOrderModal.jsx): `src/components/modals/NewWorkOrderModal.jsx`
- [Work Completion](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/modals/CompleteWorkOrderModal.jsx): `src/components/modals/CompleteWorkOrderModal.jsx`

### Records and Governance

- [Repair Ledger](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/RepairArchive.jsx): `src/components/RepairArchive.jsx`
- [Ledger Entry](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/modals/AddLedgerModal.jsx): `src/components/modals/AddLedgerModal.jsx`
- [Security Audit](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/SecurityAudit.jsx): `src/components/SecurityAudit.jsx`

### Shared Data and Controls

- [Fleet State](https://github.com/shadowzach142/car-diagnostics/blob/main/src/context/FleetContext.jsx): `src/context/FleetContext.jsx`
- [Fleet Dataset](https://github.com/shadowzach142/car-diagnostics/blob/main/src/data/fleetData.js): `src/data/fleetData.js`
- [Fleet Configuration](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/EditablesConfig.jsx): `src/components/EditablesConfig.jsx`
- [Employee Access](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/modals/EmployeeAccessModal.jsx): `src/components/modals/EmployeeAccessModal.jsx`
- [Vehicle Access](https://github.com/shadowzach142/car-diagnostics/blob/main/src/components/modals/VehicleAccessModal.jsx): `src/components/modals/VehicleAccessModal.jsx`
- [Display Utilities](https://github.com/shadowzach142/car-diagnostics/blob/main/src/utils/formatters.js): `src/utils/formatters.js`

### Other components

- **Fleet User**
- **Browser Storage**

## Connections

- Fleet User → Workspace Router: uses (evidence: `README.md`)
- Workspace Router → Fleet State: provides state (evidence: `src/App.jsx`)
- Workspace Router → Operations Dashboard: routes to (evidence: `src/App.jsx`)
- Workspace Router → Vehicle Profiling: routes to (evidence: `src/App.jsx`)
- Workspace Router → Driver Roster: routes to (evidence: `src/App.jsx`)
- Workspace Router → Bookings Calendar: routes to (evidence: `src/App.jsx`)
- Workspace Router → Vehicle Health: routes to (evidence: `src/App.jsx`)
- Workspace Router → Maintenance Hub: routes to (evidence: `src/App.jsx`)
- Workspace Router → Repair Ledger: routes to (evidence: `src/App.jsx`)
- Workspace Router → Security Audit: routes to (evidence: `src/App.jsx`)
- Workspace Router → Fleet Configuration: routes to (evidence: `src/App.jsx`)
- Workspace Router → Vehicle Detail: mounts (evidence: `src/App.jsx`)
- Workspace Router → Booking Dialogs: mounts (evidence: `src/App.jsx`)
- Workspace Router → Work Order Dialogs: mounts (evidence: `src/App.jsx`)
- Workspace Router → Work Completion: mounts (evidence: `src/App.jsx`)
- Workspace Router → Ledger Entry: mounts (evidence: `src/App.jsx`)
- Workspace Router → Employee Access: mounts (evidence: `src/App.jsx`)
- Workspace Router → Vehicle Access: mounts (evidence: `src/App.jsx`)
- Fleet State → Fleet Dataset: uses defaults (evidence: `src/context/FleetContext.jsx`)
- Fleet State → Browser Storage: persists state (evidence: `README.md`)
- Operations Dashboard → Fleet State: reads state (evidence: `src/components/Dashboard.jsx`)
- Vehicle Profiling → Fleet State: reads state (evidence: `src/components/VehicleProfiling.jsx`)
- Driver Roster → Fleet State: reads state (evidence: `src/components/DriverRoster.jsx`)
- Bookings Calendar → Fleet State: reads state (evidence: `src/components/BookingsCalendar.jsx`)
- Vehicle Health → Fleet State: reads state (evidence: `src/components/OngoingHealth.jsx`)
- Maintenance Hub → Fleet State: reads state (evidence: `src/components/MaintenanceHub.jsx`)
- Repair Ledger → Fleet State: reads state (evidence: `src/components/RepairArchive.jsx`)
- Security Audit → Fleet State: reads state (evidence: `src/components/SecurityAudit.jsx`)
- Fleet Configuration → Fleet State: reads state (evidence: `src/components/EditablesConfig.jsx`)
- Vehicle Detail → Fleet State: reads state (evidence: `src/components/modals/VehicleDetailModal.jsx`)
- Booking Dialogs → Fleet State: updates bookings (evidence: `src/components/modals/BookingModal.jsx`)
- Work Order Dialogs → Fleet State: creates work orders (evidence: `src/components/modals/NewWorkOrderModal.jsx`)
- Work Completion → Fleet State: updates work orders (evidence: `src/components/modals/CompleteWorkOrderModal.jsx`)
- Ledger Entry → Fleet State: updates ledger (evidence: `src/components/modals/AddLedgerModal.jsx`)
- Branch Asset Map → Fleet State: reads fleet data (evidence: `src/components/MapView.jsx`)
- Vehicle Profiling → Vehicle Detail: opens details
- Bookings Calendar → Booking Dialogs: schedules trips (evidence: `src/components/modals/BookingModal.jsx`)
- Maintenance Hub → Work Order Dialogs: issues orders
- Maintenance Hub → Work Completion: completes orders
- Repair Ledger → Ledger Entry: adds expenses
- Fleet User → Branch Asset Map: views branches (evidence: `README.md`)
- Vehicle Profiling → Display Utilities: formats vehicle labels
