# ushmans087/digitalwallet architecture

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

- Interactive diagram: https://gitdiagram.com/ushmans087/digitalwallet
- Repository: https://github.com/ushmans087/digitalwallet

## Overview

Digital Wallet is a microservices application for authentication, wallet and bank-account management, transfers, payments, and transaction history. A user accesses the browser interface, which makes authenticated requests through the API Gateway; backend services provide domain operations and use MySQL, Redis, Kafka, and Eureka as documented. The graph preserves documented capabilities and service relationships; most backend source was not sampled, so detailed controller-to-service calls and exact event handlers are not asserted.

Main entry points: [`api-gateway/src/main/java/com/sample/api_gateway`](https://github.com/ushmans087/digitalwallet/tree/main/api-gateway/src/main/java/com/sample/api_gateway) (API gateway), [`wallet-server/src/main/java/com/sample/wallet_server/Wallet`](https://github.com/ushmans087/digitalwallet/tree/main/wallet-server/src/main/java/com/sample/wallet_server/Wallet) (Wallet and accounts), [`payment-server/src/main/java/com/sample/payment_server/Payment`](https://github.com/ushmans087/digitalwallet/tree/main/payment-server/src/main/java/com/sample/payment_server/Payment) (Payments and transfers), [`discovery/src/main/java/com/digital_wallet/discovery/DiscoveryApplication.java`](https://github.com/ushmans087/digitalwallet/blob/main/discovery/src/main/java/com/digital_wallet/discovery/DiscoveryApplication.java) (Service discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client access"]
  node_web["Wallet interface<br/>[dashboard.html]"]
  node_authjs["Session and API client<br/>[auth.js]"]
end

subgraph group_services["Wallet services"]
  node_login["Authentication"]
  node_gateway["API gateway"]
  node_wallet["Wallet and accounts"]
  node_bank["Bank accounts"]
  node_validation["Transfer validation"]
  node_payment["Payments and transfers"]
  node_history["Transaction history"]
end

subgraph group_messaging["Messaging and discovery"]
  node_discovery["Service discovery"]
  node_kafka["Event broker"]
end

subgraph group_infrastructure["Data and infrastructure"]
  node_mysql[("MySQL persistence")]
  node_redis[("Redis cache")]
end

node_user(("Wallet user"))

node_user -->|"uses"| node_web
node_web -.->|"uses auth client"| node_authjs
node_authjs -->|"sends API requests"| node_gateway
node_gateway -.->|"routes requests"| node_login
node_gateway -.->|"routes requests"| node_wallet
node_gateway -.->|"routes requests"| node_bank
node_gateway -.->|"routes requests"| node_payment
node_gateway -.->|"routes requests"| node_history
node_wallet -.->|"validates transfers"| node_validation
node_payment -->|"publishes events"| node_kafka
node_kafka -->|"delivers events"| node_wallet
node_login -->|"publishes registrations"| node_kafka
node_kafka -->|"delivers registrations"| node_wallet
node_wallet -->|"persists data"| node_mysql
node_payment -->|"persists data"| node_mysql
node_wallet -->|"caches wallet data"| node_redis
node_gateway -.->|"uses discovery"| node_discovery
node_login -->|"registers service"| node_discovery
node_wallet -->|"registers service"| node_discovery
node_payment -->|"registers service"| node_discovery

click node_web "https://github.com/ushmans087/digitalwallet/blob/main/frontend/dashboard.html"
click node_authjs "https://github.com/ushmans087/digitalwallet/blob/main/frontend/auth.js"
click node_login "https://github.com/ushmans087/digitalwallet/tree/main/test/src/main/java/com/sample/test/Authentication"
click node_gateway "https://github.com/ushmans087/digitalwallet/tree/main/api-gateway/src/main/java/com/sample/api_gateway"
click node_wallet "https://github.com/ushmans087/digitalwallet/tree/main/wallet-server/src/main/java/com/sample/wallet_server/Wallet"
click node_bank "https://github.com/ushmans087/digitalwallet/tree/main/wallet-server/src/main/java/com/sample/wallet_server/Bank"
click node_validation "https://github.com/ushmans087/digitalwallet/tree/main/wallet-server/src/main/java/com/sample/wallet_server/Validator"
click node_payment "https://github.com/ushmans087/digitalwallet/tree/main/payment-server/src/main/java/com/sample/payment_server/Payment"
click node_history "https://github.com/ushmans087/digitalwallet/tree/main/payment-server/src/main/java/com/sample/payment_server/Transactions"
click node_discovery "https://github.com/ushmans087/digitalwallet/blob/main/discovery/src/main/java/com/digital_wallet/discovery/DiscoveryApplication.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_web,node_authjs,node_user toneBlue
class node_login,node_gateway,node_wallet,node_bank,node_validation,node_payment,node_history toneAmber
class node_discovery,node_kafka toneMint
class node_mysql,node_redis toneRose
```

## Components

### Client access

- [Wallet interface](https://github.com/ushmans087/digitalwallet/blob/main/frontend/dashboard.html): `frontend/dashboard.html`
- [Session and API client](https://github.com/ushmans087/digitalwallet/blob/main/frontend/auth.js): `frontend/auth.js`

### Wallet services

- [Authentication](https://github.com/ushmans087/digitalwallet/tree/main/test/src/main/java/com/sample/test/Authentication): `test/src/main/java/com/sample/test/Authentication`
- [API gateway](https://github.com/ushmans087/digitalwallet/tree/main/api-gateway/src/main/java/com/sample/api_gateway): `api-gateway/src/main/java/com/sample/api_gateway`
- [Wallet and accounts](https://github.com/ushmans087/digitalwallet/tree/main/wallet-server/src/main/java/com/sample/wallet_server/Wallet): `wallet-server/src/main/java/com/sample/wallet_server/Wallet`
- [Bank accounts](https://github.com/ushmans087/digitalwallet/tree/main/wallet-server/src/main/java/com/sample/wallet_server/Bank): `wallet-server/src/main/java/com/sample/wallet_server/Bank`
- [Transfer validation](https://github.com/ushmans087/digitalwallet/tree/main/wallet-server/src/main/java/com/sample/wallet_server/Validator): `wallet-server/src/main/java/com/sample/wallet_server/Validator`
- [Payments and transfers](https://github.com/ushmans087/digitalwallet/tree/main/payment-server/src/main/java/com/sample/payment_server/Payment): `payment-server/src/main/java/com/sample/payment_server/Payment`
- [Transaction history](https://github.com/ushmans087/digitalwallet/tree/main/payment-server/src/main/java/com/sample/payment_server/Transactions): `payment-server/src/main/java/com/sample/payment_server/Transactions`

### Messaging and discovery

- [Service discovery](https://github.com/ushmans087/digitalwallet/blob/main/discovery/src/main/java/com/digital_wallet/discovery/DiscoveryApplication.java): `discovery/src/main/java/com/digital_wallet/discovery/DiscoveryApplication.java`
- **Event broker**

### Data and infrastructure

- **MySQL persistence**
- **Redis cache**

### Other components

- **Wallet user**

## Connections

- Wallet user → Wallet interface: uses (evidence: `README.md`)
- Wallet interface → Session and API client: uses auth client
- Session and API client → API gateway: sends API requests (evidence: `frontend/auth.js`)
- API gateway → Authentication: routes requests
- API gateway → Wallet and accounts: routes requests
- API gateway → Bank accounts: routes requests
- API gateway → Payments and transfers: routes requests
- API gateway → Transaction history: routes requests
- Wallet and accounts → Transfer validation: validates transfers
- Payments and transfers → Event broker: publishes events (evidence: `README.md`)
- Event broker → Wallet and accounts: delivers events (evidence: `README.md`)
- Authentication → Event broker: publishes registrations (evidence: `README.md`)
- Event broker → Wallet and accounts: delivers registrations (evidence: `README.md`)
- Wallet and accounts → MySQL persistence: persists data (evidence: `README.md`)
- Payments and transfers → MySQL persistence: persists data (evidence: `README.md`)
- Wallet and accounts → Redis cache: caches wallet data (evidence: `README.md`)
- API gateway → Service discovery: uses discovery (evidence: `README.md`)
- Authentication → Service discovery: registers service (evidence: `README.md`)
- Wallet and accounts → Service discovery: registers service (evidence: `README.md`)
- Payments and transfers → Service discovery: registers service (evidence: `README.md`)
