This project goal is register reviews for establishments at the Food Hygiene Rating Scheme API, and give the aggregated information from both reviews and API in one single endpoint.
To solve this challenge a microservice approach was used to generate two microservices: Establishment Reviews and Establishment Service. In addition to an Eureka Server to manage those two microservices. The following high level diagram gives more details about this solution.
It is an application that holds the information about all client-service applications. Every micro service will register into the eureka server.
It is a microservice that will perform CRUD operations on Establishment Reviews. With the falowing endpoints:
It is a microservice that will call the Food Hygiene Rating Scheme API and Establishment Reviews microservice for the given establishment id, then will return the aggregation information from both. With the following enpoints:
To run the microservices it is nescessery start the eureka server and both microservices. In order to do this it is necessary run the comands bellow inside the cloned folder. To run the Eureka Server
cd EurekaServer/
mvn install spring-boot:run
To run the Establishment Review Microservice
cd EstablishmentReviewsService/
mvn install spring-boot:run
To run the Establishment Service Microservice
cd EstablishmentService/
mvn install spring-boot:run
For each one of those applications, maven run unit tests and start the servers.
The servers will start at the following urls:
Eureka server - http://localhost:8761
Establishment Reviews - http://localhost:8200
Establishment Service - http://localhost:8100
Establishment Reviws and Establishment Service are using Swagger for the API documentation and to test calls. Please refer the links bellow to access the Swager interface and obtain more information about the endpoints for each Microservice
Establishment Reviews - http://localhost:8200/swagger-ui.html
Establishment Service - http://localhost:8100/swagger-ui.html