Giter VIP home page Giter VIP logo

rarebnb's Introduction

RareBnB

Background

RareBnb is a full-stack clone of AirBnb which not only displays listings of rare places to stay, but also what are considered rare finds on AirBnb!

Technologies, Libraries, APIS

  • Javascript
  • React
  • Redux
  • Ruby on Rails
  • Postgresql
  • AWS S3
  • Google Maps API

Functionality & MVPs

  • Host on Render
  • Full user authentication (signup, login, logout)
  • View listings on an index page and a specific listing on a show page
  • Display the general location of a listing using Google Maps API
  • View, create, modify, and delete reservations
  • Read reviews made on listings

Booking a reservation on the listing show page

Within the show page of a listing, users can see all the details related to the listing such as photos, location, price, amenities, reviews, etc. All available information shown on the page is dynamically updated. There are vadildations in place to prevent the user from creating an impossible reservation.

ReservationForm.js

<form className="reservation-form" onSubmit={handleSubmit}>
          <div className="reservation-form-inputs">
            <div className="reservation-form-dates-container">
                <label className="reservation-form-start-date">
                    <div className="reservation-form-date-text">CHECK-IN</div>
                    <input 
                      className="reservation-form-date-input"
                      type="date"
                      value={startDate}
                      min={moment().format("YYYY-MM-DD")}
                      max={calculateEndDate(endDate, -0.5)}
                      onChange={(e) => setStartDate(e.target.value)}
                    />
                </label>

                <label className="reservation-form-end-date">
                  <div className="reservation-form-date-text">CHECKOUT</div>
                  <input 
                    className="reservation-form-date-input"
                    type="date"
                    value={endDate}
                    min={calculateEndDate(startDate, 2)}
                    onChange={(e) => setEndDate(e.target.value)}
                  />
                </label>
            </div>
            <label className="reservation-form-guests">
              <div className="reservation-form-guests-text">GUESTS</div>
              <input 
                className="reservation-form-guests-input"
                type="number"
                value={numGuests}
                min="1"
                max={listing.guests}
                onChange={(e) => setNumGuests(e.target.value)}
              />
            </label>
          </div>
          <br />
          {sessionUser ? <button className="reservation-form-button" type="submit">Reserve</button> : <button className="reservation-form-button-disabled" type="submit" disabled>Reserve</button>}
        </form>

Modifying and deleting a reservation on the user's trips page

Users can view their reservations on their Trips page. Depending on whether a reservation has already occurred (past today's date), it will be shown in the past trips list while future reservations appear in the upcoming trips list. Users cannot access old reservations. However, they can click on upcoming reservations which will display a modal where they can modify or delete their reservation.

const upcomingReservationsList = (reservations) => {
        const upcomingReservations = []
        
        reservations.forEach((reservation) => {
            if (Date.parse(reservation.endDate) > Date.now()) {
                upcomingReservations.push(reservation)
            }
        })

        return upcomingReservations
    }

    const pastReservationsList = (reservations) => {
        const pastReservationsList = []
        
        reservations.forEach((reservation) => {
            if (Date.parse(reservation.endDate) < Date.now()) {
                pastReservationsList.push(reservation)
            }
        })

        return pastReservationsList
    }

    const upcomingReservations = upcomingReservationsList(reservations).map((reservation) => {
        return (
            <ReservationIndexItem key={reservation.id} reservation={reservation} />
        )
    })

    const pastReservations = pastReservationsList(reservations).map((reservation) => {
        return (
            <ReservationPastTrips key={reservation.id} reservation={reservation} />
        )
    })


    return (
        <div className="reservations-index-container">
            <h1 className="reservations-index-trip-title">
                Trips
            </h1>
            <div className="reservation-index-upcoming-reservations">
                Upcoming reservations
            </div>
            {upcomingReservations}
            <div className="reservation-index-upcoming-reservations">
                Where you've been
            </div>
            {pastReservations}
        </div>
    )

Future Implementation

  • Search/filter function to display specific listings
  • Create reviews
  • Carousel for listing photos

rarebnb's People

Contributors

jeffreych6 avatar

Stargazers

 avatar Daniel Kalla avatar

Watchers

 avatar

rarebnb's Issues

Sample State

Sample State

  • State shape is flat!
  • State's keys are camelCased
  • All keys within the values in the state are accessible in the schema
  • Correctly formatted
    • Sample state is rendered with triple backticks, and the language ```javascript...```). This will display the state as a code block instead of a giant line of text
    • Top level slices
      • entities
      • session
      • errors (here or in ui)
      • ui (if needed)
    • Should NOT have nested slices, aka comments inside of posts
    • Some info from other tables is ok, for instance:
    • the author username and imageurl for a post. basically any info that the user can't change
    • like count and a boolean on whether the user likes the post instead of a likes slice

MVP List

MVP List

  • Should have 7 MVPs.
    • 3 of those are User Auth, Render, and Production README.
    • The other 4 are from the Approved Apps List or your PM will have clarified them with you
  • Contains a description sentence of the app
  • Includes two to three detailed bullets on functionality and presentation of feature
  • At least one CRUD feature, which states what CRUD operations are planned (creation, reading, updating, deletion)
  • Estimates how long it will take the code each MVP
  • Correctly formatted
    • MVPs are listed in an ordered list
    • Each MVP is broken down into bullet points

Backend Routes

Backend Routes

  • Contains the following sections: HTML, API Endpoints(Backend)
  • Each route has a description
  • API Endpoint routes contains wildcard variables written in snake_case
  • Routes does not contain superfluous routes
  • Have API routes that will allow the front end to get all info it needs and does not have unneeded routes:
    • probably doesn't need a GET likes api endpoint because that info comes through the post show

Database Schema

Database Schema

  • Contains correct datatypes
  • Contains appropriate constraints/details
    • primary key
    • not null
    • unique
    • indexed
    • foreign key
  • Contains bullet points after the table that state which foreign keys will reference to which table, or references to the associations which will be made
  • foreign key and table name are lowercased, snake_cased and back_ticked
  • Correctly formatted
    • schema is written in a table format
    • the table's name are lowercased, snake_cased and back_ticked
    • the table header column names are bolded
    • columns names are lowercased and snaked_cased and back_ticked

Frontend Routes

Frontend Routes

  • Frontend routes contains wildcard variables written in camelCase
  • Correctly formatted
    • Routes are displayed with inline coding text (backticks)

Wiki Home Page

Wiki Home Page

  • Is the first page you see upon entering the wiki
  • Contains a welcome message
  • Contains a link/placeholder for a link to the live page
  • All links in the right sidebar should contain each wiki page and link to the correct page
  • Correctly formatted
    • each wiki page is listed in bullet points
    • all links route the correct page

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.