Calendar booking module for a home sharing app built in service-oriented architecture.
Front-end: JavaScript, React, Redux, Webpack
Back-end: Node.js, Express
Database: MySQL
Testing: Jest, Enzyme, CirceCI
# 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
- Nvm
- Node
- Git
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