This API facilitates the submission of dining reviews for restaurants by registered users. The platform allows users and restaurants to register, and reviews are assigned numerical values, with particular emphasis on accommodating preferences related to food allergies such as eggs, dairy, and peanuts.
Server: Java, Spring Boot Framework, JPA (Java Persistence API), Spring Data JPA, Curl
Client: NA
Clone the project
git clone https://github.com/channacy/DiningReviewAPIGo to the project directory
cd diningReviewAPIInstall dependencies (using Maven)
mvn clean installStart the server
mvn spring-boot:runTo run tests, run the following command
curl -X POST -H "Content-Type: application/json" -d '{
"username": "john_doe",
"city": "New York",
"state": "NY",
"zipcode": "10001",
"isInterestedPeanutAllergy": true,
"isInterestedEggAllergy": false,
"isInterestedDiaryAllergy": true
}' http://localhost:8080/user
curl -X PUT -H "Content-Type: application/json" -d '{
"city": "New York",
"state": "NY",
"zipcode": "900",
"isInterestedPeanutAllergy": true,
"isInterestedEggAllergy": false,
"isInterestedDiaryAllergy": true
}' http://localhost:8080/user/john_doe
curl -X POST \
http://localhost:8080/restaurants \
-H 'Content-Type: application/json' \
-d '{
"name": "Sample Restaurant",
"zipcode": "12345",
"peanutReview": 4.5,
"eggReview": 3.0,
"dairyReview": 2.5,
"overallScore": 3.3,
"numReviews": 10
}' curl -X POST \
http://localhost:8080/reviews \
-H 'Content-Type: application/json' \
-d '{
"reviewer": "John Doe",
"restaurantID": 1,
"status": "PENDING",
"peanutReview": 4.5,
"eggReview": 3.0,
"dairyReview": 2.5,
"commentary": "Great experience!"
}'
curl -X GET \
http://localhost:8080/admin/reviews/pending
curl -X GET \
http://localhost:8080/reviews/approved/123 curl -X GET \
http://localhost:8080/restaurants/find/1 curl -X PUT \
-H "Content-Type: application/json" \
-d '{
"isAccepted": true
}' \
http://localhost:8080/admin/1/1/validate curl -X GET http://localhost:8080/restaurants/12345