StayHub is a full-stack web application that allows users to discover, create, and review luxury stays and unique travel experiences around the world. Built with Node.js, Express, MongoDB, and EJS, it provides a smooth and responsive experience with authentication, maps, and image uploads.
👉 https://stayhub-t42v.onrender.com
👉 https://github.com/iammadhu123/Project-StayHub.git
- Search listings by title, location, or country
- Filter listings by category
- Create, edit, and delete listings
- User authentication (Register/Login/Logout)
- Add reviews and ratings
- Interactive map with geo-location
- Image upload using Cloudinary
- Protected routes for logged-in users
- Fully responsive design
- HTML5
- CSS3
- JavaScript
- Bootstrap 5
- EJS (templating)
- Node.js
- Express.js
- MongoDB Atlas
- Mongoose ODM
- Passport.js
- Express-session
- Cloudinary (image storage)
- OpenStreetMap API (Nominatim for geocoding)
Project-StayHub/
├── controllers/ # Request handlers
│ ├── listings.js
│ ├── reviews.js
│ └── users.js
├── models/ # Database schemas
│ ├── listing.js
│ ├── review.js
│ └── user.js
├── routes/ # Route definitions
│ ├── listing.js
│ ├── review.js
│ └── user.js
├── views/ # EJS templates
│ ├── includes/
│ ├── layouts/
│ ├── listings/
│ └── user/
├── public/ # Static files
│ ├── css/
│ └── js/
├── utils/ # Utility functions
├── init/ # Database initialization
├── middleware.js # Middleware functions
├── app.js # Main application file
├── cloudConfig.js # Cloudinary configuration
└── package.json # Dependencies
git clone https://github.com/iammadhu123/Project-StayHub.gitcd Project-StayHubnpm installCreate a .env file in the root directory and add the following:
PORT=8080
ATLASDB_URL=your_mongodb_url
SECRET=your_secret_key
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secretDevelopment:
nodemon app.jsProduction:
node app.jsThe app will run at: http://localhost:8080
- User registration and login system
- Session-based authentication with Passport.js
- Protected routes for creating, editing, and deleting listings
- Ownership validation (users can only modify their own listings)
- Uses OpenStreetMap API (Nominatim) for geocoding
- Converts location addresses to coordinates
- Stores GeoJSON in MongoDB
- Displays interactive map with Leaflet.js
- Cloudinary integration for image storage
- Secure file upload handling
- Image URL and filename saved in database
If you like this project:
- ⭐ Star the repository
- 🍴 Fork it
- 🔥 Improve it
This project is licensed under the MIT License.
Built with ❤️ using Node.js, Express, MongoDB, and EJS