# mohamed2007sarhan/indrive-lite architecture

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

- Interactive diagram: https://gitdiagram.com/mohamed2007sarhan/indrive-lite
- Repository: https://github.com/mohamed2007sarhan/indrive-lite

## Overview

InDrive Lite connects passengers and drivers through location-based ride requests, passenger-proposed fares, driver offers, and ride tracking, with separate account and administrator workflows. The sampled client code shows authentication, ride creation, offer polling and acceptance, while the server mounts authentication, ride, and admin APIs over a MySQL connection. Driver bidding, OTP verification, navigation, earnings, and complaint handling are README-documented capabilities; their internal wiring is not shown in the sampled source, so those links are kept at the documented subsystem level.

Main entry points: [`client/src/App.jsx`](https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/App.jsx) (Role-based app), [`client/src/utils/api.js`](https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/utils/api.js) (API client), [`server/index.js`](https://github.com/mohamed2007sarhan/indrive-lite/blob/main/server/index.js) (API server), [`client/src/pages/Client/RequestRide.jsx`](https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/pages/Client/RequestRide.jsx) (Request and track)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Passenger experience"]
  node_app["Role-based app<br/>[App.jsx]"]
  node_auth_pages["Sign in / register"]
  node_auth_context["Auth state<br/>[AuthContext.jsx]"]
  node_request["Request and track<br/>[RequestRide.jsx]"]
  node_location["Location lookup<br/>[location.js]"]
  node_map["Ride map<br/>[Map.jsx]"]
  node_settings["Account settings<br/>[Settings.jsx]"]
end

subgraph group_driver["Driver experience"]
  node_driver_dash["Driver dashboard<br/>[Dashboard.jsx]"]
end

subgraph group_server["API and persistence"]
  node_api["API client<br/>[api.js]"]
  node_server_entry["API server<br/>[index.js]"]
  node_auth_routes["Authentication API<br/>[auth.js]"]
  node_ride_routes["Ride and offers API<br/>[rides.js]"]
  node_admin_routes["Admin API<br/>[admin.js]"]
  node_db_module["Database connection<br/>[db.js]"]
  node_uploads[("Uploaded files")]
end

subgraph group_admin["Administration"]
  node_admin_dash["Admin dashboard<br/>[Dashboard.jsx]"]
end

node_passenger(("Passenger"))
node_driver_actor(("Driver"))
node_admin_actor(("Administrator"))
node_mysql[("MySQL")]

node_passenger -->|"uses"| node_app
node_driver_actor -->|"uses"| node_app
node_admin_actor -->|"uses"| node_app
node_app -->|"provides auth"| node_auth_context
node_app -->|"routes"| node_auth_pages
node_app -->|"routes"| node_request
node_app -->|"routes"| node_driver_dash
node_app -->|"routes"| node_admin_dash
node_app -->|"routes"| node_settings
node_auth_pages -->|"authenticates"| node_auth_context
node_auth_context -->|"requests auth"| node_api
node_request -->|"requests rides"| node_api
node_request -->|"looks up location"| node_location
node_request -->|"renders locations"| node_map
node_settings -->|"updates profile"| node_api
node_driver_dash -->|"uses ride API"| node_api
node_admin_dash -->|"requests admin data"| node_api
node_api -->|"sends requests"| node_server_entry
node_server_entry -->|"dispatches auth"| node_auth_routes
node_server_entry -->|"dispatches rides"| node_ride_routes
node_server_entry -->|"dispatches admin"| node_admin_routes
node_auth_routes -->|"queries users"| node_db_module
node_ride_routes -->|"accesses ride data"| node_db_module
node_admin_routes -->|"accesses admin data"| node_db_module
node_db_module -->|"connects"| node_mysql
node_auth_routes -->|"stores uploads"| node_uploads
node_server_entry -->|"serves files"| node_uploads

click node_app "https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/App.jsx"
click node_auth_pages "https://github.com/mohamed2007sarhan/indrive-lite/tree/main/client/src/pages/Auth"
click node_auth_context "https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/context/AuthContext.jsx"
click node_request "https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/pages/Client/RequestRide.jsx"
click node_location "https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/utils/location.js"
click node_map "https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/components/Map/Map.jsx"
click node_settings "https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/pages/Settings.jsx"
click node_driver_dash "https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/pages/Driver/Dashboard.jsx"
click node_api "https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/utils/api.js"
click node_server_entry "https://github.com/mohamed2007sarhan/indrive-lite/blob/main/server/index.js"
click node_auth_routes "https://github.com/mohamed2007sarhan/indrive-lite/blob/main/server/routes/auth.js"
click node_ride_routes "https://github.com/mohamed2007sarhan/indrive-lite/blob/main/server/routes/rides.js"
click node_admin_routes "https://github.com/mohamed2007sarhan/indrive-lite/blob/main/server/routes/admin.js"
click node_db_module "https://github.com/mohamed2007sarhan/indrive-lite/blob/main/server/db.js"
click node_admin_dash "https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/pages/Admin/Dashboard.jsx"
click node_uploads "https://github.com/mohamed2007sarhan/indrive-lite/tree/main/server"

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_pages,node_auth_context,node_request,node_location,node_map,node_settings toneBlue
class node_driver_dash,node_mysql toneAmber
class node_api,node_server_entry,node_auth_routes,node_ride_routes,node_admin_routes,node_db_module,node_uploads toneMint
class node_admin_dash toneRose
class node_passenger,node_driver_actor,node_admin_actor toneIndigo
```

## Components

### Passenger experience

- [Role-based app](https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Sign in / register](https://github.com/mohamed2007sarhan/indrive-lite/tree/main/client/src/pages/Auth): `client/src/pages/Auth`
- [Auth state](https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Request and track](https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/pages/Client/RequestRide.jsx): `client/src/pages/Client/RequestRide.jsx`
- [Location lookup](https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/utils/location.js): `client/src/utils/location.js`
- [Ride map](https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/components/Map/Map.jsx): `client/src/components/Map/Map.jsx`
- [Account settings](https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/pages/Settings.jsx): `client/src/pages/Settings.jsx`

### Driver experience

- [Driver dashboard](https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/pages/Driver/Dashboard.jsx): `client/src/pages/Driver/Dashboard.jsx`

### API and persistence

- [API client](https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/utils/api.js): `client/src/utils/api.js`
- [API server](https://github.com/mohamed2007sarhan/indrive-lite/blob/main/server/index.js): `server/index.js`
- [Authentication API](https://github.com/mohamed2007sarhan/indrive-lite/blob/main/server/routes/auth.js): `server/routes/auth.js`
- [Ride and offers API](https://github.com/mohamed2007sarhan/indrive-lite/blob/main/server/routes/rides.js): `server/routes/rides.js`
- [Admin API](https://github.com/mohamed2007sarhan/indrive-lite/blob/main/server/routes/admin.js): `server/routes/admin.js`
- [Database connection](https://github.com/mohamed2007sarhan/indrive-lite/blob/main/server/db.js): `server/db.js`
- [Uploaded files](https://github.com/mohamed2007sarhan/indrive-lite/tree/main/server): `server`

### Administration

- [Admin dashboard](https://github.com/mohamed2007sarhan/indrive-lite/blob/main/client/src/pages/Admin/Dashboard.jsx): `client/src/pages/Admin/Dashboard.jsx`

### Other components

- **Passenger**
- **Driver**
- **Administrator**
- **MySQL**

## Connections

- Passenger → Role-based app: uses
- Driver → Role-based app: uses
- Administrator → Role-based app: uses
- Role-based app → Auth state: provides auth
- Role-based app → Sign in / register: routes
- Role-based app → Request and track: routes
- Role-based app → Driver dashboard: routes
- Role-based app → Admin dashboard: routes
- Role-based app → Account settings: routes
- Sign in / register → Auth state: authenticates
- Auth state → API client: requests auth
- Request and track → API client: requests rides
- Request and track → Location lookup: looks up location
- Request and track → Ride map: renders locations
- Account settings → API client: updates profile
- Driver dashboard → API client: uses ride API
- Admin dashboard → API client: requests admin data
- API client → API server: sends requests
- API server → Authentication API: dispatches auth
- API server → Ride and offers API: dispatches rides
- API server → Admin API: dispatches admin
- Authentication API → Database connection: queries users
- Ride and offers API → Database connection: accesses ride data
- Admin API → Database connection: accesses admin data
- Database connection → MySQL: connects
- Authentication API → Uploaded files: stores uploads
- API server → Uploaded files: serves files
