Skip to content

Booking microservice for a home sharing platform that displays a calendar, prices per night and total number of reviews in an accessible and mobile-friendly UI. Users can select available dates and number of guests to check-in.

Notifications You must be signed in to change notification settings

bedroost/booking

Repository files navigation

Bedroost

Calendar booking module for a home sharing app built in service-oriented architecture.

bedroost png

Table of Contents

  1. Tech Stack
  2. Demo
  3. Usage
  4. Requirements
  5. RESTful API routes
  6. Related Projects

Tech Stack

Front-end: JavaScript, React, Redux, Webpack
Back-end: Node.js, Express
Database: MySQL
Testing: Jest, Enzyme, CirceCI

Demo

bedroost gif

Usage

# clone this repository
$ git clone https://github.com/bedroost/booking.git

# install dependencies
$ npm install

# seed mysql database
$ mysql -uroot < server/db/schema.sql
$ npm run seed

# bundle files with webpack
$ npm run build

# run the app!
$ npm start

Requirements

  • Nvm
  • Node
  • Git

RESTful API routes

GET Rooms and Booking Information

Endpoint: /api/rooms/:listingid

Success Response:

  • An array of objects containing basic room and booking information with param listingid
  • Response Code: 200
  • Expected Content:
{
  listingInfo:
  {
    baseGuests: 2
    basePrice: 327
    cleaningFee: 285
    createdAt: "2019-09-01T03:20:27.000Z"
    extraGuests: 0
    guestFee: 173
    id: 1
    lastAvailableDate: "2020-04-13"
    maxGuests: 2
    maxNights: 108
    minNights: 1
    reviews: 450
    serviceFee: 39
    taxes: 26
    updatedAt: "2019-09-01T03:20:27.000Z"
    views: 746
  },
  bookedDates: {
    0: {
      id: 1, bookedDate: "2019-11-03", createdAt: 
      "2019-09-01T03:20:27.000Z", updatedAt: 
      "2019-09-01T03:20:27.000Z", listingId: 1
    },
    1: {
      id: 2, bookedDate: "2019-07-02", createdAt: 
      "2019-09-01T03:20:27.000Z", updatedAt: 
      "2019-09-01T03:20:27.000Z", listingId: 1
    },
    2: {
      id: 3, bookedDate: "2019-12-23", createdAt: 
      "2019-09-01T03:20:27.000Z", updatedAt: 
      "2019-09-01T03:20:27.000Z", listingId: 1
    },
    3: {
      id: 4, bookedDate: "2019-06-04", createdAt: 
      "2019-09-01T03:20:27.000Z", updatedAt: 
      "2019-09-01T03:20:27.000Z", listingId: 1
    }
  }
}

Error Response:

  • Response Code: 404

Related Projects

About

Booking microservice for a home sharing platform that displays a calendar, prices per night and total number of reviews in an accessible and mobile-friendly UI. Users can select available dates and number of guests to check-in.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages