Skip to content

pranavasree/microservices

Repository files navigation

Cloud-Native Banking Microservices Platform

A production-style banking microservices platform built with Java 21, Spring Boot, Spring Cloud, Docker, Kubernetes, Helm, Kafka, RabbitMQ, Redis, Keycloak, Prometheus, Grafana, Loki, Tempo, and OpenTelemetry.

This project demonstrates how to design, develop, containerize, secure, observe, and deploy a distributed microservices system using modern cloud-native patterns.

What I Built

I built a complete banking microservices ecosystem with multiple independent services, supporting infrastructure, deployment manifests, and observability tooling.

Core Business Microservices

  • Accounts Service - handles customer/account-related APIs and business logic.
  • Loans Service - manages loan-related APIs and service-level functionality.
  • Cards Service - manages card-related APIs and service-level functionality.
  • Message Service - supports event/message-driven communication workflows.

Platform and Infrastructure Services

  • Config Server for centralized external configuration across services.
  • API Gateway for routing client requests to backend microservices.
  • Service discovery using Spring Cloud Kubernetes discovery.
  • Resilience patterns using Resilience4j circuit breakers.
  • Inter-service communication using OpenFeign.
  • Redis integration for gateway-level reactive support and caching/rate-limiting patterns.
  • Kafka and RabbitMQ integration for asynchronous and event-driven communication.
  • Keycloak security with OAuth2/OpenID Connect and JWT-based resource server protection.

Containerization and Deployment

  • Built Docker images for Spring Boot services.
  • Used Google Jib Maven Plugin to containerize services without manually writing Dockerfiles for every service.
  • Created Docker Compose setup for local multi-container development.
  • Created Kubernetes YAML manifests for deploying services to a Kubernetes cluster.
  • Built Helm charts for repeatable and environment-based deployments.
  • Organized Helm charts for application services and platform tools such as Kafka, Keycloak, Grafana, Loki, Tempo, and Prometheus.

Observability and Monitoring

  • Added Spring Boot Actuator for health and metrics endpoints.
  • Integrated Micrometer with Prometheus for metrics collection.
  • Used Grafana dashboards for monitoring.
  • Added Loki for centralized logging.
  • Added Tempo and OpenTelemetry for distributed tracing across services.

API Testing and Developer Workflow

  • Added a Postman collection to test microservice APIs.
  • Maintained Maven commands for building and running services.
  • Documented Docker, Kubernetes, and Helm commands used throughout the project.
  • Structured the repository into multiple phases to show the incremental evolution from basic Spring Boot services to a cloud-native Kubernetes deployment.

High-Level Architecture

Client / Postman
      |
      v
API Gateway
      |
      +--> Accounts Service
      +--> Loans Service
      +--> Cards Service
      |
      +--> Config Server
      +--> Keycloak Security
      +--> Kafka / RabbitMQ Messaging
      +--> Redis
      +--> Prometheus + Grafana + Loki + Tempo
      |
      v
Kubernetes / Helm Deployment

Tech Stack

Area Tools / Technologies
Backend Java 21, Spring Boot, Spring Cloud
Microservices Accounts, Loans, Cards, Message, Config Server, Gateway Server
Communication REST APIs, OpenFeign, Kafka, RabbitMQ
Resilience Resilience4j Circuit Breaker
Security Keycloak, OAuth2, OpenID Connect, JWT
Data / Cache MySQL, H2, Redis
Containers Docker, Docker Compose, Google Jib
Orchestration Kubernetes, Helm
Observability Spring Boot Actuator, Micrometer, Prometheus, Grafana, Loki, Tempo, OpenTelemetry
Testing Postman Collection
Cloud Deployment Google Kubernetes Engine (GKE)

Repository Structure

microservices/
├── phase2/                  # Initial microservice implementation
├── phase6/                  # Docker and service evolution
├── phase7/                  # Spring Cloud and supporting infrastructure
├── phase8/                  # Service communication and resilience improvements
├── phase9/                  # API gateway / resilience / monitoring evolution
├── phase10/                 # Advanced microservice setup
├── phase11/                 # Security and gateway improvements
├── phase12/                 # Event-driven and observability improvements
├── phase13/                 # Messaging and distributed system improvements
├── phase14/                 # Kubernetes preparation
├── phase15/kubernetes/      # Kubernetes deployment files
├── phase16/helm/            # Helm charts for services and tools
├── phase17/                 # Final version with services, Kubernetes and Helm setup
│   ├── accounts/
│   ├── cards/
│   ├── loans/
│   ├── message/
│   ├── configserver/
│   ├── gatewayserver/
│   ├── kubernetes/
│   └── helm/
├── k8s/                     # Kubernetes dashboard/admin support files
└── Microservices.postman_collection.json

Final Outcome

By the end of this project, I built a full cloud-native banking microservices platform with:

  • Independently deployable Spring Boot microservices.
  • Centralized configuration and API gateway routing.
  • Secure authentication and authorization using Keycloak.
  • Resilient service-to-service communication with OpenFeign and Resilience4j.
  • Event-driven messaging using Kafka and RabbitMQ.
  • Complete Docker, Kubernetes, and Helm deployment support.
  • Production-style observability with Prometheus, Grafana, Loki, Tempo, and OpenTelemetry.
  • Cloud deployment completed on Google Kubernetes Engine (GKE).

Important Links

Maven Commands used in the course

