Displays reviews that an item's seller has received.
Sidebar Service: https://github.com/HRR47-SDC-OMalley/sidebar-service Main Photo Service: https://github.com/HRR47-SDC-OMalley/main-photo
POST a new product at a new product id: http://localhost:3000/reviews/api/item/endpoint/:listingId input: {string name, string condition, string category, string style, string brand, boolean asDescribed, string description, string seller}
PUT (update) an existing seller with a provided object: http://localhost:3000/reviews/api/seller/ input: name to update, updates {[] listings, [] listings_counts, [] reviews}
DELETE all reviews for a product: http://localhost:3000/reviews/api/item/:listingId/reviews
-
Node.js v12.x
-
Postgres v12.4
-
Cassandra v3.11.8
Execute all these commands from the repository's root directory.
npm install
npm run seed
CSV will be seeded with x item listings.
Postgres join table copy from tables to single CSV:
node database/postgres/copyToCSV.js
Create an index on the Reviews table once copied from CSV
CREATE INDEX ON “Reviews”(“guitarID”);
Cassandra copy from CSV file:
COPY guitarandreview(id,"productId",author,date,description,name,rating) FROM '~/Documents/projects/hrr47-sdc-omalley.nosync/Reviews-Service/database/seedFiles/guitarsAndReviews.csv' WITH DELIMITER=',' AND HEADER=TRUE;
npm run test
npm run build:watch
Starts nodemon and loads environment variables
npm start
These require the dev-dependencies to be installed
- Create a file named
aws-keys.json
in the root directory, with the following contents:
{
"AWSAccessKeyId": "<your-access-key-ID>",
"AWSSecretKey": "<your-access-secret-key>",
"bucket": "<your-bucket-name>"
}
- Run
grunt deploy
on the terminal
Requirements: [Docker v19.03.12] (https://docs.docker.com/engine/install/) [Docker Compose v1.26.2] (https://docs.docker.com/compose/install/)
- Run
docker-compose build
to build a Docker image - Run
docker-compose up -d
to start running the service on port 80 - Run
docker-compose down
to stop the service
Running
docker-compose up -d
the first time will automatically build an image. However, if you want to make any changes afterwards, you need to runbuild
, take down the image withdown
, and then put up the new image withup -d
.
If you host the service in a shell, Docker and Nodejs will not work out of the box. You need to install them on your shell before you can make use of the Dockerfile and
package.json
.