Skip to content

Jellyfish-130/review-service

Repository files navigation

Jelly-Fish: SDC

Project description

This is the back-end system architecture design of an inherited "item detail page" for a housing-rental web application

Related Front-End Projects:

Table of Contents

  1. Usage
  2. Requirements
  3. Development

Usage

Some usage instructions

To get the review component, run http://localhost:3003/rooms/:roomId with the corresponding roomId.

Server API

GET all reviews for specific room

  • GET /api/rooms/:roomId/reviews

Path Parameters:

  • roomId Room ID

Success Status Code: 200

Returns: JSON

[
  {
  "user_id": "Number",
  "username": "String",
  "image": "String",
  "review_id": "id Number",
  "dateNum": "DATE",
  "description": "String",
  "roomNum": "Number",
  "cleanlinessRating": "Number",
  "communicationRating": "Number",
  "checkInRating": "Number",
  "accuracyRating": "Number",
  "valueRating": "Number",
  "total_rating": "Number",
  }
]

GET all reviews for a single user

  • GET /api/users/:userId/reviews

Path Parameters:

  • userId user ID

Success Status Code:200

Returns: JSON

[
  {
  "user_id": "Number",
  "username": "String",
  "image": "String",
  "review_id": "id Number",
  "dateNum": "DATE",
  "description": "String",
  "roomNum": "Number",
  "cleanlinessRating": "Number",
  "communicationRating": "Number",
  "checkInRating": "Number",
  "accuracyRating": "Number",
  "valueRating": "Number",
  "total_rating": "Number",
  }
]

POST new user review to a specific room

  • POST /api/rooms/:roomId/reviews

Path Parameters:

  • roomId Room ID

Success Status Code: 201

Request Body: Expects JSON with the following keys.

  {
  "username": "String",
  "image": "String",
  "dateNum": "DATE",
  "description": "String",
  "roomNum": "Number",
  "cleanlinessRating": "Number",
  "communicationRating": "Number",
  "checkInRating": "Number",
  "accuracyRating": "Number",
  "valueRating": "Number",
  "total_rating": "Number",
  }

UPDATE one review from a specific room

  • PATCH /api/rooms/:roomId/reviews/:reviewId

Path Parameters:

  • roomId Room ID
  • reviewId Review ID

Success Status Code:204

Request Body: Expects JSON with any of the following keys (include only keys to be updated)

  {
  "dateNum": "DATE",
  "description": "String",
  "cleanlinessRating": "Number",
  "communicationRating": "Number",
  "checkInRating": "Number",
  "accuracyRating": "Number",
  "valueRating": "Number",
  "total_rating": "Number",
  }

DELETE reviews from a specific room

  • DELETE /api/rooms/:roomId/reviews/:reviewId

Path Parameters:

  • roomId Room ID
  • reviewId Review ID

Success Status Code: 204

Requirements

  • Node 6.13.0 or 10.15.3
  • NPM 6.14.8 or 6.4.1
  • MongoDB 4.2.8

Development

Installing Dependencies

From within the root directory:

  • npm install

Running the application

  • Run MongoDB: mongod --dbpath data
  • Run Webpack: npm run build:dev
  • Run Express server: npm run start:dev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages