# sasi-51/rent-ride architecture

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

- Interactive diagram: https://gitdiagram.com/sasi-51/rent-ride
- Repository: https://github.com/sasi-51/rent-ride

## Overview

Rent a Ride is a full-stack car-rental platform with user, admin, and vendor modules. The user workflow is to search and filter vehicles, select dates and locations, check availability, and complete a booking with payment; users can then manage profiles and orders. Vendors submit and manage vehicle listings, while admins manage bookings, users, vehicles, and vendor approvals. The graph uses README capability descriptions and the shown source/index references; some role-specific controller and page links are documented but not visible in sampled implementation excerpts.

Main entry points: [`backend/server.js`](https://github.com/sasi-51/rent-ride/blob/main/backend/server.js) (API routing), [`App.jsx`](https://github.com/sasi-51/rent-ride/blob/main/App.jsx) (Route access), [`backend/controllers/userControllers/userBookingController.js`](https://github.com/sasi-51/rent-ride/blob/main/backend/controllers/userControllers/userBookingController.js) (Booking workflow), [`backend/controllers/vendorControllers/vendorCrudController.js`](https://github.com/sasi-51/rent-ride/blob/main/backend/controllers/vendorControllers/vendorCrudController.js) (Vendor listings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_app["Route access<br/>[App.jsx]"]
  node_userflows["Browse and account"]
  node_checkout["Checkout and orders<br/>[CheckoutPage.jsx]"]
  node_adminui["Admin console"]
  node_vendorui["Vendor access<br/>[VendorAuth.jsx]"]
end

subgraph group_state["Client state"]
  node_clientstate["Redux state"]
end

subgraph group_rental["Rental backend"]
  node_api["API routing<br/>[server.js]"]
  node_auth["Authentication<br/>[authController.js]"]
  node_vehicles["Vehicle search"]
  node_booking["Booking workflow"]
end

subgraph group_operations["Platform operations"]
  node_vendorlisting["Vendor listings"]
  node_adminops["Admin management"]
  node_vendoraccounts["Vendor accounts"]
end

subgraph group_data["Persistence and services"]
  node_bookingsdb[("Bookings<br/>[BookingModel.js]")]
  node_vehiclesdb[("Vehicles<br/>[vehicleModel.js]")]
  node_usersdb[("User records<br/>[userModel.js]")]
  node_masterdata[("Locations and models<br/>[masterDataModel.js]")]
  node_availability["Availability check"]
  node_media["Media storage"]
end

node_user(("User"))
node_vendor(("Vendor"))
node_admin(("Admin"))
node_payment["Razorpay"]

node_user -->|"uses"| node_app
node_vendor -->|"uses"| node_app
node_admin -->|"uses"| node_app
node_app -->|"routes to"| node_userflows
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_adminui
node_app -->|"routes to"| node_vendorui
node_userflows -->|"updates"| node_clientstate
node_userflows -.->|"searches"| node_api
node_checkout -.->|"submits booking"| node_api
node_checkout -.->|"processes payment"| node_payment
node_api -->|"routes requests"| node_auth
node_api -->|"routes requests"| node_vehicles
node_api -->|"routes requests"| node_booking
node_api -->|"routes requests"| node_adminops
node_api -->|"routes requests"| node_vendorlisting
node_auth -->|"reads and writes"| node_usersdb
node_vehicles -->|"queries"| node_vehiclesdb
node_booking -->|"checks dates"| node_availability
node_booking -->|"stores bookings"| node_bookingsdb
node_booking -->|"queries vehicles"| node_vehiclesdb
node_vendorlisting -->|"creates listings"| node_vehiclesdb
node_vendorlisting -->|"uploads media"| node_media
node_vendorlisting -.->|"requests approval"| node_adminops
node_adminops -->|"manages listings"| node_vehiclesdb
node_adminops -->|"manages reference data"| node_masterdata
node_vendoraccounts -->|"reads accounts"| node_usersdb
node_adminui -.->|"manages platform"| node_api
node_vendorui -.->|"manages listings"| node_api

click node_app "https://github.com/sasi-51/rent-ride/blob/main/App.jsx"
click node_userflows "https://github.com/sasi-51/rent-ride/tree/main/pages/user"
click node_checkout "https://github.com/sasi-51/rent-ride/blob/main/pages/user/CheckoutPage.jsx"
click node_adminui "https://github.com/sasi-51/rent-ride/tree/main/pages/admin"
click node_vendorui "https://github.com/sasi-51/rent-ride/blob/main/components/VendorAuth.jsx"
click node_clientstate "https://github.com/sasi-51/rent-ride/tree/main/redux"
click node_api "https://github.com/sasi-51/rent-ride/blob/main/backend/server.js"
click node_auth "https://github.com/sasi-51/rent-ride/blob/main/backend/controllers/authController.js"
click node_vehicles "https://github.com/sasi-51/rent-ride/blob/main/backend/controllers/userControllers/userAllVehiclesController.js"
click node_booking "https://github.com/sasi-51/rent-ride/blob/main/backend/controllers/userControllers/userBookingController.js"
click node_vendorlisting "https://github.com/sasi-51/rent-ride/blob/main/backend/controllers/vendorControllers/vendorCrudController.js"
click node_adminops "https://github.com/sasi-51/rent-ride/tree/main/backend/controllers/adminControllers"
click node_vendoraccounts "https://github.com/sasi-51/rent-ride/blob/main/backend/controllers/vendorControllers/vendorController.js"
click node_bookingsdb "https://github.com/sasi-51/rent-ride/blob/main/backend/models/BookingModel.js"
click node_vehiclesdb "https://github.com/sasi-51/rent-ride/blob/main/backend/models/vehicleModel.js"
click node_usersdb "https://github.com/sasi-51/rent-ride/blob/main/backend/models/userModel.js"
click node_masterdata "https://github.com/sasi-51/rent-ride/blob/main/backend/models/masterDataModel.js"
click node_availability "https://github.com/sasi-51/rent-ride/blob/main/backend/services/checkAvailableVehicle.js"
click node_media "https://github.com/sasi-51/rent-ride/blob/main/backend/utils/cloudinaryConfig.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_userflows,node_checkout,node_adminui,node_vendorui,node_user toneBlue
class node_clientstate toneAmber
class node_api,node_auth,node_vehicles,node_booking toneMint
class node_vendorlisting,node_adminops,node_vendoraccounts toneRose
class node_bookingsdb,node_vehiclesdb,node_usersdb,node_masterdata,node_availability,node_media,node_vendor,node_admin,node_payment toneIndigo
```

## Components

### Client experience

- [Route access](https://github.com/sasi-51/rent-ride/blob/main/App.jsx): `App.jsx`
- [Browse and account](https://github.com/sasi-51/rent-ride/tree/main/pages/user): `pages/user`
- [Checkout and orders](https://github.com/sasi-51/rent-ride/blob/main/pages/user/CheckoutPage.jsx): `pages/user/CheckoutPage.jsx`
- [Admin console](https://github.com/sasi-51/rent-ride/tree/main/pages/admin): `pages/admin`
- [Vendor access](https://github.com/sasi-51/rent-ride/blob/main/components/VendorAuth.jsx): `components/VendorAuth.jsx`

### Client state

- [Redux state](https://github.com/sasi-51/rent-ride/tree/main/redux): `redux`

### Rental backend

- [API routing](https://github.com/sasi-51/rent-ride/blob/main/backend/server.js): `backend/server.js`
- [Authentication](https://github.com/sasi-51/rent-ride/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [Vehicle search](https://github.com/sasi-51/rent-ride/blob/main/backend/controllers/userControllers/userAllVehiclesController.js): `backend/controllers/userControllers/userAllVehiclesController.js`
- [Booking workflow](https://github.com/sasi-51/rent-ride/blob/main/backend/controllers/userControllers/userBookingController.js): `backend/controllers/userControllers/userBookingController.js`

### Platform operations

- [Vendor listings](https://github.com/sasi-51/rent-ride/blob/main/backend/controllers/vendorControllers/vendorCrudController.js): `backend/controllers/vendorControllers/vendorCrudController.js`
- [Admin management](https://github.com/sasi-51/rent-ride/tree/main/backend/controllers/adminControllers): `backend/controllers/adminControllers`
- [Vendor accounts](https://github.com/sasi-51/rent-ride/blob/main/backend/controllers/vendorControllers/vendorController.js): `backend/controllers/vendorControllers/vendorController.js`

### Persistence and services

- [Bookings](https://github.com/sasi-51/rent-ride/blob/main/backend/models/BookingModel.js): `backend/models/BookingModel.js`
- [Vehicles](https://github.com/sasi-51/rent-ride/blob/main/backend/models/vehicleModel.js): `backend/models/vehicleModel.js`
- [User records](https://github.com/sasi-51/rent-ride/blob/main/backend/models/userModel.js): `backend/models/userModel.js`
- [Locations and models](https://github.com/sasi-51/rent-ride/blob/main/backend/models/masterDataModel.js): `backend/models/masterDataModel.js`
- [Availability check](https://github.com/sasi-51/rent-ride/blob/main/backend/services/checkAvailableVehicle.js): `backend/services/checkAvailableVehicle.js`
- [Media storage](https://github.com/sasi-51/rent-ride/blob/main/backend/utils/cloudinaryConfig.js): `backend/utils/cloudinaryConfig.js`

### Other components

- **User**
- **Vendor**
- **Admin**
- **Razorpay**

## Connections

- User → Route access: uses
- Vendor → Route access: uses
- Admin → Route access: uses
- Route access → Browse and account: routes to (evidence: `App.jsx`)
- Route access → Checkout and orders: routes to (evidence: `App.jsx`)
- Route access → Admin console: routes to (evidence: `App.jsx`)
- Route access → Vendor access: routes to (evidence: `App.jsx`)
- Browse and account → Redux state: updates (evidence: `pages/user/CarSearch.jsx`)
- Browse and account → API routing: searches
- Checkout and orders → API routing: submits booking
- Checkout and orders → Razorpay: processes payment
- API routing → Authentication: routes requests (evidence: `backend/server.js`)
- API routing → Vehicle search: routes requests (evidence: `backend/server.js`)
- API routing → Booking workflow: routes requests (evidence: `backend/server.js`)
- API routing → Admin management: routes requests (evidence: `backend/server.js`)
- API routing → Vendor listings: routes requests (evidence: `backend/server.js`)
- Authentication → User records: reads and writes (evidence: `backend/controllers/authController.js`)
- Vehicle search → Vehicles: queries (evidence: `backend/controllers/userControllers/userAllVehiclesController.js`)
- Booking workflow → Availability check: checks dates (evidence: `backend/controllers/userControllers/userBookingController.js`)
- Booking workflow → Bookings: stores bookings (evidence: `backend/controllers/userControllers/userBookingController.js`)
- Booking workflow → Vehicles: queries vehicles (evidence: `backend/controllers/userControllers/userBookingController.js`)
- Vendor listings → Vehicles: creates listings (evidence: `backend/controllers/vendorControllers/vendorCrudController.js`)
- Vendor listings → Media storage: uploads media (evidence: `backend/controllers/vendorControllers/vendorCrudController.js`)
- Vendor listings → Admin management: requests approval
- Admin management → Vehicles: manages listings (evidence: `backend/controllers/adminControllers/dashboardController.js`)
- Admin management → Locations and models: manages reference data (evidence: `backend/controllers/adminControllers/masterCollectionController.js`)
- Vendor accounts → User records: reads accounts (evidence: `backend/controllers/vendorControllers/vendorController.js`)
- Admin console → API routing: manages platform
- Vendor access → API routing: manages listings
