# msubham2003/digital-banking-system architecture

> Architecture diagram of the GitHub repository msubham2003/digital-banking-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/msubham2003/digital-banking-system
- Repository: https://github.com/msubham2003/digital-banking-system

## Overview

This is a microservices digital banking system for account management, transfers, payments, fraud checks, and alerts. A user enters through the rate-limiting gateway; account, transaction, and payment APIs handle requests. Transfers are persisted and published for fraud review, then transaction/account state is updated through event-driven processing; payment webhooks likewise publish payment outcomes. The README documents the service and topic relationships, while excerpts show key service logic. Several consumers and gateway routes were not sampled, so documented links are cited to the README.

Main entry points: [`api-gateway/src/main/java/com/banking/apigateway/config/RateLimiterConfig.java`](https://github.com/msubham2003/digital-banking-system/blob/main/api-gateway/src/main/java/com/banking/apigateway/config/RateLimiterConfig.java) (Rate-limited gateway), [`transaction-service/src/main/java/com/banking/transactionservice/service/TransactionService.java`](https://github.com/msubham2003/digital-banking-system/blob/main/transaction-service/src/main/java/com/banking/transactionservice/service/TransactionService.java) (Transfer orchestration), [`fraud-detection-service/src/main/java/com/banking/frauddetectionservice/service/FraudDetectionService.java`](https://github.com/msubham2003/digital-banking-system/blob/main/fraud-detection-service/src/main/java/com/banking/frauddetectionservice/service/FraudDetectionService.java) (Fraud checks), [`payment-service/src/main/java/com/banking/paymentservice/service/PaymentService.java`](https://github.com/msubham2003/digital-banking-system/blob/main/payment-service/src/main/java/com/banking/paymentservice/service/PaymentService.java) (Payment processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_edge["API entry"]
  node_gateway["Rate-limited gateway"]
end

subgraph group_accounts["Accounts"]
  node_account_api["Account API"]
  node_account_logic["Account and balance logic"]
  node_account_store[("Account store")]
end

subgraph group_transfers["Transfers"]
  node_transaction_api["Transfer and history API"]
  node_transaction_logic["Transfer orchestration"]
  node_transaction_store[("Transaction store")]
  node_kafka["Kafka topics"]
  node_transaction_consumer["Fraud-result consumer"]
end

subgraph group_risk["Fraud detection"]
  node_fraud_consumer["Initiated-event consumer"]
  node_fraud_logic["Fraud checks"]
  node_redis[("Fraud patterns<br/>[RedisConfig.java]")]
  node_account_client["Account balance client"]
end

subgraph group_payments["Payments and alerts"]
  node_payment_api["Payment and webhook API"]
  node_payment_logic["Payment processing"]
  node_payment_store[("Payment store")]
  node_notifications["Transaction and fraud alerts"]
end

node_user(("Banking user"))
node_razorpay(("Razorpay"))

node_user -->|"sends requests"| node_gateway
node_gateway -.->|"routes requests"| node_account_api
node_gateway -.->|"routes requests"| node_transaction_api
node_gateway -.->|"routes requests"| node_payment_api
node_account_api -->|"calls"| node_account_logic
node_account_logic -->|"reads and writes"| node_account_store
node_transaction_api -->|"calls"| node_transaction_logic
node_transaction_logic -->|"reads and writes"| node_transaction_store
node_transaction_logic -->|"publishes initiated"| node_kafka
node_kafka -->|"delivers initiated"| node_fraud_consumer
node_fraud_consumer -.->|"invokes checks"| node_fraud_logic
node_fraud_logic -->|"fetches balance"| node_account_client
node_fraud_logic -->|"tracks patterns"| node_redis
node_fraud_logic -->|"publishes results"| node_kafka
node_kafka -->|"delivers fraud result"| node_transaction_consumer
node_transaction_logic -->|"deducts or credits balance"| node_account_api
node_kafka -->|"delivers completion and fraud events"| node_account_logic
node_payment_api -->|"calls"| node_payment_logic
node_payment_logic -->|"reads and writes"| node_payment_store
node_payment_logic -->|"creates orders"| node_razorpay
node_razorpay -.->|"sends webhooks"| node_payment_api
node_payment_logic -->|"publishes outcomes"| node_kafka
node_kafka -->|"delivers alerts"| node_notifications

click node_gateway "https://github.com/msubham2003/digital-banking-system/blob/main/api-gateway/src/main/java/com/banking/apigateway/config/RateLimiterConfig.java"
click node_account_api "https://github.com/msubham2003/digital-banking-system/blob/main/account-service/src/main/java/com/banking/accountservice/controller/AccountController.java"
click node_account_logic "https://github.com/msubham2003/digital-banking-system/blob/main/account-service/src/main/java/com/banking/accountservice/service/AccountService.java"
click node_account_store "https://github.com/msubham2003/digital-banking-system/blob/main/account-service/src/main/java/com/banking/accountservice/repository/AccountRepository.java"
click node_transaction_api "https://github.com/msubham2003/digital-banking-system/blob/main/transaction-service/src/main/java/com/banking/transactionservice/controller/TransactionController.java"
click node_transaction_logic "https://github.com/msubham2003/digital-banking-system/blob/main/transaction-service/src/main/java/com/banking/transactionservice/service/TransactionService.java"
click node_transaction_store "https://github.com/msubham2003/digital-banking-system/blob/main/transaction-service/src/main/java/com/banking/transactionservice/repository/TransactionRepository.java"
click node_transaction_consumer "https://github.com/msubham2003/digital-banking-system/blob/main/transaction-service/src/main/java/com/banking/transactionservice/service/TransactionEventConsumer.java"
click node_fraud_consumer "https://github.com/msubham2003/digital-banking-system/blob/main/fraud-detection-service/src/main/java/com/banking/frauddetectionservice/service/TransactionEventConsumer.java"
click node_fraud_logic "https://github.com/msubham2003/digital-banking-system/blob/main/fraud-detection-service/src/main/java/com/banking/frauddetectionservice/service/FraudDetectionService.java"
click node_redis "https://github.com/msubham2003/digital-banking-system/blob/main/fraud-detection-service/src/main/java/com/banking/frauddetectionservice/config/RedisConfig.java"
click node_account_client "https://github.com/msubham2003/digital-banking-system/blob/main/fraud-detection-service/src/main/java/com/banking/frauddetectionservice/client/AccountServiceClient.java"
click node_payment_api "https://github.com/msubham2003/digital-banking-system/blob/main/payment-service/src/main/java/com/banking/paymentservice/controller/PaymentController.java"
click node_payment_logic "https://github.com/msubham2003/digital-banking-system/blob/main/payment-service/src/main/java/com/banking/paymentservice/service/PaymentService.java"
click node_payment_store "https://github.com/msubham2003/digital-banking-system/blob/main/payment-service/src/main/java/com/banking/paymentservice/repository/PaymentRepository.java"
click node_notifications "https://github.com/msubham2003/digital-banking-system/blob/main/notification-service/src/main/java/com/banking/notificationservice/service/NotificationService.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_gateway,node_user toneBlue
class node_account_api,node_account_logic,node_account_store toneAmber
class node_transaction_api,node_transaction_logic,node_transaction_store,node_kafka,node_transaction_consumer toneMint
class node_fraud_consumer,node_fraud_logic,node_redis,node_account_client toneRose
class node_payment_api,node_payment_logic,node_payment_store,node_notifications,node_razorpay toneIndigo
```

## Components

### API entry

- [Rate-limited gateway](https://github.com/msubham2003/digital-banking-system/blob/main/api-gateway/src/main/java/com/banking/apigateway/config/RateLimiterConfig.java): `api-gateway/src/main/java/com/banking/apigateway/config/RateLimiterConfig.java`

### Accounts

- [Account API](https://github.com/msubham2003/digital-banking-system/blob/main/account-service/src/main/java/com/banking/accountservice/controller/AccountController.java): `account-service/src/main/java/com/banking/accountservice/controller/AccountController.java`
- [Account and balance logic](https://github.com/msubham2003/digital-banking-system/blob/main/account-service/src/main/java/com/banking/accountservice/service/AccountService.java): `account-service/src/main/java/com/banking/accountservice/service/AccountService.java`
- [Account store](https://github.com/msubham2003/digital-banking-system/blob/main/account-service/src/main/java/com/banking/accountservice/repository/AccountRepository.java): `account-service/src/main/java/com/banking/accountservice/repository/AccountRepository.java`

### Transfers

- [Transfer and history API](https://github.com/msubham2003/digital-banking-system/blob/main/transaction-service/src/main/java/com/banking/transactionservice/controller/TransactionController.java): `transaction-service/src/main/java/com/banking/transactionservice/controller/TransactionController.java`
- [Transfer orchestration](https://github.com/msubham2003/digital-banking-system/blob/main/transaction-service/src/main/java/com/banking/transactionservice/service/TransactionService.java): `transaction-service/src/main/java/com/banking/transactionservice/service/TransactionService.java`
- [Transaction store](https://github.com/msubham2003/digital-banking-system/blob/main/transaction-service/src/main/java/com/banking/transactionservice/repository/TransactionRepository.java): `transaction-service/src/main/java/com/banking/transactionservice/repository/TransactionRepository.java`
- **Kafka topics**
- [Fraud-result consumer](https://github.com/msubham2003/digital-banking-system/blob/main/transaction-service/src/main/java/com/banking/transactionservice/service/TransactionEventConsumer.java): `transaction-service/src/main/java/com/banking/transactionservice/service/TransactionEventConsumer.java`

### Fraud detection

- [Initiated-event consumer](https://github.com/msubham2003/digital-banking-system/blob/main/fraud-detection-service/src/main/java/com/banking/frauddetectionservice/service/TransactionEventConsumer.java): `fraud-detection-service/src/main/java/com/banking/frauddetectionservice/service/TransactionEventConsumer.java`
- [Fraud checks](https://github.com/msubham2003/digital-banking-system/blob/main/fraud-detection-service/src/main/java/com/banking/frauddetectionservice/service/FraudDetectionService.java): `fraud-detection-service/src/main/java/com/banking/frauddetectionservice/service/FraudDetectionService.java`
- [Fraud patterns](https://github.com/msubham2003/digital-banking-system/blob/main/fraud-detection-service/src/main/java/com/banking/frauddetectionservice/config/RedisConfig.java): `fraud-detection-service/src/main/java/com/banking/frauddetectionservice/config/RedisConfig.java`
- [Account balance client](https://github.com/msubham2003/digital-banking-system/blob/main/fraud-detection-service/src/main/java/com/banking/frauddetectionservice/client/AccountServiceClient.java): `fraud-detection-service/src/main/java/com/banking/frauddetectionservice/client/AccountServiceClient.java`

### Payments and alerts

- [Payment and webhook API](https://github.com/msubham2003/digital-banking-system/blob/main/payment-service/src/main/java/com/banking/paymentservice/controller/PaymentController.java): `payment-service/src/main/java/com/banking/paymentservice/controller/PaymentController.java`
- [Payment processing](https://github.com/msubham2003/digital-banking-system/blob/main/payment-service/src/main/java/com/banking/paymentservice/service/PaymentService.java): `payment-service/src/main/java/com/banking/paymentservice/service/PaymentService.java`
- [Payment store](https://github.com/msubham2003/digital-banking-system/blob/main/payment-service/src/main/java/com/banking/paymentservice/repository/PaymentRepository.java): `payment-service/src/main/java/com/banking/paymentservice/repository/PaymentRepository.java`
- [Transaction and fraud alerts](https://github.com/msubham2003/digital-banking-system/blob/main/notification-service/src/main/java/com/banking/notificationservice/service/NotificationService.java): `notification-service/src/main/java/com/banking/notificationservice/service/NotificationService.java`

### Other components

- **Banking user**
- **Razorpay**

## Connections

- Banking user → Rate-limited gateway: sends requests
- Rate-limited gateway → Account API: routes requests
- Rate-limited gateway → Transfer and history API: routes requests
- Rate-limited gateway → Payment and webhook API: routes requests
- Account API → Account and balance logic: calls (evidence: `account-service/src/main/java/com/banking/accountservice/controller/AccountController.java`)
- Account and balance logic → Account store: reads and writes (evidence: `account-service/src/main/java/com/banking/accountservice/service/AccountService.java`)
- Transfer and history API → Transfer orchestration: calls (evidence: `transaction-service/src/main/java/com/banking/transactionservice/controller/TransactionController.java`)
- Transfer orchestration → Transaction store: reads and writes (evidence: `transaction-service/src/main/java/com/banking/transactionservice/service/TransactionService.java`)
- Transfer orchestration → Kafka topics: publishes initiated (evidence: `transaction-service/src/main/java/com/banking/transactionservice/service/TransactionService.java`)
- Kafka topics → Initiated-event consumer: delivers initiated
- Initiated-event consumer → Fraud checks: invokes checks (evidence: `fraud-detection-service/src/main/java/com/banking/frauddetectionservice/service/TransactionEventConsumer.java`)
- Fraud checks → Account balance client: fetches balance (evidence: `fraud-detection-service/src/main/java/com/banking/frauddetectionservice/service/FraudDetectionService.java`)
- Fraud checks → Fraud patterns: tracks patterns (evidence: `fraud-detection-service/src/main/java/com/banking/frauddetectionservice/service/FraudDetectionService.java`)
- Fraud checks → Kafka topics: publishes results (evidence: `fraud-detection-service/src/main/java/com/banking/frauddetectionservice/service/FraudDetectionService.java`)
- Kafka topics → Fraud-result consumer: delivers fraud result
- Transfer orchestration → Account API: deducts or credits balance
- Kafka topics → Account and balance logic: delivers completion and fraud events
- Payment and webhook API → Payment processing: calls (evidence: `payment-service/src/main/java/com/banking/paymentservice/controller/PaymentController.java`)
- Payment processing → Payment store: reads and writes (evidence: `payment-service/src/main/java/com/banking/paymentservice/service/PaymentService.java`)
- Payment processing → Razorpay: creates orders (evidence: `payment-service/src/main/java/com/banking/paymentservice/service/PaymentService.java`)
- Razorpay → Payment and webhook API: sends webhooks
- Payment processing → Kafka topics: publishes outcomes (evidence: `payment-service/src/main/java/com/banking/paymentservice/service/PaymentService.java`)
- Kafka topics → Transaction and fraud alerts: delivers alerts
