Project description
This is the back-end system architecture design of an inherited "item detail page" for a housing-rental web application
Some usage instructions
To get the review component, run http://localhost:3003/rooms/:roomId with the corresponding roomId.
- 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
/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
/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",
}
- PATCH
/api/rooms/:roomId/reviews/:reviewId
Path Parameters:
roomId
Room IDreviewId
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
/api/rooms/:roomId/reviews/:reviewId
Path Parameters:
roomId
Room IDreviewId
Review ID
Success Status Code: 204
- Node 6.13.0 or
10.15.3
- NPM 6.14.8 or
6.4.1
- MongoDB
4.2.8
From within the root directory:
- npm install
- Run MongoDB: mongod --dbpath data
- Run Webpack: npm run build:dev
- Run Express server: npm run start:dev