# patrickuwimanikunda-dev/guardex-project architecture

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

- Interactive diagram: https://gitdiagram.com/patrickuwimanikunda-dev/guardex-project
- Repository: https://github.com/patrickuwimanikunda-dev/guardex-project

## Overview

Guardex is a vehicle-safety interface spanning a public landing page, a role-based operations dashboard, a mobile-driver experience, and a USSD-style portal. The dashboard workflow is role login, then navigation to operational overview, vehicle management, alerts, analytics, AI risk prediction, or administration. The mobile app uses a screen-state dispatcher for role selection, login, monitoring, breath testing, history, owner views, and risk alerts. The sampled mobile dashboard uses mock vehicle data; the excerpts do not establish a live telemetry or persistence backend.

Main entry points: [`src/pages/MobileApp.jsx`](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/pages/MobileApp.jsx) (Mobile Dispatcher), [`src/pages/Dashboard.jsx`](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/pages/Dashboard.jsx) (Dashboard Dispatcher), [`src/pages.config.js`](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/pages.config.js) (Page Registry), [`src/App.jsx`](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/App.jsx) (App Router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App Shell"]
  node_app["App Router<br/>[App.jsx]"]
  node_auth["Auth Context<br/>[AuthContext.jsx]"]
  node_routes["Page Registry<br/>[pages.config.js]"]
end

subgraph group_public["Public Entry"]
  node_home["Landing Page<br/>[Home.jsx]"]
end

subgraph group_dashboard["Operations Dashboard"]
  node_dashboard["Dashboard Dispatcher<br/>[Dashboard.jsx]"]
  node_rolelogin["Role Login"]
  node_police["Police Overview<br/>[PoliceOverview.jsx]"]
  node_vehicles["Vehicle Management<br/>[VehiclesTable.jsx]"]
  node_vehicle_detail["Vehicle Details"]
  node_alerts["Alert Feed<br/>[AlertFeed.jsx]"]
  node_analytics["Analytics Dashboard"]
  node_ai_prediction["AI Risk Panel"]
  node_admin["Admin Panel<br/>[AdminPanel.jsx]"]
  node_sidebar["Dashboard Navigation"]
  node_topbar["Dashboard Header"]
end

subgraph group_mobile["Mobile Experience"]
  node_mobile_app["Mobile Dispatcher<br/>[MobileApp.jsx]"]
  node_splash["Splash Screen<br/>[SplashScreen.jsx]"]
  node_role_select["Role Selection<br/>[RoleSelection.jsx]"]
  node_mobile_login["Mobile Login<br/>[LoginScreen.jsx]"]
  node_driver["Driver Dashboard"]
  node_breath["Breath Test<br/>[BreathTest.jsx]"]
  node_monitor["Live Monitoring<br/>[LiveMonitoring.jsx]"]
  node_history["Driver History<br/>[DriverHistory.jsx]"]
  node_owner["Owner Dashboard<br/>[OwnerDashboard.jsx]"]
  node_high_risk["High Risk Alert<br/>[HighRiskAlert.jsx]"]
  node_crash_prediction["Crash Prediction"]
end

subgraph group_ussd["USSD Portal"]
  node_ussd["USSD Simulator<br/>[USSDPortal.jsx]"]
end

node_visitor(("User"))

node_visitor -->|"opens"| node_app
node_app -->|"provides auth"| node_auth
node_app -->|"loads pages"| node_routes
node_routes -->|"routes to"| node_home
node_routes -->|"routes to"| node_dashboard
node_routes -->|"routes to"| node_mobile_app
node_routes -->|"routes to"| node_ussd
node_home -->|"links to"| node_dashboard
node_dashboard -->|"renders"| node_rolelogin
node_dashboard -->|"renders"| node_police
node_dashboard -->|"renders"| node_vehicles
node_dashboard -->|"renders"| node_alerts
node_dashboard -->|"renders"| node_analytics
node_dashboard -->|"renders"| node_ai_prediction
node_dashboard -->|"renders"| node_admin
node_dashboard -->|"renders"| node_sidebar
node_dashboard -->|"renders"| node_topbar
node_police -->|"renders"| node_alerts
node_police -->|"renders"| node_vehicle_detail
node_vehicles -->|"opens"| node_vehicle_detail
node_mobile_app -->|"dispatches"| node_splash
node_mobile_app -->|"dispatches"| node_role_select
node_mobile_app -->|"dispatches"| node_mobile_login
node_mobile_app -->|"dispatches"| node_driver
node_mobile_app -->|"dispatches"| node_breath
node_mobile_app -->|"dispatches"| node_monitor
node_mobile_app -->|"dispatches"| node_history
node_mobile_app -->|"dispatches"| node_owner
node_mobile_app -->|"dispatches"| node_high_risk
node_mobile_app -->|"dispatches"| node_crash_prediction

click node_app "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/App.jsx"
click node_auth "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/lib/AuthContext.jsx"
click node_routes "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/pages.config.js"
click node_home "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/pages/Home.jsx"
click node_dashboard "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/pages/Dashboard.jsx"
click node_rolelogin "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/RoleLoginScreen.jsx"
click node_police "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/PoliceOverview.jsx"
click node_vehicles "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/VehiclesTable.jsx"
click node_vehicle_detail "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/VehicleDetailModal.jsx"
click node_alerts "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/AlertFeed.jsx"
click node_analytics "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/AnalyticsDashboard.jsx"
click node_ai_prediction "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/AIPredictionPanel.jsx"
click node_admin "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/AdminPanel.jsx"
click node_sidebar "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/DashboardSidebar.jsx"
click node_topbar "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/DashboardTopBar.jsx"
click node_mobile_app "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/pages/MobileApp.jsx"
click node_splash "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/SplashScreen.jsx"
click node_role_select "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/RoleSelection.jsx"
click node_mobile_login "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/LoginScreen.jsx"
click node_driver "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/DriverDashboard.jsx"
click node_breath "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/BreathTest.jsx"
click node_monitor "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/LiveMonitoring.jsx"
click node_history "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/DriverHistory.jsx"
click node_owner "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/OwnerDashboard.jsx"
click node_high_risk "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/HighRiskAlert.jsx"
click node_crash_prediction "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/AICrashPrediction.jsx"
click node_ussd "https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/pages/USSDPortal.jsx"

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_auth,node_routes,node_visitor toneBlue
class node_home toneAmber
class node_dashboard,node_rolelogin,node_police,node_vehicles,node_vehicle_detail,node_alerts,node_analytics,node_ai_prediction,node_admin,node_sidebar,node_topbar toneMint
class node_mobile_app,node_splash,node_role_select,node_mobile_login,node_driver,node_breath,node_monitor,node_history,node_owner,node_high_risk,node_crash_prediction toneRose
class node_ussd toneIndigo
```

## Components

### App Shell

- [App Router](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/App.jsx): `src/App.jsx`
- [Auth Context](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/lib/AuthContext.jsx): `src/lib/AuthContext.jsx`
- [Page Registry](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/pages.config.js): `src/pages.config.js`

### Public Entry

- [Landing Page](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`

### Operations Dashboard

- [Dashboard Dispatcher](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Role Login](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/RoleLoginScreen.jsx): `src/components/dashboard/RoleLoginScreen.jsx`
- [Police Overview](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/PoliceOverview.jsx): `src/components/dashboard/PoliceOverview.jsx`
- [Vehicle Management](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/VehiclesTable.jsx): `src/components/dashboard/VehiclesTable.jsx`
- [Vehicle Details](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/VehicleDetailModal.jsx): `src/components/dashboard/VehicleDetailModal.jsx`
- [Alert Feed](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/AlertFeed.jsx): `src/components/dashboard/AlertFeed.jsx`
- [Analytics Dashboard](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/AnalyticsDashboard.jsx): `src/components/dashboard/AnalyticsDashboard.jsx`
- [AI Risk Panel](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/AIPredictionPanel.jsx): `src/components/dashboard/AIPredictionPanel.jsx`
- [Admin Panel](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/AdminPanel.jsx): `src/components/dashboard/AdminPanel.jsx`
- [Dashboard Navigation](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/DashboardSidebar.jsx): `src/components/dashboard/DashboardSidebar.jsx`
- [Dashboard Header](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/dashboard/DashboardTopBar.jsx): `src/components/dashboard/DashboardTopBar.jsx`

### Mobile Experience

- [Mobile Dispatcher](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/pages/MobileApp.jsx): `src/pages/MobileApp.jsx`
- [Splash Screen](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/SplashScreen.jsx): `src/components/mobile/SplashScreen.jsx`
- [Role Selection](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/RoleSelection.jsx): `src/components/mobile/RoleSelection.jsx`
- [Mobile Login](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/LoginScreen.jsx): `src/components/mobile/LoginScreen.jsx`
- [Driver Dashboard](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/DriverDashboard.jsx): `src/components/mobile/DriverDashboard.jsx`
- [Breath Test](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/BreathTest.jsx): `src/components/mobile/BreathTest.jsx`
- [Live Monitoring](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/LiveMonitoring.jsx): `src/components/mobile/LiveMonitoring.jsx`
- [Driver History](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/DriverHistory.jsx): `src/components/mobile/DriverHistory.jsx`
- [Owner Dashboard](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/OwnerDashboard.jsx): `src/components/mobile/OwnerDashboard.jsx`
- [High Risk Alert](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/HighRiskAlert.jsx): `src/components/mobile/HighRiskAlert.jsx`
- [Crash Prediction](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/components/mobile/AICrashPrediction.jsx): `src/components/mobile/AICrashPrediction.jsx`

### USSD Portal

- [USSD Simulator](https://github.com/patrickuwimanikunda-dev/guardex-project/blob/main/src/pages/USSDPortal.jsx): `src/pages/USSDPortal.jsx`

### Other components

- **User**

## Connections

- User → App Router: opens
- App Router → Auth Context: provides auth (evidence: `src/App.jsx`)
- App Router → Page Registry: loads pages (evidence: `src/App.jsx`)
- Page Registry → Landing Page: routes to (evidence: `src/pages.config.js`)
- Page Registry → Dashboard Dispatcher: routes to (evidence: `src/pages.config.js`)
- Page Registry → Mobile Dispatcher: routes to (evidence: `src/pages.config.js`)
- Page Registry → USSD Simulator: routes to (evidence: `src/pages.config.js`)
- Landing Page → Dashboard Dispatcher: links to (evidence: `src/pages/Home.jsx`)
- Dashboard Dispatcher → Role Login: renders (evidence: `src/pages/Dashboard.jsx`)
- Dashboard Dispatcher → Police Overview: renders (evidence: `src/pages/Dashboard.jsx`)
- Dashboard Dispatcher → Vehicle Management: renders (evidence: `src/pages/Dashboard.jsx`)
- Dashboard Dispatcher → Alert Feed: renders (evidence: `src/pages/Dashboard.jsx`)
- Dashboard Dispatcher → Analytics Dashboard: renders (evidence: `src/pages/Dashboard.jsx`)
- Dashboard Dispatcher → AI Risk Panel: renders (evidence: `src/pages/Dashboard.jsx`)
- Dashboard Dispatcher → Admin Panel: renders (evidence: `src/pages/Dashboard.jsx`)
- Dashboard Dispatcher → Dashboard Navigation: renders (evidence: `src/pages/Dashboard.jsx`)
- Dashboard Dispatcher → Dashboard Header: renders (evidence: `src/pages/Dashboard.jsx`)
- Police Overview → Alert Feed: renders (evidence: `src/components/dashboard/PoliceOverview.jsx`)
- Police Overview → Vehicle Details: renders (evidence: `src/components/dashboard/PoliceOverview.jsx`)
- Vehicle Management → Vehicle Details: opens (evidence: `src/components/dashboard/VehiclesTable.jsx`)
- Mobile Dispatcher → Splash Screen: dispatches (evidence: `src/pages/MobileApp.jsx`)
- Mobile Dispatcher → Role Selection: dispatches (evidence: `src/pages/MobileApp.jsx`)
- Mobile Dispatcher → Mobile Login: dispatches (evidence: `src/pages/MobileApp.jsx`)
- Mobile Dispatcher → Driver Dashboard: dispatches (evidence: `src/pages/MobileApp.jsx`)
- Mobile Dispatcher → Breath Test: dispatches (evidence: `src/pages/MobileApp.jsx`)
- Mobile Dispatcher → Live Monitoring: dispatches (evidence: `src/pages/MobileApp.jsx`)
- Mobile Dispatcher → Driver History: dispatches (evidence: `src/pages/MobileApp.jsx`)
- Mobile Dispatcher → Owner Dashboard: dispatches (evidence: `src/pages/MobileApp.jsx`)
- Mobile Dispatcher → High Risk Alert: dispatches (evidence: `src/pages/MobileApp.jsx`)
- Mobile Dispatcher → Crash Prediction: dispatches (evidence: `src/pages/MobileApp.jsx`)
