This project is a web application inspired by Airbnb, built using MongoDB, Node.js, Express.js, and Bootstrap for the front-end. It allows users to create, read, update, and delete (CRUD) listings and reviews. The application also includes user authentication and follows the MVC (Model-View-Controller) architecture for a clean and organized codebase.
-
User Authentication:
- Users can sign up, log in, and log out.
- Passwords are securely hashed using bcrypt.
- Authentication is managed using JSON Web Tokens (JWT) or session-based authentication.
-
Listings Management:
- Create: Users can add new listings with details like title, description, price, location, and images.
- Read: Listings are displayed on the homepage with pagination and filtering options.
- Update: Users can edit their own listings.
- Delete: Users can remove their listings.
-
Reviews Management:
- Create: Users can leave reviews for listings they’ve booked or visited.
- Read: Reviews are displayed on the listing details page.
- Update: Users can edit their reviews.
- Delete: Users can delete their reviews.
-
MVC Architecture:
- Models: Define the structure of data (e.g.,
User,Listing,Review). - Views: Built using HTML, CSS, and Bootstrap for responsive design.
- Controllers: Handle the logic for routing, authentication, and CRUD operations.
- Models: Define the structure of data (e.g.,
-
Responsive Design:
- The front-end is designed using Bootstrap and custom CSS to ensure a seamless experience across devices.
-
Backend:
- Node.js
- Express.js
- MongoDB (with Mongoose for schema modeling)
- Bcrypt (for password hashing)
- JWT or Express-session (for authentication)
-
Frontend:
- HTML
- CSS
- Bootstrap
- EJS/Pug/Handlebars (for server-side rendering) or React (if applicable)
-
Other Tools:
- Git (for version control)
- Postman (for API testing)
- MongoDB Atlas (for cloud database hosting)
project-root/
│
├── models/ # MongoDB models (User, Listing, Review)
├── views/ # Front-end views (HTML, EJS, etc.)
├── controllers/ # Logic for handling routes and operations
├── routes/ # Express routes
├── public/ # Static files (CSS, JS, images)
├── middleware/ # Custom middleware (e.g., authentication)
├── config/ # Configuration files (e.g., database connection)
├── .env # Environment variables
├── app.js # Main application file
└── README.md # Project documentation
POST /auth/signup- User registrationPOST /auth/login- User loginGET /auth/logout- User logout
GET /listings- Get all listingsGET /listings/:id- Get a single listingPOST /listings- Create a new listing (protected route)PUT /listings/:id- Update a listing (protected route)DELETE /listings/:id- Delete a listing (protected route)
GET /listings/:id/reviews- Get all reviews for a listingPOST /listings/:id/reviews- Add a review (protected route)PUT /reviews/:id- Update a review (protected route)DELETE /reviews/:id- Delete a review (protected route)
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeatureName). - Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/YourFeatureName). - Open a pull request.
- Inspired by Airbnb.
- Built with the help of the Express.js and MongoDB documentation.
- Thanks to Bootstrap for making front-end development easier.
Contributions are welcome! If you'd like to contribute, follow these steps:
Fork the repository.
Create a new branch for your feature or bugfix:
git checkout -b feature-name Commit your changes and push them:
git commit -m "Add your message here" git push origin feature-name Open a pull request.
For any questions or feedback, feel free to reach out:
- Email: ayanhakeem20@gmail.com
- GitHub: ayan hakeem
Enjoy using the app! 🚀