# saransh-chauhan/fintech-core architecture

> Architecture diagram of the GitHub repository saransh-chauhan/fintech-core, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/saransh-chauhan/fintech-core
- Repository: https://github.com/saransh-chauhan/fintech-core

## Overview

FintechCore is a Spring Boot fintech microservices project. Its clearest implemented workflow is wallet management: a client submits wallet operations, which the wallet service handles and persists; the README describes create, credit, debit, transfer, and wallet status operations. The README also documents payment processing, immutable ledger records, and notifications, but their source directories contain only placeholders in this tree, so their internal flows are not verifiable. Edges for wallet layering are dashed where the sampled source does not show the calls.

Main entry points: [`payment-service/src/main/java/com/saransh/fintech/payment`](https://github.com/saransh-chauhan/fintech-core/tree/main/payment-service/src/main/java/com/saransh/fintech/payment) (Payment processor), [`wallet-service/src/main/java/com/saransh/fintech/wallet/controller/WalletController.java`](https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/controller/WalletController.java) (Wallet API), [`wallet-service/src/main/java/com/saransh/fintech/wallet/service/domain/WalletDomainServiceImpl.java`](https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/service/domain/WalletDomainServiceImpl.java) (Wallet domain), [`wallet-service/src/main/java/com/saransh/fintech/wallet/entity/Wallet.java`](https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/entity/Wallet.java) (Wallet state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_wallet["Wallet service"]
  node_wallet_api["Wallet API"]
  node_wallet_app["Wallet operations"]
  node_wallet_domain["Wallet domain"]
  node_wallet_mapper["Wallet mapping<br/>[WalletMapper.java]"]
  node_wallet_contracts["Wallet API models"]
  node_wallet_entity["Wallet state<br/>[Wallet.java]"]
  node_wallet_repo["Wallet repository"]
  node_wallet_db[("Wallet database")]
  node_wallet_errors["API error handling"]
  node_wallet_filter["Correlation tracking"]
  node_wallet_health["Health and version"]
end

subgraph group_payments["Payment processing"]
  node_payment["Payment processor"]
  node_idempotency["Idempotency and outbox"]
end

subgraph group_records["Ledger and notifications"]
  node_ledger["Immutable ledger"]
  node_notification["Notifications"]
end

subgraph group_shared["Shared and infrastructure"]
  node_events["Payment events"]
  node_kafka["Kafka"]
  node_redis[("Redis")]
end

node_client(("API client"))

node_client -->|"calls"| node_wallet_api
node_wallet_api -.->|"delegates to"| node_wallet_app
node_wallet_app -.->|"coordinates"| node_wallet_domain
node_wallet_domain -.->|"maps"| node_wallet_mapper
node_wallet_domain -.->|"accesses"| node_wallet_repo
node_wallet_mapper -->|"maps state"| node_wallet_entity
node_wallet_repo -->|"persists"| node_wallet_entity
node_wallet_entity -.->|"maps table"| node_wallet_db
node_wallet_api -.->|"accepts"| node_wallet_contracts
node_wallet_api -.->|"returns errors"| node_wallet_errors
node_client -->|"checks status"| node_wallet_health
node_payment -.->|"uses"| node_idempotency
node_payment -.->|"publishes"| node_events
node_payment -.->|"records payment"| node_ledger
node_payment -.->|"triggers notice"| node_notification
node_payment -.->|"checks idempotency"| node_redis
node_events -.->|"communicates via"| node_kafka
node_kafka -.->|"dispatches events"| node_ledger
node_kafka -.->|"dispatches events"| node_notification

click node_wallet_api "https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/controller/WalletController.java"
click node_wallet_app "https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/service/application/WalletApplicationServiceImpl.java"
click node_wallet_domain "https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/service/domain/WalletDomainServiceImpl.java"
click node_wallet_mapper "https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/mapper/WalletMapper.java"
click node_wallet_contracts "https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/dto/request/TransferWalletRequest.java"
click node_wallet_entity "https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/entity/Wallet.java"
click node_wallet_repo "https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/repository/WalletRepository.java"
click node_wallet_db "https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/resources/db/migration/V1__create_wallet_schema.sql"
click node_wallet_errors "https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/exception/GlobalExceptionHandler.java"
click node_wallet_filter "https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/filter/CorrelationIdFilter.java"
click node_wallet_health "https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/metrics/HealthController.java"
click node_payment "https://github.com/saransh-chauhan/fintech-core/tree/main/payment-service/src/main/java/com/saransh/fintech/payment"
click node_idempotency "https://github.com/saransh-chauhan/fintech-core/tree/main/payment-service/src/main/java/com/saransh/fintech/payment"
click node_ledger "https://github.com/saransh-chauhan/fintech-core/tree/main/ledger-service/src/main/java/com/saransh/fintech/ledger"
click node_notification "https://github.com/saransh-chauhan/fintech-core/tree/main/notification-service/src/main/java/com/saransh/fintech/notification"
click node_events "https://github.com/saransh-chauhan/fintech-core/tree/main/common/src/main/java/com/saransh/fintech/common/events"

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_wallet_api,node_wallet_app,node_wallet_domain,node_wallet_mapper,node_wallet_contracts,node_wallet_entity,node_wallet_repo,node_wallet_db,node_wallet_errors,node_wallet_filter,node_wallet_health,node_client toneBlue
class node_payment,node_idempotency toneAmber
class node_ledger,node_notification toneMint
class node_events,node_kafka,node_redis toneRose
```

## Components

### Wallet service

- [Wallet API](https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/controller/WalletController.java): `wallet-service/src/main/java/com/saransh/fintech/wallet/controller/WalletController.java`
- [Wallet operations](https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/service/application/WalletApplicationServiceImpl.java): `wallet-service/src/main/java/com/saransh/fintech/wallet/service/application/WalletApplicationServiceImpl.java`
- [Wallet domain](https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/service/domain/WalletDomainServiceImpl.java): `wallet-service/src/main/java/com/saransh/fintech/wallet/service/domain/WalletDomainServiceImpl.java`
- [Wallet mapping](https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/mapper/WalletMapper.java): `wallet-service/src/main/java/com/saransh/fintech/wallet/mapper/WalletMapper.java`
- [Wallet API models](https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/dto/request/TransferWalletRequest.java): `wallet-service/src/main/java/com/saransh/fintech/wallet/dto/request/TransferWalletRequest.java`
- [Wallet state](https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/entity/Wallet.java): `wallet-service/src/main/java/com/saransh/fintech/wallet/entity/Wallet.java`
- [Wallet repository](https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/repository/WalletRepository.java): `wallet-service/src/main/java/com/saransh/fintech/wallet/repository/WalletRepository.java`
- [Wallet database](https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/resources/db/migration/V1__create_wallet_schema.sql): `wallet-service/src/main/resources/db/migration/V1__create_wallet_schema.sql`
- [API error handling](https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/exception/GlobalExceptionHandler.java): `wallet-service/src/main/java/com/saransh/fintech/wallet/exception/GlobalExceptionHandler.java`
- [Correlation tracking](https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/filter/CorrelationIdFilter.java): `wallet-service/src/main/java/com/saransh/fintech/wallet/filter/CorrelationIdFilter.java`
- [Health and version](https://github.com/saransh-chauhan/fintech-core/blob/main/wallet-service/src/main/java/com/saransh/fintech/wallet/metrics/HealthController.java): `wallet-service/src/main/java/com/saransh/fintech/wallet/metrics/HealthController.java`

### Payment processing

- [Payment processor](https://github.com/saransh-chauhan/fintech-core/tree/main/payment-service/src/main/java/com/saransh/fintech/payment): `payment-service/src/main/java/com/saransh/fintech/payment`
- [Idempotency and outbox](https://github.com/saransh-chauhan/fintech-core/tree/main/payment-service/src/main/java/com/saransh/fintech/payment): `payment-service/src/main/java/com/saransh/fintech/payment`

### Ledger and notifications

- [Immutable ledger](https://github.com/saransh-chauhan/fintech-core/tree/main/ledger-service/src/main/java/com/saransh/fintech/ledger): `ledger-service/src/main/java/com/saransh/fintech/ledger`
- [Notifications](https://github.com/saransh-chauhan/fintech-core/tree/main/notification-service/src/main/java/com/saransh/fintech/notification): `notification-service/src/main/java/com/saransh/fintech/notification`

### Shared and infrastructure

- [Payment events](https://github.com/saransh-chauhan/fintech-core/tree/main/common/src/main/java/com/saransh/fintech/common/events): `common/src/main/java/com/saransh/fintech/common/events`
- **Kafka**
- **Redis**

### Other components

- **API client**

## Connections

- API client → Wallet API: calls (evidence: `README.md`)
- Wallet API → Wallet operations: delegates to
- Wallet operations → Wallet domain: coordinates
- Wallet domain → Wallet mapping: maps
- Wallet domain → Wallet repository: accesses
- Wallet mapping → Wallet state: maps state (evidence: `wallet-service/src/main/java/com/saransh/fintech/wallet/mapper/WalletMapper.java`)
- Wallet repository → Wallet state: persists (evidence: `wallet-service/src/main/java/com/saransh/fintech/wallet/repository/WalletRepository.java`)
- Wallet state → Wallet database: maps table
- Wallet API → Wallet API models: accepts
- Wallet API → API error handling: returns errors
- API client → Health and version: checks status (evidence: `wallet-service/src/main/java/com/saransh/fintech/wallet/metrics/HealthController.java`)
- Payment processor → Idempotency and outbox: uses (evidence: `README.md`)
- Payment processor → Payment events: publishes
- Payment processor → Immutable ledger: records payment
- Payment processor → Notifications: triggers notice
- Payment processor → Redis: checks idempotency (evidence: `README.md`)
- Payment events → Kafka: communicates via (evidence: `README.md`)
- Kafka → Immutable ledger: dispatches events
- Kafka → Notifications: dispatches events
