# nishant-838/rideshare architecture

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

- Interactive diagram: https://gitdiagram.com/nishant-838/rideshare
- Repository: https://github.com/nishant-838/rideshare

## Overview

RideShare supports renters booking and paying for bikes, while owners manage a fleet and review revenue and rider feedback; it also provides live ride tracking. The sampled backend shows the bike, booking, payment, and socket flows, and the frontend route map identifies the main user-facing areas. The README offers no additional product detail, and most page-to-API wiring was not sampled, so those links are omitted where not evidenced.

Main entry points: [`Frontend/src/App.jsx`](https://github.com/nishant-838/rideshare/blob/main/Frontend/src/App.jsx) (Route App), [`Backend/server.js`](https://github.com/nishant-838/rideshare/blob/main/Backend/server.js) (HTTP and Socket Server), [`Backend/controllers/paymentController.js`](https://github.com/nishant-838/rideshare/blob/main/Backend/controllers/paymentController.js) (Payment Operations), [`Backend/controllers/bikeController.js`](https://github.com/nishant-838/rideshare/blob/main/Backend/controllers/bikeController.js) (Bike Operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Rider and Owner App"]
  node_app["Route App<br/>[App.jsx]"]
  node_browse["Browse Bikes<br/>[AvailableBike.jsx]"]
  node_details["Bike Details<br/>[BikeDetails.jsx]"]
  node_booking_ui["Booking Flow<br/>[BikeBooking.jsx]"]
  node_bookings_ui["My Bookings<br/>[MyBookings.jsx]"]
  node_payment_ui["Payment History<br/>[PaymentHistory.jsx]"]
  node_owner_fleet["Fleet Dashboard<br/>[MyVehicles.jsx]"]
  node_owner_analytics["Owner Analytics<br/>[Analytics.jsx]"]
  node_reviews_ui["Owner Reviews<br/>[ownerReview.jsx]"]
  node_tracking_ui["Ride Tracking<br/>[DriverTracker.jsx]"]
  node_customer_map["Customer Map<br/>[CustomerMap.jsx]"]
  node_api_client["HTTP Client<br/>[axios.js]"]
end

subgraph group_api["Backend API"]
  node_server["HTTP and Socket Server<br/>[server.js]"]
  node_bike_routes["Bike Routes<br/>[bikeRoutes.js]"]
  node_booking_routes["Booking Routes<br/>[bookingRoutes.js]"]
  node_payment_routes["Payment Routes<br/>[paymentRoutes.js]"]
  node_review_routes["Review Routes<br/>[Review.js]"]
  node_db["MongoDB Connection<br/>[db.js]"]
end

subgraph group_domain["Rental Domain"]
  node_bike_controller["Bike Operations<br/>[bikeController.js]"]
  node_booking_controller["Booking Operations"]
  node_payment_controller["Payment Operations"]
  node_bike_model[("Bike Records<br/>[Bike.js]")]
  node_booking_model[("Booking Records<br/>[Booking.js]")]
  node_payment_model[("Payment Records<br/>[Payment.js]")]
  node_review_model[("Review Records<br/>[Review.js]")]
end

subgraph group_integrations["External Services"]
  node_cloudinary["Cloudinary Media<br/>[cloudinary.js]"]
  node_razorpay["Razorpay"]
  node_mongo[("MongoDB")]
end

node_renter(("Renter"))
node_owner(("Bike Owner"))
node_mobile(("Rider Device"))

node_app -->|"routes to"| node_browse
node_app -->|"routes to"| node_details
node_app -->|"routes to"| node_booking_ui
node_app -->|"routes to"| node_bookings_ui
node_app -->|"routes to"| node_payment_ui
node_app -->|"routes to"| node_owner_fleet
node_app -->|"routes to"| node_owner_analytics
node_app -->|"routes to"| node_reviews_ui
node_app -->|"routes to"| node_tracking_ui
node_app -->|"routes to"| node_customer_map
node_owner -->|"manages fleet"| node_owner_fleet
node_owner -->|"views revenue"| node_owner_analytics
node_renter -->|"browses"| node_browse
node_renter -->|"requests rental"| node_booking_ui
node_renter -->|"views payments"| node_payment_ui
node_reviews_ui -->|"requests reviews"| node_api_client
node_api_client -->|"sends requests"| node_server
node_server -->|"mounts"| node_bike_routes
node_server -->|"mounts"| node_booking_routes
node_server -->|"mounts"| node_payment_routes
node_server -->|"mounts"| node_review_routes
node_bike_routes -->|"dispatches"| node_bike_controller
node_booking_routes -->|"dispatches"| node_booking_controller
node_payment_routes -->|"dispatches"| node_payment_controller
node_review_routes -->|"routes reviews"| node_review_model
node_bike_controller -->|"reads and writes"| node_bike_model
node_bike_controller -->|"checks bookings"| node_booking_model
node_booking_controller -->|"reads bike"| node_bike_model
node_booking_controller -->|"reads and writes"| node_booking_model
node_payment_controller -->|"reads and updates"| node_booking_model
node_payment_controller -->|"creates and reads"| node_payment_model
node_bike_controller -->|"uploads images"| node_cloudinary
node_payment_controller -->|"creates orders"| node_razorpay
node_payment_controller -->|"fetches payment"| node_razorpay
node_db -->|"connects"| node_mongo
node_mobile -->|"sends location"| node_server
node_server -->|"looks up owner"| node_bike_model
node_server -->|"dispatches ride updates"| node_owner
node_tracking_ui -.->|"uses live tracking"| node_server
node_customer_map -.->|"receives ride updates"| node_server
node_owner -->|"reviews feedback"| node_reviews_ui

click node_app "https://github.com/nishant-838/rideshare/blob/main/Frontend/src/App.jsx"
click node_browse "https://github.com/nishant-838/rideshare/blob/main/Frontend/src/pages/AvailableBike.jsx"
click node_details "https://github.com/nishant-838/rideshare/blob/main/Frontend/src/pages/BikeDetails.jsx"
click node_booking_ui "https://github.com/nishant-838/rideshare/blob/main/Frontend/src/pages/BikeBooking.jsx"
click node_bookings_ui "https://github.com/nishant-838/rideshare/blob/main/Frontend/src/pages/MyBookings.jsx"
click node_payment_ui "https://github.com/nishant-838/rideshare/blob/main/Frontend/src/pages/PaymentHistory.jsx"
click node_owner_fleet "https://github.com/nishant-838/rideshare/blob/main/Frontend/src/pages/MyVehicles.jsx"
click node_owner_analytics "https://github.com/nishant-838/rideshare/blob/main/Frontend/src/ownerComponents/Analytics.jsx"
click node_reviews_ui "https://github.com/nishant-838/rideshare/blob/main/Frontend/src/pages/ownerReview.jsx"
click node_tracking_ui "https://github.com/nishant-838/rideshare/blob/main/Frontend/src/pages/DriverTracker.jsx"
click node_customer_map "https://github.com/nishant-838/rideshare/blob/main/Frontend/src/pages/CustomerMap.jsx"
click node_api_client "https://github.com/nishant-838/rideshare/blob/main/Frontend/src/api/axios.js"
click node_server "https://github.com/nishant-838/rideshare/blob/main/Backend/server.js"
click node_bike_routes "https://github.com/nishant-838/rideshare/blob/main/Backend/routes/bikeRoutes.js"
click node_booking_routes "https://github.com/nishant-838/rideshare/blob/main/Backend/routes/bookingRoutes.js"
click node_payment_routes "https://github.com/nishant-838/rideshare/blob/main/Backend/routes/paymentRoutes.js"
click node_review_routes "https://github.com/nishant-838/rideshare/blob/main/Backend/routes/Review.js"
click node_bike_controller "https://github.com/nishant-838/rideshare/blob/main/Backend/controllers/bikeController.js"
click node_booking_controller "https://github.com/nishant-838/rideshare/blob/main/Backend/controllers/bookingController.js"
click node_payment_controller "https://github.com/nishant-838/rideshare/blob/main/Backend/controllers/paymentController.js"
click node_bike_model "https://github.com/nishant-838/rideshare/blob/main/Backend/models/Bike.js"
click node_booking_model "https://github.com/nishant-838/rideshare/blob/main/Backend/models/Booking.js"
click node_payment_model "https://github.com/nishant-838/rideshare/blob/main/Backend/models/Payment.js"
click node_review_model "https://github.com/nishant-838/rideshare/blob/main/Backend/models/Review.js"
click node_db "https://github.com/nishant-838/rideshare/blob/main/Backend/db.js"
click node_cloudinary "https://github.com/nishant-838/rideshare/blob/main/Backend/config/cloudinary.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_browse,node_details,node_booking_ui,node_bookings_ui,node_payment_ui,node_owner_fleet,node_owner_analytics,node_reviews_ui,node_tracking_ui,node_customer_map,node_api_client toneBlue
class node_server,node_bike_routes,node_booking_routes,node_payment_routes,node_review_routes,node_db toneAmber
class node_bike_controller,node_booking_controller,node_payment_controller,node_bike_model,node_booking_model,node_payment_model,node_review_model toneMint
class node_cloudinary,node_razorpay,node_mongo toneRose
class node_renter,node_owner,node_mobile toneIndigo
```

## Components

### Rider and Owner App

- [Route App](https://github.com/nishant-838/rideshare/blob/main/Frontend/src/App.jsx): `Frontend/src/App.jsx`
- [Browse Bikes](https://github.com/nishant-838/rideshare/blob/main/Frontend/src/pages/AvailableBike.jsx): `Frontend/src/pages/AvailableBike.jsx`
- [Bike Details](https://github.com/nishant-838/rideshare/blob/main/Frontend/src/pages/BikeDetails.jsx): `Frontend/src/pages/BikeDetails.jsx`
- [Booking Flow](https://github.com/nishant-838/rideshare/blob/main/Frontend/src/pages/BikeBooking.jsx): `Frontend/src/pages/BikeBooking.jsx`
- [My Bookings](https://github.com/nishant-838/rideshare/blob/main/Frontend/src/pages/MyBookings.jsx): `Frontend/src/pages/MyBookings.jsx`
- [Payment History](https://github.com/nishant-838/rideshare/blob/main/Frontend/src/pages/PaymentHistory.jsx): `Frontend/src/pages/PaymentHistory.jsx`
- [Fleet Dashboard](https://github.com/nishant-838/rideshare/blob/main/Frontend/src/pages/MyVehicles.jsx): `Frontend/src/pages/MyVehicles.jsx`
- [Owner Analytics](https://github.com/nishant-838/rideshare/blob/main/Frontend/src/ownerComponents/Analytics.jsx): `Frontend/src/ownerComponents/Analytics.jsx`
- [Owner Reviews](https://github.com/nishant-838/rideshare/blob/main/Frontend/src/pages/ownerReview.jsx): `Frontend/src/pages/ownerReview.jsx`
- [Ride Tracking](https://github.com/nishant-838/rideshare/blob/main/Frontend/src/pages/DriverTracker.jsx): `Frontend/src/pages/DriverTracker.jsx`
- [Customer Map](https://github.com/nishant-838/rideshare/blob/main/Frontend/src/pages/CustomerMap.jsx): `Frontend/src/pages/CustomerMap.jsx`
- [HTTP Client](https://github.com/nishant-838/rideshare/blob/main/Frontend/src/api/axios.js): `Frontend/src/api/axios.js`

### Backend API

- [HTTP and Socket Server](https://github.com/nishant-838/rideshare/blob/main/Backend/server.js): `Backend/server.js`
- [Bike Routes](https://github.com/nishant-838/rideshare/blob/main/Backend/routes/bikeRoutes.js): `Backend/routes/bikeRoutes.js`
- [Booking Routes](https://github.com/nishant-838/rideshare/blob/main/Backend/routes/bookingRoutes.js): `Backend/routes/bookingRoutes.js`
- [Payment Routes](https://github.com/nishant-838/rideshare/blob/main/Backend/routes/paymentRoutes.js): `Backend/routes/paymentRoutes.js`
- [Review Routes](https://github.com/nishant-838/rideshare/blob/main/Backend/routes/Review.js): `Backend/routes/Review.js`
- [MongoDB Connection](https://github.com/nishant-838/rideshare/blob/main/Backend/db.js): `Backend/db.js`

### Rental Domain

- [Bike Operations](https://github.com/nishant-838/rideshare/blob/main/Backend/controllers/bikeController.js): `Backend/controllers/bikeController.js`
- [Booking Operations](https://github.com/nishant-838/rideshare/blob/main/Backend/controllers/bookingController.js): `Backend/controllers/bookingController.js`
- [Payment Operations](https://github.com/nishant-838/rideshare/blob/main/Backend/controllers/paymentController.js): `Backend/controllers/paymentController.js`
- [Bike Records](https://github.com/nishant-838/rideshare/blob/main/Backend/models/Bike.js): `Backend/models/Bike.js`
- [Booking Records](https://github.com/nishant-838/rideshare/blob/main/Backend/models/Booking.js): `Backend/models/Booking.js`
- [Payment Records](https://github.com/nishant-838/rideshare/blob/main/Backend/models/Payment.js): `Backend/models/Payment.js`
- [Review Records](https://github.com/nishant-838/rideshare/blob/main/Backend/models/Review.js): `Backend/models/Review.js`

### External Services

- [Cloudinary Media](https://github.com/nishant-838/rideshare/blob/main/Backend/config/cloudinary.js): `Backend/config/cloudinary.js`
- **Razorpay**
- **MongoDB**

### Other components

- **Renter**
- **Bike Owner**
- **Rider Device**

## Connections

- Route App → Browse Bikes: routes to
- Route App → Bike Details: routes to
- Route App → Booking Flow: routes to
- Route App → My Bookings: routes to
- Route App → Payment History: routes to
- Route App → Fleet Dashboard: routes to
- Route App → Owner Analytics: routes to
- Route App → Owner Reviews: routes to
- Route App → Ride Tracking: routes to
- Route App → Customer Map: routes to
- Bike Owner → Fleet Dashboard: manages fleet
- Bike Owner → Owner Analytics: views revenue
- Renter → Browse Bikes: browses
- Renter → Booking Flow: requests rental
- Renter → Payment History: views payments
- Owner Reviews → HTTP Client: requests reviews
- HTTP Client → HTTP and Socket Server: sends requests
- HTTP and Socket Server → Bike Routes: mounts
- HTTP and Socket Server → Booking Routes: mounts
- HTTP and Socket Server → Payment Routes: mounts
- HTTP and Socket Server → Review Routes: mounts
- Bike Routes → Bike Operations: dispatches
- Booking Routes → Booking Operations: dispatches
- Payment Routes → Payment Operations: dispatches
- Review Routes → Review Records: routes reviews
- Bike Operations → Bike Records: reads and writes
- Bike Operations → Booking Records: checks bookings
- Booking Operations → Bike Records: reads bike
- Booking Operations → Booking Records: reads and writes
- Payment Operations → Booking Records: reads and updates
- Payment Operations → Payment Records: creates and reads
- Bike Operations → Cloudinary Media: uploads images
- Payment Operations → Razorpay: creates orders
- Payment Operations → Razorpay: fetches payment
- MongoDB Connection → MongoDB: connects
- Rider Device → HTTP and Socket Server: sends location
- HTTP and Socket Server → Bike Records: looks up owner
- HTTP and Socket Server → Bike Owner: dispatches ride updates
- Ride Tracking → HTTP and Socket Server: uses live tracking
- Customer Map → HTTP and Socket Server: receives ride updates
- Bike Owner → Owner Reviews: reviews feedback
