Giter VIP home page Giter VIP logo

wckliment / homehopper Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 951 KB

HomeHopper is a full-stack web application for finding and managing home rentals. It offers a seamless user experience for both property owners and renters. The application includes user authentication, CRUD operations for rental spots, a review and rating system, and more.

Home Page: https://homehopper.onrender.com/

JavaScript 89.15% HTML 0.27% CSS 10.58%
authentication crud express fullstack nodejs react redux rental-housing responsive-design sequelize webapplication

homehopper's Introduction

HomeHopper

HomeHopper Logo

Build Status License

Welcome to HomeHopper, your go-to platform for finding and managing home rentals.

Table of Contents ๐Ÿ“‘

Introduction

HomeHopper is a web application that allows users to browse, create, and manage rental properties. It provides a seamless user experience for both property owners and renters.

Features

  • User Authentication ๐Ÿ”’
  • Create, Read, Update, Delete Spots ๐Ÿ 
  • Responsive Design ๐Ÿ“ฑ
  • Review and Rating System โญ
  • Search and Filter Listings ๐Ÿ”
  • Detailed Spot Information โ„น๏ธ
  • User Profiles ๐Ÿ‘ค

Technologies Used

  • React โš›๏ธ
  • Redux ๐Ÿ”„
  • Express โšก
  • Sequelize ๐Ÿ“Š

Setup

โš™๏ธ To set up the project locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/yourusername/HomeHopper.git
    
  2. Install dependencies:

     npm install
  3. Create a .env file in the root directory and add the following variables:

    DB_USERNAME=your_db_username
    DB_PASSWORD=your_db_password
    DB_NAME=your_db_name
    DB_HOST=your_db_host
    JWT_SECRET=your_jwt_secret
    
  4. Set up the backend database, start the frontend and backend server, and open your browser :

  • Navigate to the backend directory:

    cd backend
  • Create the database:

    npx sequelize-cli db:create
  • Run migrations:

    npx sequelize-cli db:migrate
  • Seed the database (optional):

    npx sequelize-cli db:seed:all
  • Start the backend server:

    npm start
  • Navigate to the frontend directory:

    cd frontend
  • Start the frontend development server:

    npm run dev
  • Open your browser and navigate to http://localhost:3000 to view the application.

Usage

๐Ÿ–ฅ๏ธ You can access the deployed application at HomeHopper on Render.

Contributing

๐Ÿค Contributions are welcome! Please fork the repository and create a pull request.

License

๐Ÿ“„ This project is licensed under the MIT License.

homehopper's People

Contributors

wckliment avatar

Watchers

 avatar

homehopper's Issues

Edit a Review

Update and return an existing review.

  • An authenticated user is required for a successful response
  • Only the owner of the review is authorized to edit
  • Review record is updated in the database after request
  • Review data returned includes the id, userId, spotId, review,
    stars, createdAt, and updatedAt
  • Error response with status 400 is given when body validations for the
    review, or stars are violated
  • Error response with status 404 is given when a review does not exist with
    the provided id

Get details for a spot from an id

Returns the details of a spot specified by its id.

  • Successful response includes data only for the specified spot
  • Spot data returned includes the id, ownerId, address, city,
    state, country, lat, lng, name, description, price, createdAt,
    and updatedAt
  • Spot data returns aggregate data for numReviews and avgStarRating
  • Spot data returns associated data for SpotImages, an array of image
    data including the id, url, and preview
  • Spot data returns associated data for Owner, including the id,
    firstName, and lastName
  • Error response with status 404 is given when a spot does not exist with
    the provided id

Delete a Booking

Delete an existing booking.

  • An authenticated user is required for a successful response
  • Only the owner of the booking or the owner of the spot is authorized to
    delete the booking
  • Booking record is removed from the database after request
  • Success response includes a message indicating a successful deletion
  • Error response with status 404 is given when a spot does not exist with
    the provided id
  • Error response with status 400 is given when it is past the booking's
    startDate (no deleting of current or past bookings)

Delete a Spot

Deletes an existing spot.

  • An authenticated user is required for a successful response
  • Only the owner of the spot is authorized to delete
  • Spot record is removed from the database after request
  • Success response includes a message indicating a successful deletion
  • Error response with status 404 is given when a spot does not exist with
    the provided id

