Personal project putting together all the stuff i learned about Microservices in the last couple of months. Project will cover service configuration, discovery, resiliency, routing, eventing, tracing and finally deployment. As i'm personal interested in crypto currencies like Ethereum et al i decided to build a "Crypto Cloud" with a couple of services around the topic. The following figure gives you a rough overview:
Services are build on top of Spring Boot, Spring Cloud and Netflix OSS using either Java or Kotlin.
DISCLAIMER: This project is not a perfect use case for a microservice architecture. It is only for learning the above-mentioned techniques what's also the reason for putting all the source code in a single repository. For a real world project I recommend to set up each microservice with its own repository and with its own build processes.
The below sections briefly describe the services. Please use this Postman Request Collection to get a documentation of each service interface. See Postman Docs to get more information about Postman.
The API Gateway acts as entry point to services. All requests first go through the API Gateway. It then routes requests to the appropriate service. Technology behind that is Zuul together with Spring Cloud.
Simple REST API for crypto currencies.
Responsible for collecting up-to-date currency rates from an external data source and pushing those rates into the Currency Service database. The synchronization takes place every three minutes.
Sidecar to manage Crypto-Cloud wide configuration for each service. E.g. used by the currency service to configure the mongodb. The technology behind that is Spring Cloud Config.
Netflix open source Service Discovery Server Eureka.
Web application build on top of React.js using Semantic UI for styling. The app is deployed to a NGINX container. NGINX is configured to proxy the app api requests to the API gateway. See nginx-site.conf and Dockerfile.
Thanks to cjdowner for providing a set of icons for all the main cryptocurrencies and altcoins.
First you have to build the code as a docker image. Therefore open a terminal, navigate to source code root directory and run the following command:
export BUILD_ID=latest
mvn clean package docker:buildOnce the build is finished you can start the cloud with the following docker-compose command:
export BUILD_ID=latest
docker-compose -f docker/docker-compose.yml upTo inspect the services use the Postman Request Collection as described above. You may have to adjust the variables to make requests.
The web application is bound to port 80. Just open the browser of your choice, navigate to localhost:80 and voila:
Finally a big thank you to the authors of "Building Microservices" (Sam Newman), "The TAO of Microservices" (Richard Rodger) and "Spring Microservices in Action" (John Carnell) who helped me to dive deeper in this complex topic.

