A full-stack hotel booking web app built with Node.js, Express, MongoDB, EJS, Cloudinary, and Razorpay.
This project lets users explore listings, sign up or log in, add stays to cart, complete bookings with Razorpay, leave reviews, and manage their profile and trips.
- User authentication with Passport.js
- Create, edit, and delete hotel listings
- Listing search and filters from the navbar
- Booking flow with check-in, check-out, and guest count
- Add to cart and direct book actions
- Cloudinary image upload for listing photos
- Razorpay payment integration
- Booking history page
- User profile page
- Review and rating system with reviewer name
- Responsive UI with custom navbar, offcanvas menu, hero sections, and upgraded footer
- Node.js
- Express.js
- MongoDB with Mongoose
- EJS and EJS-Mate
- Passport.js
- Joi
- Cloudinary
- Razorpay
- Bootstrap 5
Routes/ Express route handlers
models/ Mongoose models
views/ EJS templates
public/ CSS and client-side JS
middleware.js Shared auth and validation middleware
schema.js Joi validation schemas
app.js Main server entry point
git clone https://github.com/Parshantbal/Airbnb.git
cd Airbnbnpm installCopy .env.example to .env and update the values:
MONGO_URL=mongodb://127.0.0.1:27017/wonderlust
SESSION_SECRET=mySecretCode
RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_key_secret
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secretMake sure your local MongoDB server is running.
node app.jsThe app will run at:
http://localhost:8080
- Sign up and log in
- Browse all listings
- Use navbar filters for search, location, and price
- Open a listing and select stay dates and guests
- Add the stay to cart or book directly
- Complete payment with Razorpay
- View confirmed bookings in
My bookings - Open
My profileto see quick account stats
- Create a new listing
- Edit or delete owned listings
- View hosted listing count from profile
- Logged-in users can submit ratings and comments
- New reviews store the reviewer name automatically
- Users can delete only their own reviews
GET /listingGET /listing/newPOST /listingGET /listing/:idGET /listing/:id/editPUT /listing/:idDELETE /listing/:id
POST /listing/:id/cartPOST /listing/:id/bookGET /cartDELETE /cart/items/:itemIdPOST /checkout/create-orderPOST /checkout/verifyGET /bookings
GET /signupPOST /signupGET /loginPOST /loginGET /logoutGET /profile
POST /listing/:id/reviewDELETE /listing/:id/review/:reviewId
- Razorpay payment works only after adding valid API keys in
.env - Cloudinary upload works only after adding valid Cloudinary keys in
.env - Existing old reviews without author data may show a fallback reviewer label
- The app currently uses local MongoDB
- There is no inventory blocking or date conflict prevention in this version
- Availability calendar
- Booking cancellation
- Admin dashboard
- Email confirmations
- Better host analytics
- Production deployment setup
Parshant Bal
GitHub: Parshantbal