Get all Reviews of the Current User

Returns all the reviews written by the current user.

  • An authenticated user is required for a successful response
  • Successful response includes only reviews created by the current user
  • Review data returned includes the id, userId, spotId, review,
    stars, createdAt, and updatedAt
  • Review data returns associated data for User, including the id,
    firstName, and lastName
  • Review data returns associated data for Spot, including the id,
    ownerId, address, city, state, country, lat, lng, name,
    price, and previewImage
  • Review data returns associated data for ReviewImages, an array of image
    data including the id and url

Authentication Required

All endpoints that require a current user to be logged in receive a standard
authentication response.

  • Authentication middleware responds with error status 401 when
    authentication is not provided

Create a spot

Creates and returns a new spot.

  • An authenticated user is required for a successful response
  • New spot exists in the database after request
  • Spot data returned includes the id, ownerId, address, city,
    state, country, lat, lng, name, description, price, createdAt,
    and updatedAt
  • Error response with status 400 is given when body validations for the
    address, city, state, country, lat, lng, name, description, or price are violated

Get all Reviews by a Spot's id

Returns all the reviews that belong to a spot specified by id.

  • Seed data exists in the database for reviews to be returned.
  • Successful response includes only reviews for the specified spot
  • Review data returned includes the id, userId, spotId, review,
    stars, createdAt, and updatedAt
  • Review data returns associated data for User, including the id,
    firstName, and lastName
  • Review data returns associated data for ReviewImages, an array of image
    data including the id and url
  • Error response with status 404 is given when a spot does not exist with
    the provided id

Get all Spots

Returns all the spots.

  • Seed data exists in the database for spots to be returned.
  • Successful response includes each spot in the database.
  • Spot data returned includes the id, ownerId, address, city,
    state, country, lat, lng, name, description, price, createdAt,
    updatedAt, previewImage, and avgRating

Log In a User (Feature 0)

Logs in a current user with valid credentials and returns the current user's
information.

  • Successful response includes the user's id, firstName, lastName,
    and email
  • Error response with status 401 is given when invalid credentials are given
  • Error response with status 400 is given when body validations for the
    email, firstName, or lastName are violated

Add an Image to a Review based on the Review's id

Create and return a new image for a review specified by id.

  • An authenticated user is required for a successful response
  • Only the owner of the review is authorized to add an image
  • New image exists in the database after request
  • Image data returned includes the id and url
  • Error response with status 404 is given when a review does not exist with
    the provided id
  • Error response with status 403 is given when the maximum number of images
    have been added for the review

Delete an Image for a Review

Delete an existing image for a Review.

  • An authenticated user is required for a successful response
  • Only the owner of the review is authorized to delete
  • Image record is removed from the database after request
  • Success response includes a message indicating a successful deletion
  • Error response with status 404 is given when a review image does not exist
    with the provided id

Add Query Filters to Get All Spots

Return spots filtered by query parameters.

  • Query parameters are accepted for page, size, minLat, maxLat,
    minLng, maxLng, minPrice, and maxPrice
  • Default values are provided for the page and size parameters
  • Successful response includes only spots in the database that meet the
    specified query parameters criteria.
  • Spot data returned includes the id, ownerId, address, city,
    state, country, lat, lng, name, description, price, createdAt,
    updatedAt, and previewImage for each spot
  • Successful response includes the page and size of the returned payload
  • Error response with status 400 is given when query parameter validations
    for the page, size, minLat, maxLat, minLng, maxLng, minPrice, or
    maxPrice are violated

Get the Current User (Feature 0)

Returns the information about the current user that is logged in.

  • An authenticated user is required for a successful response
  • Successful response includes the user's id, firstName, lastName,
    and email

Edit a Spot

Updates and returns an existing spot.

  • An authenticated user is required for a successful response
  • Only the owner of the spot is authorized to edit
  • Spot record is updated in the database after request
  • Spot data returned includes the id, ownerId, address, city,
    state, country, lat, lng, name, description, price, createdAt,
    and updatedAt
  • Error response with status 400 is given when body validations for the
    address, city, state, country, lat, lng, name, description, or price are violated
  • Error response with status 404 is given when a spot does not exist with
    the provided id

Create a Booking from a Spot based on the Spot's id

