How arnavvvvvvvvvv/carrental works
A full-stack car-rental platform: renters browse cars, check date/location availability, book, and review booking history; vehicle owners list cars, manage availability and bookings, and view dashboard statistics. The graph follows the documented client routes and sampled server dispatch, controller, and model interactions. Some page-level API wiring is not sampled, so those links are omitted.
Main entry points: App.jsx App routes · Layout.jsx Owner portal · ownerController.js Owner services · server.js Express server
Components 28
Client experience
- App routes
client/src/App.jsx - App context
client/src/context/AppContext.jsx - Browse cars
client/src/pages/Cars.jsx - Car details
client/src/pages/CarDetails.jsx - Home page
client/src/pages/Home.jsx - Booking history
client/src/pages/MyBookings.jsx - Owner portal
client/src/pages/owner/Layout.jsx - Owner dashboard
client/src/pages/owner/Dashboard.jsx - Add a car
client/src/pages/owner/AddCar.jsx - Manage cars
client/src/pages/owner/ManageCars.jsx - Manage bookings
client/src/pages/owner/ManageBookings.jsx
API and access
- Express server
server/server.js - User routes
server/routes/userRoutes.js - Owner routes
server/routes/ownerRoutes.js - Booking routes
server/routes/bookingRoutes.js - Auth middleware
server/middleware/auth.js
Rental domain
- User services
server/controllers/userController.js - Owner services
server/controllers/ownerController.js - Booking services
server/controllers/bookingController.js - User records
server/models/User.js - Car records
server/models/Car.js - Booking records
server/models/Booking.js
External services
- Database connection
server/configs/db.js - MongoDB
- ImageKit client
server/configs/imageKit.js - ImageKit
Other components
- Renter
- Vehicle owner
Connections 34
- Renter → App routes: uses
- Vehicle owner → App routes: uses
- App routes → Home page: routes
- App routes → Browse cars: routes
- App routes → Car details: routes
- App routes → Booking history: routes
- App routes → Owner portal: routes
- Owner portal → Owner dashboard: routes
- Owner portal → Add a car: routes
- Owner portal → Manage cars: routes
- Owner portal → Manage bookings: routes
- App routes → App context: reads state
- App context → User routes: requests data
- Express server → User routes: mounts
- Express server → Owner routes: mounts
- Express server → Booking routes: mounts
- Express server → Database connection: connects
- User routes → User services: dispatches
- Owner routes → Owner services: dispatches
- Booking routes → Booking services: dispatches
- User routes → Auth middleware: protects routes
- Owner routes → Auth middleware: protects routes
- Booking routes → Auth middleware: protects routes
- Auth middleware → User records: loads user
- User services → User records: reads/writes
- User services → Car records: lists cars
- Owner services → User records: updates user
- Owner services → Car records: manages cars
- Owner services → Booking records: reads bookings
- Owner services → ImageKit client: uploads images
- Booking services → Booking records: checks and writes
- Booking services → Car records: checks car
- Database connection → MongoDB: connects
- ImageKit client → ImageKit: uploads media