How sanjana123642/tripeasy works
TripEasy is an Express travel-booking API. Users register or log in, browse trips, book seats, and manage itineraries; agents can create and update trips. The server mounts the API routes and establishes MongoDB and Socket.IO. The graph reflects sampled route, controller, and model relationships; unsampled capabilities are retained from the source index, but their internal links are omitted where evidence is unavailable.
Main entry points: server.js HTTP and sockets · tripRoutes.js Trip routes · bookingController.js Booking and availability · authMiddleware.js Token protection
Components 24
API runtime
- HTTP and sockets
server.js - Database connection
config/db.js
Identity and access
- Auth routes
routes/authRoutes.js - Register and login
controllers/authController.js - Token protection
middleware/authMiddleware.js - Input validation
middleware/validationMiddleware.js - Role checks
middleware/roleMiddleware.js
Travel operations
- Trip routes
routes/tripRoutes.js - Trip search and management
controllers/tripController.js - Booking routes
routes/bookingRoutes.js - Booking and availability
controllers/bookingController.js - Itinerary routes
routes/itineraryRoutes.js - Itinerary management
controllers/itineraryController.js - Agent routes
routes/agentRoutes.js - Agent operations
controllers/agentController.js
User services
- Notification routes
routes/notificationRoutes.js - Notification delivery
controllers/notificationController.js - Firebase configuration
config/Firebase.js
Data models
- User records
models/User.js - Trip records
models/Trip.js - Booking records
models/Booking.js - Itinerary records
models/Itinerary.js
Other components
- API clients
- Socket clients
Connections 28
- API clients → HTTP and sockets: sends requests
server.js - HTTP and sockets → Database connection: connects database
server.js - HTTP and sockets → Auth routes: mounts routes
server.js - HTTP and sockets → Trip routes: mounts routes
server.js - HTTP and sockets → Booking routes: mounts routes
server.js - HTTP and sockets → Itinerary routes: mounts routes
server.js - HTTP and sockets → Agent routes: mounts routes
server.js - HTTP and sockets → Notification routes: mounts routes
server.js - Auth routes → Register and login: dispatches to
routes/authRoutes.js - Auth routes → Input validation: validates input
routes/authRoutes.js - Register and login → User records: reads and writes
controllers/authController.js - Trip routes → Trip search and management: dispatches to
routes/tripRoutes.js - Trip routes → Token protection: protects routes
routes/tripRoutes.js - Trip routes → Role checks: checks agent role
routes/tripRoutes.js - Trip search and management → Trip records: reads and writes
controllers/tripController.js - Booking routes → Booking and availability: dispatches to
routes/bookingRoutes.js - Booking routes → Token protection: protects routes
routes/bookingRoutes.js - Booking and availability → Booking records: reads and writes
controllers/bookingController.js - Booking and availability → Trip records: checks and updates seats
controllers/bookingController.js - Booking and availability → HTTP and sockets: emits availability
controllers/bookingController.js - Socket clients → HTTP and sockets: receives events
server.js - Itinerary routes → Itinerary management: dispatches to
routes/itineraryRoutes.js - Itinerary routes → Token protection: protects routes
routes/itineraryRoutes.js - Itinerary management → Itinerary records: reads and writes
controllers/itineraryController.js - Agent routes → Agent operations: dispatches to
routes/agentRoutes.js - Agent operations → User records: uses user records
controllers/agentController.js - Notification routes → Notification delivery: dispatches to
routes/notificationRoutes.js - Notification routes → Token protection: protects route
routes/notificationRoutes.js