Create and return a new booking from a spot specified by id.

  • An authenticated user is required for a successful response
  • A user is only authorized to create a booking if they do NOT own the spot
  • New booking exists in the database after request
  • Booking data returned includes the id, userId, spotId, startDate,
    endDate, createdAt, and updatedAt
  • Error response with status 404 is given when a spot does not exist with
    the provided id
  • Error response with status 403 is given when a booking already exists for
    the spot on the specified dates

Create a Review for a Spot based on the Spot's Id

Create and return a new review for a spot specified by id.

  • An authenticated user is required for a successful response
  • New review exists in the database after request
  • Review data returned includes the id, userId, spotId, review,
    stars, createdAt, and updatedAt
  • Error response with status 400 is given when body validations for the
    review or stars are violated
  • Error response with status 404 is given when a spot does not exist with
    the provided id
  • Error response with status 403 is given when a review already exists for
    the spot from the current user

Authentication Required

All endpoints that require a current user to have the correct role(s) or
permission(s) receive a standard authorization response.

  • Authorization middleware responds with error status 403 when
    an authenticated user does not have the correct role(s) or permission(s)

Get all Spots owned by the Current User

Returns all the spots owned (created) by the current user.

  • An authenticated user is required for a successful response
  • Successful response includes only spots created by the current user
  • Spot data returned includes the id, ownerId, address, city,
    state, country, lat, lng, name, description, price, createdAt,
    updatedAt, previewImage, and avgRating

Add an Image to a Spot based on the Spot's id

Create and return a new image for a spot specified by id.

  • An authenticated user is required for a successful response
  • Only the owner of the spot is authorized to add an image
  • New image exists in the database after request
  • Image data returned includes the id, url, and preview
  • Error response with status 404 is given when a spot does not exist with
    the provided id

Delete a Review

Delete an existing review.

  • An authenticated user is required for a successful response
  • Only the owner of the review is authorized to delete
  • Review record is removed from the database after request
  • Success response includes a message indicating a successful deletion
  • Error response with status 404 is given when a spot does not exist with
    the provided id

Delete an Image for a Spot

Delete an existing image for a Spot.

  • An authenticated user is required for a successful response
  • Only the owner of the spot is authorized to delete
  • Image record is removed from the database after request
  • Success response includes a message indicating a successful deletion
  • Error response with status 404 is given when a spot image does not exist
    with the provided id

Get all of the Current User's Bookings

Return all the bookings that the current user has made.

  • An authenticated user is required for a successful response
  • Successful response includes only bookings created by the current user
  • Booking data returned includes the id, spotId, userId, startDate,
    endDate, createdAt, and updatedAt
  • Booking data returns associated data for Spot, including the id,
    ownerId, address, city, state, country, lat, lng, name,
    price and previewImage

Edit a Booking

Update and return an existing booking.

  • An authenticated user is required for a successful response
  • Only the owner of the booking is authorized to edit
  • Booking record is updated in the database after request
  • Booking data returned includes the id, userId, spotId, startDate,
    endDate, createdAt, and updatedAt
  • Error response with status 404 is given when a booking does not exist with
    the provided id
  • Error response with status 400 is given when it is past the booking's
    endDate (no editing of past bookings)
  • Error response with status 403 is given when a booking already exists for
    the spot on the specified dates

Sign up a User (Feature 0)

Creates a new user, logs them in as the current user, and returns the current
user's information.

  • New user exists in the database after request
  • Successful response includes newly created id, firstName, lastName,
    and email
  • Error response with status 500 is given when the specified email or username
    already exists
  • Error response with status 400 is given when body validations for the
    email, firstName, or lastName are violated

Get all Bookings for a Spot based on the Spot's id

Return all the bookings for a spot specified by id.

  • An authenticated user is required for a successful response
  • Seed data exists in the database for bookings to be returned.
  • Successful response includes only bookings for the specified spot
  • If you are NOT the owner of the spot, booking data returned includes the
    spotId, startDate, and endDate for each booking
  • If you ARE the owner of the spot, booking data returned includes the id
    spotId, userId, startDate, endDate, createdAt, and updatedAt for
    each booking
  • If you ARE the owner of the spot, booking data returns associated data for
    User, including the id, firstName, and lastName
  • Error response with status 404 is given when a spot does not exist with
    the provided id

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.