This module is part of the FreeSeats restaurant reservation app. It displays data about customers' overall experiences, and renders all reviews for the restaurant.
Search Bar
Menu, Related Info
Photos
Reservation Booking
An nvmrc
file is included if using nvm.
- Node >=6.13.0
- PostgreSQL 11.2
Clone and install the node dependencies.
In development mode, the host URLs for getSummaryData
and getReviewsData
in /client/src/components/reviewsComponent.jsx
should be localhost
.
Transpile and bundle with npm react-dev
.
seed the database
npm run server-dev
The public folder will be available at host port 3010.
Install and start Postgres. Create a reviews database and psql
into it. From the postgres shell, run =# \i database/schema.sql
.
Ensure the role and password are correct in config/db_config.js
, and make sure the environment variables supplied in the compose
and awscompose
files match these.
npm run seed
Build the bundle with npm build
.
Make sure no images with the names "rdbimg" or "rfeimg", or containers with the names "rdb" or "rfe" exist on the host.
bash compose
Visit port 3010 on the host IP
To compose down, use bash decompose
... but be aware that it will prune any other dangling images and volumes as well.
GET {host}:3010/:id/summary
id: integer
The id parameter specifies the unique id of the restaurant being queried. Seeded test values range from 1-5.
If successful, this method returns a response body with the following structure:
{
"location": string,
"noise": string,
"recommendPercent": integer,
"valueRating": string,
"averageOverall": string,
"averageFood": string,
"averageAmbience": string,
"averageService": string
}
GET {host}:3010/:id/reviews
If successful, this method returns an array containing objects with the following structure:
{
"id": integer,
"restaurant": integer,
"text": string,
"date": date,
"overall": integer,
"food": integer,
"service": integer,
"ambience": integer,
"wouldrecommend": boolean
"tags": string,
"firstname": string,
"lastname": string,
"city": string,
"avatarcolor": string,
"isvip": boolean,
"totalreviews": integer
}