Maven Command Description
"mvn clean install -Dmaven.test.skip=true" To generate a jar inside target folder
"mvn spring-boot:run" To start a springboot maven project
"mvn spring-boot:build-image" To generate a docker image using Buildpacks. No need of Dockerfile
"mvn compile jib:dockerBuild" To generate a docker image using Google Jib. No need of Dockerfile

Docker Commands used in the course

Docker Command Description
"docker build . -t eazybytes/accounts:s4" To generate a docker image based on a Dockerfile
"docker run -p 8080:8080 eazybytes/accounts:s4" To start a docker container based on a given image
"docker images" To list all the docker images present in the Docker server
"docker image inspect image-id" To display detailed image information for a given image id
"docker image rm image-id" To remove one or more images for a given image ids
"docker image push docker.io/eazybytes/accounts:s4" To push an image or a repository to a registry
"docker image pull docker.io/eazybytes/accounts:s4" To pull an image or a repository from a registry
"docker ps" To show all running containers
"docker ps -a" To show all containers including running and stopped
"docker container start container-id" To start one or more stopped containers
"docker container pause container-id" To pause all processes within one or more containers
"docker container unpause container-id" To unpause all processes within one or more containers
"docker container stop container-id" To stop one or more running containers
"docker container kill container-id" To kill one or more running containers instantly
"docker container restart container-id" To restart one or more containers
"docker container inspect container-id" To inspect all the details for a given container id
"docker container logs container-id" To fetch the logs of a given container id
"docker container logs -f container-id" To follow log output of a given container id
"docker container rm container-id" To remove one or more containers based on container ids
"docker container prune" To remove all stopped containers
"docker compose up" Creates and starts containers based on the given Docker Compose file
"docker compose down" Stops and removes containers, networks, volumes, and images created by up
"docker compose start" Starts existing (previously created) containers without recreating them
"docker compose stop" Stops running containers without removing them
"docker run -p 3306:3306 --name accountsdb -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=accountsdb -d mysql" To create a MySQL DB container
"docker run -p 6379:6379 --name eazyredis -d redis" To create a Redis Container
"docker run -p 8080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:22.0.3 start-dev" To create Keycloak Container

Apache Benchmark command used in the course

Apache Benchmark command Description
"ab -n 10 -c 2 -v 3 http://localhost:8072/eazybank/cards/api/contact-info" To perform load testing on API by sending 10 requests

Kubernetes Commands used in the course

Kubernetes Command Description
"kubectl apply -f filename" To create a deployment/service/configmap based on a given YAML file
"kubectl get all" To get all the components inside your cluster
"kubectl get pods" To get all the pods details inside your cluster
"kubectl get pod pod-id" To get the details of a given pod id
"kubectl describe pod pod-id" To get more details of a given pod id
"kubectl delete pod pod-id" To delete a given pod from cluster
"kubectl get services" To get all the services details inside your cluster
"kubectl get service service-id" To get the details of a given service id
"kubectl describe service service-id" To get more details of a given service id
"kubectl get nodes" To get all the node details inside your cluster
"kubectl get node node-id" To get the details of a given node
"kubectl get replicasets" To get all the replica sets details inside your cluster
"kubectl get replicaset replicaset-id" To get the details of a given replicaset
"kubectl get deployments" To get all the deployments details inside your cluster
"kubectl get deployment deployment-id" To get the details of a given deployment
"kubectl get configmaps" To get all the configmap details inside your cluster
"kubectl get configmap configmap-id" To get the details of a given configmap
"kubectl get events --sort-by=.metadata.creationTimestamp" To get all the events occured inside your cluster
"kubectl scale deployment accounts-deployment --replicas=1" To set the number of replicas for a deployment inside your cluster
"kubectl set image deployment gatewayserver-deployment gatewayserver=eazybytes/gatewayserver:s11 --record" To set a new image for a deployment inside your cluster
"kubectl rollout history deployment gatewayserver-deployment" To know the rollout history for a deployment inside your cluster
"kubectl rollout undo deployment gatewayserver-deployment --to-revision=1" To rollback to a given revision for a deployment inside your cluster
"kubectl get pvc" To list the pvcs inside your cluster
"kubectl delete pvc data-happy-panda-mariadb-0" To delete a pvc inside your cluster

Helm Commands used in the course

Helm Command Description
"helm create [NAME]" Create a default chart with the given name
"helm dependencies build" To recompile the given helm chart
"helm install [NAME] [CHART]" Install the given helm chart into K8s cluster
"helm upgrade [NAME] [CHART]" Upgrades a specified release to a new version of a chart
"helm history [NAME]" Display historical revisions for a given release
"helm rollback [NAME] [REVISION]" Roll back a release to a previous revision
"helm uninstall [NAME]" Uninstall all of the resources associated with a given release
"helm template [NAME] [CHART]" Render chart templates locally along with the values
"helm list" Lists all of the helm releases inside a K8s cluster

Deployment Status

This microservices platform was containerized, deployed through Kubernetes and Helm, and finally deployed on Google Kubernetes Engine (GKE).

The deployment demonstrates a real cloud-native workflow:

Spring Boot Services
      -> Docker / Jib Images
      -> Kubernetes Manifests
      -> Helm Charts
      -> Google Kubernetes Engine (GKE)

About

Cloud-native banking microservices platform built with Java, Spring Boot, Spring Cloud, Eureka, API Gateway, Redis, Resilience4j, MySQL, Docker, Docker Compose, OAuth2, OpenID, Kafka, RabbitMQ, Kurbernetes and Helm

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors