KoshFlow is a modular, production-grade banking application built with Java, Spring Boot, and Docker. It implements core banking features, leverages event-driven architecture with Kafka and RabbitMQ, and provides robust notification and search capabilities. The system is designed for scalability, extensibility, and future AI integration.
- Microservices: Each business domain (accounts, users, transactions, notifications, authentication, search) is a separate Spring Boot service.
- API Gateway: Central entry point for all APIs, with JWT-based authentication and routing.
- Service Discovery: Eureka registry for dynamic service registration and discovery.
- Messaging: Kafka and RabbitMQ for asynchronous, decoupled communication.
- Persistence: PostgreSQL for relational data, Elasticsearch for search/analytics.
- Containerized: All services and dependencies are orchestrated via Docker Compose.
graph TB
%% Client and Gateway Layer
Client[🖥️ Frontend/Client Application]
Gateway[🌐 API Gateway<br/>Port: 9080]
%% Authentication
Auth[🔐 Auth Service<br/>JWT Authentication<br/>Port: 8085]
%% Service Discovery
Eureka[📋 Eureka Server<br/>Service Registry<br/>Port: 8761]
%% Core Services
User[👤 User Service<br/>Profile Management<br/>Port: 8080]
Account[💰 Account Service<br/>Balance Management<br/>Port: 8081]
Trans[💳 Transaction Service<br/>Money Transfers<br/>Port: 8082]
%% Support Services
Notif[📧 Notification Service<br/>Email & Alerts<br/>Port: 8083]
ES[🔍 Elasticsearch Service<br/>Search & Analytics<br/>Port: 8084]
%% Message Brokers
Kafka[(📨 Apache Kafka<br/>Event Streaming)]
RabbitMQ[(🐰 RabbitMQ<br/>Message Queue)]
%% Client Flow
Client -->|HTTPS Requests| Gateway
Gateway -->|Validate Token| Auth
Gateway -->|Route Requests| User
Gateway -->|Route Requests| Trans
Gateway -->|Route Requests| Account
%% Service Discovery (Registration)
Auth -.->|Register & Discover| Eureka
User -.->|Register & Discover| Eureka
Trans -.->|Register & Discover| Eureka
Account -.->|Register & Discover| Eureka
Notif -.->|Register & Discover| Eureka
ES -.->|Register & Discover| Eureka
Gateway -.->|Register & Discover| Eureka
%% Inter-Service Communication via Kafka
Trans -->|Transaction Events| Kafka
Kafka -->|Account Updates| Account
Account -->|Balance Events| Kafka
Kafka -->|Transaction Status| Trans
Kafka -->|User Events| User
Kafka -->|Search Index| ES
%% RabbitMQ for Notifications
User -->|Notification Messages| RabbitMQ
RabbitMQ -->|Send Notifications| Notif
%% Styling
classDef clientStyle fill:#e1f5fe,stroke:#01579b,stroke-width:2px,color:#000
classDef gatewayStyle fill:#f3e5f5,stroke:#4a148c,stroke-width:2px,color:#000
classDef serviceStyle fill:#e8f5e8,stroke:#2e7d32,stroke-width:2px,color:#000
classDef authStyle fill:#fff3e0,stroke:#e65100,stroke-width:2px,color:#000
classDef discoveryStyle fill:#fce4ec,stroke:#880e4f,stroke-width:2px,color:#000
classDef messageStyle fill:#f1f8e9,stroke:#33691e,stroke-width:2px,color:#000
class Client clientStyle
class Gateway gatewayStyle
class User,Account,Trans,Notif,ES serviceStyle
class Auth authStyle
class Eureka discoveryStyle
class Kafka,RabbitMQ messageStyle
| Service | Description | Port | Link to README |
|---|---|---|---|
| user-service | Manages user profiles | 8080 | user-service |
| account-service | Manages user accounts and balances | 8081 | account-service |
| transaction-service | Handles money transfers and history | 8082 | transaction-service |
| notification-service | Sends notifications (email, etc.) | 8083 | notification-service |
| elasticsearch-service | Search/analytics for transactions | 8084 | elasticsearch-service |
| auth-service | Handles authentication (JWT) | 8085 | auth-service |
| registry-service | Eureka service registry | 8761 | registry-service |
| gateway-service | API Gateway, routing, JWT validation | 9080 | gateway-service |
-
Initiate Transaction:
- A user initiates a transaction via the
transaction-serviceAPI. - The transaction is validated, saved to the database, and published to Kafka.
- A user initiates a transaction via the
-
Account Processing:
- The
account-serviceconsumes the Kafka event, processes the transaction (e.g., balance updates), and publishes the result back to Kafka.
- The
-
Transaction Completion:
- The
transaction-servicelistens for the completion event, updates the transaction status, and publishes it to Elasticsearch for indexing.
- The
-
User Notification:
- The
user-servicelistens for the completion event, gathers user details, and sends a message to RabbitMQ. - The
notification-serviceconsumes the RabbitMQ message and sends an email to the user.
- The
- Clone the repository.
- Ensure Docker and Docker Compose are installed.
- Run:
docker-compose up --build - Access services via their respective ports (see table above).
- Java 21+
- Maven 3.8+
- Docker & Docker Compose
- Each service has its own
application.propertiesfor environment-specific settings. - Common environment variables:
- Database:
spring.datasource.* - Kafka:
spring.kafka.bootstrap-servers - RabbitMQ:
spring.rabbitmq.* - Eureka:
eureka.client.service-url.defaultZone - JWT Secret (auth-service):
jwt.secret
- Database:
- Spring Boot Actuator endpoints are enabled for all services.
- Eureka dashboard available at
http://localhost:8761.
- Fork the repo and create a feature branch.
- Make changes and add tests.
- Submit a pull request.
MIT
For questions or support, contact: mslalith17@gmail.com