How mitsuha-24/mern-travel-booking-system works
This is an MVP Mangalore travel site: visitors browse destination guides and hotel listings, inspect availability, then submit a booking. Express routes in travel.js render the EJS pages and query inventory; the booking router decrements inventory before saving a booking record. Although the README describes atomic MongoDB transactions, the sampled booking route explicitly has no transaction/session or rollback, so it does not implement that guarantee. README-documented destination pages are represented as a capability branch; their individual templates were not sampled.
Main entry points: travel.js Express application · Hotel_name.js Hotel inventory · hotelbooking.routs.js Booking handler · seed_inventory.js Inventory seeder
Components 12
Web experience
- Express application
travel.js - Destination guides
views - Home page
views/homepage.ejs - Hotel listings
views/hotels.ejs - Booking form
views/hotelbooking.ejs
Hotel booking
- Booking handler
routs/hotelbooking.routs.js - Inventory seeder
scripts/seed_inventory.js
Persistence
- Hotel inventory
models/Hotel_name.js - Booking records
models/hotel.models.js - Database connection
config/db.js
Other components
- Traveler
- MongoDB
Connections 17
- Traveler → Express application: requests pages
travel.js - Express application → Home page: renders
travel.js - Express application → Destination guides: renders guides
README.md - Express application → Hotel inventory: reads listings
travel.js - Express application → Hotel listings: renders listings
travel.js - Express application → Hotel inventory: reads availability
travel.js - Express application → Booking form: renders form
travel.js - Traveler → Booking handler: submits booking
routs/hotelbooking.routs.js - Booking handler → Hotel inventory: decrements rooms
routs/hotelbooking.routs.js - Booking handler → Booking records: saves booking
routs/hotelbooking.routs.js - Express application → Booking handler: mounts router
travel.js - Express application → Inventory seeder: starts seeding
travel.js - Inventory seeder → Hotel inventory: inserts inventory
scripts/seed_inventory.js - Express application → Database connection: connects database
travel.js - Database connection → MongoDB: connects
config/db.js - Hotel inventory → MongoDB: persists inventory
- Booking records → MongoDB: persists bookings