Skip to content
This repository was archived by the owner on Oct 26, 2025. It is now read-only.
/ crypto-cloud Public archive

Personal project putting together all the stuff i learned about Microservices in the last couple of months.

Notifications You must be signed in to change notification settings

6d68/crypto-cloud

Repository files navigation

Crypto Cloud Build Status

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.

Services

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.

API Gateway

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.

Currency Service

Simple REST API for crypto currencies.

Rates Collector

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.

Side cars

Configuration Service

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.

Discovery Service

Netflix open source Service Discovery Server Eureka.

Crypto cloud app

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.

Running the cloud on your local machine

Pre requisites

  1. Apache Maven.
  2. Docker.
  3. Node.js

Building & Running the cloud on your local machine

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:build

Once 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 up

To 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:

Learning microservices

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.

About

Personal project putting together all the stuff i learned about Microservices in the last couple of months.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published