How elamaran15/bankly works
Project Type and Purpose
• This is a banking microservice application built with Spring Boot and Spring Cloud.
• It follows a distributed architecture: multiple domain services (User, Transaction, Payment), a service registry (Eureka), an API Gateway, an event bus (Kafka/Zookeeper), centralized tracing (Zipkin), and backing stores (PostgreSQL per service).
Key Directories and Their Roles
• apigatewayservice: Spring Cloud Gateway handling all external HTTP traffic, authentication/filtering, routing to downstream services.
• eurekaservice: Spring Cloud Eureka server for service registration and discovery.
• userservice, transactionservice, paymentservice: three independent Spring Boot microservices, each with its own domain logic, REST controllers, data repositories (Liquibase/Flyway changelogs), and PostgreSQL schema.
• db-init/init.sql: initial DB setup for shared or common schemas if any.
• docker-compose.yml & k8s/: container and Kubernetes deployment definitions for all services, databases, Kafka, Zookeeper, Zipkin, ingress, secrets, PVCs.
Main Components
• API Gateway
• Eureka Service Registry
• User Service (Spring Boot + Postgres)
• Transaction Service (Spring Boot + Postgres + External API client)
• Payment Service (Spring Boot + Postgres + Kafka producer/consumer)
• Kafka Cluster (with Zookeeper)
• Zipkin Tracing Server
• PostgreSQL instances (one per service or shared)
• Kubernetes Cluster (namespaces, ingress) or Docker-Compose network if drawing local stack
Relationships and Data Flows
• Client → Ingress Controller (K8s) or direct → API Gateway
• API Gateway → Eureka (to resolve downstream service instances)
• API Gateway → User/Transaction/Payment services (synchronous HTTP calls)
• Transaction Service → ExternalApiClient → User Service & Payment Service (sync)
• Payment Service → Kafka Producer (“transaction-processed” topic)
• Transaction Service → Kafka Consumer (“transaction-processed” topic)
• Zipkin collects traces from all HTTP and Kafka traffic via Sleuth instrumentation
• Each service reads/writes its own PostgreSQL database via JDBC
Architectural Patterns and Technologies
• Microservices architecture with clear service boundaries
• Service Discovery (Eureka) with client‐side load balancing
• API Gateway pattern for cross‐cutting concerns (auth, routing)
• Event‐driven integration (Kafka topics, Zookeeper coordination)
• Distributed tracing (Spring Cloud Sleuth + Zipkin)
• Database per service pattern with Liquibase/Flyway changelogs