# shalyagaonkar520-web/taxi architecture

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

- Interactive diagram: https://gitdiagram.com/shalyagaonkar520-web/taxi
- Repository: https://github.com/shalyagaonkar520-web/taxi

## Overview

NexRide is a role-based ride-hailing platform. Riders search locations, compare route and vehicle-tier quotes, request rides, follow dispatch and trip progress, then settle and review; drivers receive requests and manage arrival, PIN verification, navigation, and completion; admins monitor fleet and revenue and adjust pricing controls. The sampled frontend and API code supports the main entry points and quote flow; README-described real-time trip events and other capabilities are represented where their owning modules are evident, but unsampled event wiring is not detailed.

Main entry points: [`client/src/App.jsx`](https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/App.jsx) (Role App), [`client/src/services/api.js`](https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/services/api.js) (REST Client), [`server/src/server.js`](https://github.com/shalyagaonkar520-web/taxi/blob/main/server/src/server.js) (HTTP API), [`client/src/services/socket.js`](https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/services/socket.js) (Realtime Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Role Workspaces"]
  node_app["Role App<br/>[App.jsx]"]
  node_rider_view["Rider Booking<br/>[RiderView.jsx]"]
  node_driver_view["Driver Workspace<br/>[DriverView.jsx]"]
  node_admin_view["Admin Console<br/>[AdminView.jsx]"]
  node_map["Live Map<br/>[LiveMap.jsx]"]
  node_wallet["Wallet<br/>[WalletModal.jsx]"]
  node_history["Trip History<br/>[HistoryModal.jsx]"]
end

subgraph group_dispatch["Ride Operations"]
  node_api["REST Client<br/>[api.js]"]
  node_client_socket["Realtime Client<br/>[socket.js]"]
end

subgraph group_backend["Platform Services"]
  node_server["HTTP API<br/>[server.js]"]
  node_socket_server["Socket Events<br/>[socket.js]"]
  node_routing["Routing &amp; Places<br/>[routing.js]"]
  node_pricing["Fare Pricing<br/>[pricing.js]"]
end

subgraph group_state["Platform State"]
  node_db_module["Data Access<br/>[db.js]"]
  node_db_file[("JSON State<br/>[db.json]")]
end

node_rider(("Rider"))
node_driver(("Driver"))
node_admin(("Admin"))
node_osrm["OSRM"]
node_geocoding["Geocoding APIs"]

node_rider -->|"opens role"| node_app
node_driver -->|"opens role"| node_app
node_admin -->|"opens role"| node_app
node_app -->|"renders"| node_rider_view
node_app -->|"renders"| node_driver_view
node_app -->|"renders"| node_admin_view
node_app -->|"renders"| node_map
node_app -->|"loads user and ride"| node_api
node_app -->|"registers user"| node_client_socket
node_rider_view -->|"searches and quotes"| node_api
node_rider_view -->|"ride updates"| node_client_socket
node_driver_view -->|"trip controls"| node_client_socket
node_admin_view -->|"loads and updates"| node_api
node_wallet -->|"reads and tops up"| node_api
node_history -->|"loads history"| node_api
node_api -->|"REST requests"| node_server
node_client_socket -->|"socket events"| node_socket_server
node_server -->|"reads and writes"| node_db_module
node_socket_server -->|"ride state access"| node_db_module
node_db_module -->|"persists data"| node_db_file
node_server -->|"searches and routes"| node_routing
node_server -->|"calculates quotes"| node_pricing
node_server -->|"reads settings"| node_db_module
node_routing -.->|"requests driving routes"| node_osrm
node_routing -.->|"searches places"| node_geocoding

click node_app "https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/App.jsx"
click node_rider_view "https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/components/Rider/RiderView.jsx"
click node_driver_view "https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/components/Driver/DriverView.jsx"
click node_admin_view "https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/components/Admin/AdminView.jsx"
click node_map "https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/components/Map/LiveMap.jsx"
click node_wallet "https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/components/WalletModal.jsx"
click node_history "https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/components/HistoryModal.jsx"
click node_api "https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/services/api.js"
click node_client_socket "https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/services/socket.js"
click node_server "https://github.com/shalyagaonkar520-web/taxi/blob/main/server/src/server.js"
click node_socket_server "https://github.com/shalyagaonkar520-web/taxi/blob/main/server/src/socket.js"
click node_routing "https://github.com/shalyagaonkar520-web/taxi/blob/main/server/src/services/routing.js"
click node_pricing "https://github.com/shalyagaonkar520-web/taxi/blob/main/server/src/services/pricing.js"
click node_db_module "https://github.com/shalyagaonkar520-web/taxi/blob/main/server/src/db.js"
click node_db_file "https://github.com/shalyagaonkar520-web/taxi/blob/main/server/data/db.json"

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_rider_view,node_driver_view,node_admin_view,node_map,node_wallet,node_history toneBlue
class node_api,node_client_socket toneAmber
class node_server,node_socket_server,node_routing,node_pricing,node_geocoding toneMint
class node_db_module,node_db_file toneRose
class node_rider,node_driver,node_admin,node_osrm toneIndigo
```

## Components

### Role Workspaces

- [Role App](https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Rider Booking](https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/components/Rider/RiderView.jsx): `client/src/components/Rider/RiderView.jsx`
- [Driver Workspace](https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/components/Driver/DriverView.jsx): `client/src/components/Driver/DriverView.jsx`
- [Admin Console](https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/components/Admin/AdminView.jsx): `client/src/components/Admin/AdminView.jsx`
- [Live Map](https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/components/Map/LiveMap.jsx): `client/src/components/Map/LiveMap.jsx`
- [Wallet](https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/components/WalletModal.jsx): `client/src/components/WalletModal.jsx`
- [Trip History](https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/components/HistoryModal.jsx): `client/src/components/HistoryModal.jsx`

### Ride Operations

- [REST Client](https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/services/api.js): `client/src/services/api.js`
- [Realtime Client](https://github.com/shalyagaonkar520-web/taxi/blob/main/client/src/services/socket.js): `client/src/services/socket.js`

### Platform Services

- [HTTP API](https://github.com/shalyagaonkar520-web/taxi/blob/main/server/src/server.js): `server/src/server.js`
- [Socket Events](https://github.com/shalyagaonkar520-web/taxi/blob/main/server/src/socket.js): `server/src/socket.js`
- [Routing & Places](https://github.com/shalyagaonkar520-web/taxi/blob/main/server/src/services/routing.js): `server/src/services/routing.js`
- [Fare Pricing](https://github.com/shalyagaonkar520-web/taxi/blob/main/server/src/services/pricing.js): `server/src/services/pricing.js`

### Platform State

- [Data Access](https://github.com/shalyagaonkar520-web/taxi/blob/main/server/src/db.js): `server/src/db.js`
- [JSON State](https://github.com/shalyagaonkar520-web/taxi/blob/main/server/data/db.json): `server/data/db.json`

### Other components

- **Rider**
- **Driver**
- **Admin**
- **OSRM**
- **Geocoding APIs**

## Connections

- Rider → Role App: opens role
- Driver → Role App: opens role
- Admin → Role App: opens role
- Role App → Rider Booking: renders
- Role App → Driver Workspace: renders
- Role App → Admin Console: renders
- Role App → Live Map: renders
- Role App → REST Client: loads user and ride
- Role App → Realtime Client: registers user
- Rider Booking → REST Client: searches and quotes
- Rider Booking → Realtime Client: ride updates
- Driver Workspace → Realtime Client: trip controls
- Admin Console → REST Client: loads and updates
- Wallet → REST Client: reads and tops up
- Trip History → REST Client: loads history
- REST Client → HTTP API: REST requests
- Realtime Client → Socket Events: socket events
- HTTP API → Data Access: reads and writes
- Socket Events → Data Access: ride state access
- Data Access → JSON State: persists data
- HTTP API → Routing & Places: searches and routes
- HTTP API → Fare Pricing: calculates quotes
- HTTP API → Data Access: reads settings
- Routing & Places → OSRM: requests driving routes
- Routing & Places → Geocoding APIs: searches places
