Skip to content

Inter-dimensional-Resort/Peter-Proxy

Repository files navigation

Reviews and Impressions Module

This module is part of the FreeSeats restaurant reservation app. It displays data about customers' overall experiences, and renders all reviews for the restaurant.

Related Modules

Search Bar
Menu, Related Info
Photos
Reservation Booking

Table of Contents

  1. Requirements
  2. Development
  3. Deployment
  4. API

Requirements

An nvmrc file is included if using nvm.

  • Node >=6.13.0
  • PostgreSQL 11.2

Development

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.

PostgreSQL

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

Deployment

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.

API

Restaurant Summary

GET {host}:3010/:id/summary

Parameters

id: integer

The id parameter specifies the unique id of the restaurant being queried. Seeded test values range from 1-5.

Response

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
}

Restaurant Reviews

GET {host}:3010/:id/reviews

Response

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
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published