How patel-prince-246/vehicle_rental_marketplace works
This is a MERN vehicle-rental marketplace for customers, individual owners, agencies, and platform administrators. The main customer journey is browse vehicles, inspect a listing, book it, complete payment and handover/return, then review the rental. Separate owner, agency, and admin dashboards support listing and verification workflows. The backend exposes role-protected REST routes, coordinates domain operations, and persists marketplace records in MongoDB. The graph combines sampled calls and imports with README-documented capabilities; some unsampled route and page internals are represented only at subsystem level.
Main entry points: App.jsx Route application · routes REST route groups · bookingController.js Booking lifecycle · adminController.js Administration
Components 32
Marketplace frontend
- Route application
frontend/src/App.jsx - Vehicle discovery
frontend/src/pages/Vehicles.jsx - Vehicle details
frontend/src/pages/VehicleDetails.jsx - Booking flow
frontend/src/pages/Booking.jsx - Login and registration
frontend/src/pages/Login.jsx - Session context
frontend/src/context/AuthContext.jsx - Customer dashboard
frontend/src/pages/CustomerDashboard.jsx - Host dashboards
frontend/src/pages/OwnerDashboard.jsx - Agency dashboard
frontend/src/pages/AgencyDashboard.jsx - Admin dashboard
frontend/src/pages/AdminDashboard.jsx - API client
frontend/src/services/api.js
Rental operations
- REST route groups
backend/routes - Identity and roles
backend/controllers/userController.js - Vehicle listings
backend/controllers/vehicleController.js - Booking lifecycle
backend/controllers/bookingController.js - Payments and refunds
backend/controllers/paymentController.js - Reviews and ratings
backend/controllers/reviewController.js - Administration
backend/controllers/adminController.js
Platform services
- Notifications
backend/utils/notificationService.js - Email delivery
backend/services/emailService.js - JWT and role checks
backend/middleware/authMiddleware.js - API server
backend/server.js
Marketplace data
- MongoDB
backend/config/db.js - User records
backend/models/User.js - Vehicle records
backend/models/Vehicle.js - Booking records
backend/models/Booking.js - Payment records
backend/models/Payment.js - Review records
backend/models/Review.js - Owner and agency records
backend/models/Owner.js
Other components
- Customer
- Owner or agency
- Administrator
Connections 48
- Customer → Route application: uses
frontend/src/App.jsx - Owner or agency → Route application: uses
- Administrator → Route application: uses
- Route application → Vehicle discovery: routes to
frontend/src/App.jsx - Route application → Vehicle details: routes to
frontend/src/App.jsx - Route application → Booking flow: routes to
frontend/src/App.jsx - Route application → Login and registration: routes to
frontend/src/App.jsx - Route application → Customer dashboard: routes to
frontend/src/App.jsx - Route application → Host dashboards: routes to
frontend/src/App.jsx - Route application → Agency dashboard: routes to
frontend/src/App.jsx - Route application → Admin dashboard: routes to
frontend/src/App.jsx - Login and registration → Session context: uses
- Session context → API client: calls
frontend/src/context/AuthContext.jsx - Agency dashboard → API client: calls
frontend/src/pages/AgencyDashboard.jsx - Admin dashboard → API client: calls
frontend/src/pages/AdminDashboard.jsx - Vehicle discovery → API client: requests listings
- Booking flow → API client: submits booking
- API client → API server: HTTP requests
- API server → MongoDB: connects
backend/server.js - API server → REST route groups: mounts
backend/server.js - REST route groups → JWT and role checks: protects routes
backend/routes/bookingRoutes.js - REST route groups → Identity and roles: dispatches
backend/routes/userRoutes.js - REST route groups → Vehicle listings: dispatches
backend/routes/vehicleRoutes.js - REST route groups → Booking lifecycle: dispatches
backend/routes/bookingRoutes.js - REST route groups → Payments and refunds: dispatches
backend/routes/paymentRoutes.js - REST route groups → Reviews and ratings: dispatches
backend/routes/reviewRoutes.js - REST route groups → Administration: dispatches
backend/routes/adminRoutes.js - Identity and roles → User records: reads and writes
backend/controllers/userController.js - Vehicle listings → Vehicle records: reads and writes
backend/controllers/vehicleController.js - Booking lifecycle → Booking records: reads and writes
backend/controllers/bookingController.js - Booking lifecycle → Vehicle records: checks availability
backend/controllers/bookingController.js - Booking lifecycle → User records: reads
backend/controllers/bookingController.js - Booking lifecycle → Owner and agency records: resolves host
backend/controllers/bookingController.js - Booking lifecycle → Payment records: updates refunds
backend/controllers/bookingController.js - Payments and refunds → Payment records: reads and writes
backend/controllers/paymentController.js - Reviews and ratings → Review records: reads and writes
backend/controllers/reviewController.js - Reviews and ratings → Booking records: checks completion
backend/controllers/reviewController.js - Reviews and ratings → Vehicle records: checks vehicle
backend/controllers/reviewController.js - Administration → User records: manages users
backend/controllers/adminController.js - Administration → Vehicle records: verifies listings
backend/controllers/adminController.js - Administration → Booking records: manages bookings
backend/controllers/adminController.js - Administration → Payment records: manages payments
backend/controllers/adminController.js - Administration → Review records: manages reviews
backend/controllers/adminController.js - Administration → Owner and agency records: verifies hosts
backend/controllers/adminController.js - Booking lifecycle → Email delivery: sends booking mail
backend/controllers/bookingController.js - Booking lifecycle → Notifications: notifies users
backend/controllers/bookingController.js - Reviews and ratings → Notifications: notifies on review
backend/controllers/reviewController.js - Administration → Notifications: sends notices
backend/controllers/adminController.js