- This repo represents a basic currency conversion cloud native-app which convert currency from given country code to targeted country code.
- I am using the following stack for this cloud native app.
- Microservice Architecture with API-GATEWAY along with Discovery Server
- Spring Security with OAuth2 and KeyCloak Server
- ELK Stack
- Distributed Tracing
- Following are the Tools and technologies which I am using:
- Java 17
- Spring Boot 2.6.4
- Spring Cloud 2021.0.1 (Security, Config Server, Service Discovery and Distributed Tracing)
- KeyCloak Server (Authorization Server) 16.1.1
- Zipkin Version 2.23.16 (Distribute Tracing)
- Rabbit MQ Version 3.9.13-management(Message Broker)
- ELK Stack Version 7.17.1
- Add the line
127.0.0.1 auth-server
in the last of your hosts file.- For Linux/Unix based system, its location is at:
/etc/hosts
- For Windows, its location is at:
c:\Windows\System32\Drivers\etc\hosts
- For Linux/Unix based system, its location is at:
- Docker 20.xx.x or later
How to Run: Watch Video
git clone https://github.com/UbaidurRehman1/Cloud-Native-App-Spring-Boot
cd Cloud-Native-App-Spring-Boot/envcn
./run-multi-stage.sh
(it will run all tools which our services needs such as keycloak server, discovery server, databases, zipkin, rabbitmq and elk-stack)cd ..
./run-multi-stage.sh
(it will up the microservices)- Access Web Client UI
- Access Swagger Client UI
- To authorize the requests in Swagger, please follow this
- This App basically converts a currency from given country code to targeted country code by following the cloud native approach.
api-gateway
provides a gateway for end clients (web browsers, mobiles) to interact the resource servers (micro-services)- An Actor (React Client, React Native Client) can interact with the micro-services through the
api-gateway
- In above diagram, We can see:
- An End Client can access the resource servers through the
api-gatewy
- There are five resource servers:
currency-conversion
service abstract the functions of getting exchange rate fromcurrency-exchange
service and converting this exchange rate by the help ofmath
service.currency-exchange
service return the exchange rate between two currencies.math
service convert the currency to another currency using the exchange rate.country
service return all countriesuser
service is related about user information
- An
api-gateway
exposes its URLs to Clients Keycloak
Server (For OAuth2 Authentication and Authorization)Discovery
Server (For services discovery)Distributed Tracing Stack
, for request tracing in micro-service architectureELK Stack
, for Centralized LoggingConfig Server
to get distributed app configurations (hosted in github/public-repo) for each micro-service
- An End Client can access the resource servers through the
- API Composer
- Currency Exchange Service
- Currency Conversion Service
- Country Service
- User Service
- API Gateway
- You can read about each micro-service by going inside each folder
- To get More info about this repo