A Node.js/Express Airbnb-style listing app built with EJS templates, MongoDB, user authentication, booking management, and a simple chatbot experience.
- User authentication with Passport.js
- Listing creation, editing, and deletion
- Image upload using Cloudinary
- Category browsing and search
- User reviews and review management
- Interactive chatbot page for user questions
- Map geocoding for listing locations
- Flash messages for success/error feedback
- Node.js
- Express
- MongoDB / Mongoose
- EJS + EJS Mate
- Passport.js + passport-local-mongoose
- Cloudinary + multer-storage-cloudinary
- Joi validation
- connect-flash, express-session, connect-mongo
- Bootstrap 5
- Clone the repository:
git clone <your-repo-url>
cd airbnb- Install dependencies:
npm install- Create a
.envfile at the project root with the following variables:
NODE_ENV=development
SECRET=your_session_secret
DS=mongodb+srv://... or mongodb://localhost:27017/your-db-name
CLOUD_NAME=your_cloudinary_cloud_name
CLOUD_API_KEY=your_cloudinary_api_key
CLOUD_API_SECRET=your_cloudinary_api_secret
MAP_TILER_KEY=your_maptiler_api_key
MAP_API_KEY=your_mapbox_or_maptiler_api_key- Start the app:
node app.js- Open the app in your browser:
http://localhost:8080
app.js— main Express application setuproutes/— route handlers for listings, reviews, users, and bookingscontrollers/— controller logic for listings, users, and reviewsmodels/— Mongoose schemas for Listing, Review, Booking, and Userviews/— EJS templates for pages and layoutspublic/— static CSS and JavaScript filescloudconfig.js— Cloudinary storage configurationmiddleware.js— authentication and request validation helpers
GET /listings— browse all listingsGET /listings/new— create a new listingPOST /listings— save a listingGET /listings/:id— view a listingGET /listings/:id/edit— edit a listingPUT /listings/:id— update a listingDELETE /listings/:id— delete a listingGET /listings/category/:category— show category listingsGET /listings/search— search listingsGET /bookings— view current user bookingsPOST /bookings— create a bookingGET /chatbot— open chatbot pageGET /signup— sign up pageGET /login— login pageGET /logout— log out
- The app expects MongoDB connection string in
DS. - Cloudinary is required for image uploads.
- Map geocoding is used when creating listings.
- The app listens on port
8080by default.