Skip to content

ayanhakeem/Airbnb

Repository files navigation

Airbnb

Airbnb-like Listing and Review Platform

Overview

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.


Features

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. Responsive Design:

    • The front-end is designed using Bootstrap and custom CSS to ensure a seamless experience across devices.

Technologies Used

  • 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)

Folder Structure

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

API Endpoints

Authentication

  • POST /auth/signup - User registration
  • POST /auth/login - User login
  • GET /auth/logout - User logout

Listings

  • GET /listings - Get all listings
  • GET /listings/:id - Get a single listing
  • POST /listings - Create a new listing (protected route)
  • PUT /listings/:id - Update a listing (protected route)
  • DELETE /listings/:id - Delete a listing (protected route)

Reviews

  • GET /listings/:id/reviews - Get all reviews for a listing
  • POST /listings/:id/reviews - Add a review (protected route)
  • PUT /reviews/:id - Update a review (protected route)
  • DELETE /reviews/:id - Delete a review (protected route)

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/YourFeatureName).
  3. Commit your changes (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature/YourFeatureName).
  5. Open a pull request.


Acknowledgments

  • 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.

Contact

For any questions or feedback, feel free to reach out:


Enjoy using the app! 🚀

About

Wanderlust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors