# lokeshzenbook-coder/bank-application architecture

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

- Interactive diagram: https://gitdiagram.com/lokeshzenbook-coder/bank-application
- Repository: https://github.com/lokeshzenbook-coder/bank-application

## Overview

This is a React banking portal backed by Go microservices, an API gateway, and shared platform infrastructure. The main user path is browser → portal authentication and banking pages → gateway → banking services; money operations post balanced entries to the ledger, with transaction events published asynchronously for notifications, risk, audit, and reporting. The README documents these system-level connections; the source excerpts confirm the portal routes and selected service wiring. Many service internals were not sampled, so their finer call relationships are intentionally omitted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/App.jsx) (Portal routes), [`services/api-gateway/internal/proxy/proxy.go`](https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/api-gateway/internal/proxy/proxy.go) (API gateway), [`pkg/kafka/producer.go`](https://github.com/lokeshzenbook-coder/bank-application/blob/main/pkg/kafka/producer.go) (Kafka event bus), [`services/transaction-service/internal/service/service.go`](https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/transaction-service/internal/service/service.go) (Money transactions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Customer portal"]
  node_app["Portal routes<br/>[App.jsx]"]
  node_authui["Portal auth<br/>[auth.jsx]"]
  node_layout["Portal layout<br/>[Layout.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_accountsui["Accounts page<br/>[Accounts.jsx]"]
  node_depositui["Deposit page<br/>[Deposit.jsx]"]
  node_transferui["Transfer page<br/>[Transfer.jsx]"]
  node_cardsui["Cards page<br/>[Cards.jsx]"]
  node_loansui["Loans page<br/>[Loans.jsx]"]
  node_login["Login page<br/>[Login.jsx]"]
  node_register["Registration page<br/>[Register.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_authsvc["Authentication<br/>[service.go]"]
  node_authzsvc["Authorization<br/>[service.go]"]
  node_customers["Customer identity<br/>[service.go]"]
end

subgraph group_banking["Banking operations"]
  node_accounts["Accounts<br/>[service.go]"]
  node_transactions["Money transactions<br/>[service.go]"]
  node_ledger["Double-entry ledger<br/>[service.go]"]
  node_payments["Payments and wallets<br/>[service.go]"]
end

subgraph group_products["Products and profiles"]
  node_products["Banking products<br/>[service.go]"]
  node_loan["Loans<br/>[service.go]"]
  node_deposits["Deposit products<br/>[service.go]"]
  node_profile["Customer profile<br/>[service.go]"]
end

subgraph group_events["Events and insights"]
  node_kafka["Kafka event bus<br/>[producer.go]"]
  node_outbox["Transactional outbox<br/>[outbox.go]"]
  node_notifications["Notifications<br/>[service.go]"]
  node_risk["Fraud monitoring<br/>[service.go]"]
  node_audit["Audit log<br/>[service.go]"]
  node_insights["Analytics and reports<br/>[service.go]"]
end

subgraph group_platform["Platform infrastructure"]
  node_gateway["API gateway<br/>[proxy.go]"]
  node_postgres[("PostgreSQL<br/>[postgres.go]")]
  node_redis[("Redis<br/>[redis.go]")]
  node_s3[("S3 documents<br/>[s3.go]")]
  node_grpc["gRPC contracts<br/>[ledger.proto]"]
end

node_browser(("Browser"))

node_browser -->|"uses portal"| node_app
node_app -->|"guards routes"| node_authui
node_app -->|"renders"| node_layout
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_accountsui
node_app -->|"routes to"| node_depositui
node_app -->|"routes to"| node_transferui
node_app -->|"routes to"| node_cardsui
node_app -->|"routes to"| node_loansui
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_browser -->|"REST requests"| node_gateway
node_gateway -->|"routes requests"| node_authsvc
node_gateway -->|"routes requests"| node_accounts
node_gateway -->|"routes requests"| node_transactions
node_gateway -->|"routes requests"| node_payments
node_gateway -->|"routes requests"| node_products
node_gateway -->|"routes requests"| node_loan
node_gateway -->|"routes requests"| node_profile
node_accounts -->|"queries balances"| node_ledger
node_transactions -->|"posts entries"| node_ledger
node_transactions -->|"records events"| node_outbox
node_outbox -->|"publishes events"| node_kafka
node_kafka -->|"delivers events"| node_notifications
node_kafka -->|"delivers events"| node_risk
node_kafka -->|"delivers events"| node_audit
node_kafka -->|"delivers events"| node_insights
node_transactions -->|"stores operations"| node_postgres
node_authsvc -->|"stores sessions"| node_redis
node_ledger -->|"implements contract"| node_grpc
node_gateway -.->|"internal gRPC"| node_grpc
node_products -.->|"stores documents"| node_s3

click node_app "https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/App.jsx"
click node_authui "https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/auth.jsx"
click node_layout "https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/components/Layout.jsx"
click node_dashboard "https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/pages/Dashboard.jsx"
click node_accountsui "https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/pages/Accounts.jsx"
click node_depositui "https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/pages/Deposit.jsx"
click node_transferui "https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/pages/Transfer.jsx"
click node_cardsui "https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/pages/Cards.jsx"
click node_loansui "https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/pages/Loans.jsx"
click node_login "https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/pages/Login.jsx"
click node_register "https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/pages/Register.jsx"
click node_gateway "https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/api-gateway/internal/proxy/proxy.go"
click node_authsvc "https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/auth-service/internal/service/service.go"
click node_authzsvc "https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/authz-service/internal/service/service.go"
click node_customers "https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/customer-service/internal/service/service.go"
click node_accounts "https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/account-service/internal/service/service.go"
click node_transactions "https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/transaction-service/internal/service/service.go"
click node_ledger "https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/ledger-service/internal/service/service.go"
click node_payments "https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/payment-service/internal/service/service.go"
click node_products "https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/card-service/internal/service/service.go"
click node_loan "https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/loan-service/internal/service/service.go"
click node_deposits "https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/fixed-deposit-service/internal/service/service.go"
click node_profile "https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/profile-service/internal/service/service.go"
click node_kafka "https://github.com/lokeshzenbook-coder/bank-application/blob/main/pkg/kafka/producer.go"
click node_outbox "https://github.com/lokeshzenbook-coder/bank-application/blob/main/pkg/outbox/outbox.go"
click node_notifications "https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/notification-service/internal/service/service.go"
click node_risk "https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/fraud-service/internal/service/service.go"
click node_audit "https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/audit-service/internal/service/service.go"
click node_insights "https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/analytics-service/internal/service/service.go"
click node_postgres "https://github.com/lokeshzenbook-coder/bank-application/blob/main/pkg/postgres/postgres.go"
click node_redis "https://github.com/lokeshzenbook-coder/bank-application/blob/main/pkg/redis/redis.go"
click node_s3 "https://github.com/lokeshzenbook-coder/bank-application/blob/main/pkg/s3/s3.go"
click node_grpc "https://github.com/lokeshzenbook-coder/bank-application/blob/main/proto/ledger/v1/ledger.proto"

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_app,node_authui,node_layout,node_dashboard,node_accountsui,node_depositui,node_transferui,node_cardsui,node_loansui,node_login,node_register,node_browser toneBlue
class node_authsvc,node_authzsvc,node_customers toneAmber
class node_accounts,node_transactions,node_ledger,node_payments toneMint
class node_products,node_loan,node_deposits,node_profile toneRose
class node_kafka,node_outbox,node_notifications,node_risk,node_audit,node_insights toneIndigo
class node_gateway,node_postgres,node_redis,node_s3,node_grpc toneTeal
```

## Components

### Customer portal

- [Portal routes](https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Portal auth](https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/auth.jsx): `frontend/src/auth.jsx`
- [Portal layout](https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/components/Layout.jsx): `frontend/src/components/Layout.jsx`
- [Dashboard](https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Accounts page](https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/pages/Accounts.jsx): `frontend/src/pages/Accounts.jsx`
- [Deposit page](https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/pages/Deposit.jsx): `frontend/src/pages/Deposit.jsx`
- [Transfer page](https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/pages/Transfer.jsx): `frontend/src/pages/Transfer.jsx`
- [Cards page](https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/pages/Cards.jsx): `frontend/src/pages/Cards.jsx`
- [Loans page](https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/pages/Loans.jsx): `frontend/src/pages/Loans.jsx`
- [Login page](https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Registration page](https://github.com/lokeshzenbook-coder/bank-application/blob/main/frontend/src/pages/Register.jsx): `frontend/src/pages/Register.jsx`

### Identity and access

- [Authentication](https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/auth-service/internal/service/service.go): `services/auth-service/internal/service/service.go`
- [Authorization](https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/authz-service/internal/service/service.go): `services/authz-service/internal/service/service.go`
- [Customer identity](https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/customer-service/internal/service/service.go): `services/customer-service/internal/service/service.go`

### Banking operations

- [Accounts](https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/account-service/internal/service/service.go): `services/account-service/internal/service/service.go`
- [Money transactions](https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/transaction-service/internal/service/service.go): `services/transaction-service/internal/service/service.go`
- [Double-entry ledger](https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/ledger-service/internal/service/service.go): `services/ledger-service/internal/service/service.go`
- [Payments and wallets](https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/payment-service/internal/service/service.go): `services/payment-service/internal/service/service.go`

### Products and profiles

- [Banking products](https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/card-service/internal/service/service.go): `services/card-service/internal/service/service.go`
- [Loans](https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/loan-service/internal/service/service.go): `services/loan-service/internal/service/service.go`
- [Deposit products](https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/fixed-deposit-service/internal/service/service.go): `services/fixed-deposit-service/internal/service/service.go`
- [Customer profile](https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/profile-service/internal/service/service.go): `services/profile-service/internal/service/service.go`

### Events and insights

- [Kafka event bus](https://github.com/lokeshzenbook-coder/bank-application/blob/main/pkg/kafka/producer.go): `pkg/kafka/producer.go`
- [Transactional outbox](https://github.com/lokeshzenbook-coder/bank-application/blob/main/pkg/outbox/outbox.go): `pkg/outbox/outbox.go`
- [Notifications](https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/notification-service/internal/service/service.go): `services/notification-service/internal/service/service.go`
- [Fraud monitoring](https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/fraud-service/internal/service/service.go): `services/fraud-service/internal/service/service.go`
- [Audit log](https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/audit-service/internal/service/service.go): `services/audit-service/internal/service/service.go`
- [Analytics and reports](https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/analytics-service/internal/service/service.go): `services/analytics-service/internal/service/service.go`

### Platform infrastructure

- [API gateway](https://github.com/lokeshzenbook-coder/bank-application/blob/main/services/api-gateway/internal/proxy/proxy.go): `services/api-gateway/internal/proxy/proxy.go`
- [PostgreSQL](https://github.com/lokeshzenbook-coder/bank-application/blob/main/pkg/postgres/postgres.go): `pkg/postgres/postgres.go`
- [Redis](https://github.com/lokeshzenbook-coder/bank-application/blob/main/pkg/redis/redis.go): `pkg/redis/redis.go`
- [S3 documents](https://github.com/lokeshzenbook-coder/bank-application/blob/main/pkg/s3/s3.go): `pkg/s3/s3.go`
- [gRPC contracts](https://github.com/lokeshzenbook-coder/bank-application/blob/main/proto/ledger/v1/ledger.proto): `proto/ledger/v1/ledger.proto`

### Other components

- **Browser**

## Connections

- Browser → Portal routes: uses portal (evidence: `README.md`)
- Portal routes → Portal auth: guards routes (evidence: `frontend/src/App.jsx`)
- Portal routes → Portal layout: renders (evidence: `frontend/src/App.jsx`)
- Portal routes → Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Portal routes → Accounts page: routes to (evidence: `frontend/src/App.jsx`)
- Portal routes → Deposit page: routes to (evidence: `frontend/src/App.jsx`)
- Portal routes → Transfer page: routes to (evidence: `frontend/src/App.jsx`)
- Portal routes → Cards page: routes to (evidence: `frontend/src/App.jsx`)
- Portal routes → Loans page: routes to (evidence: `frontend/src/App.jsx`)
- Portal routes → Login page: routes to (evidence: `frontend/src/App.jsx`)
- Portal routes → Registration page: routes to (evidence: `frontend/src/App.jsx`)
- Browser → API gateway: REST requests (evidence: `README.md`)
- API gateway → Authentication: routes requests (evidence: `README.md`)
- API gateway → Accounts: routes requests (evidence: `README.md`)
- API gateway → Money transactions: routes requests (evidence: `README.md`)
- API gateway → Payments and wallets: routes requests (evidence: `README.md`)
- API gateway → Banking products: routes requests (evidence: `README.md`)
- API gateway → Loans: routes requests (evidence: `README.md`)
- API gateway → Customer profile: routes requests (evidence: `README.md`)
- Accounts → Double-entry ledger: queries balances (evidence: `README.md`)
- Money transactions → Double-entry ledger: posts entries (evidence: `README.md`)
- Money transactions → Transactional outbox: records events
- Transactional outbox → Kafka event bus: publishes events
- Kafka event bus → Notifications: delivers events
- Kafka event bus → Fraud monitoring: delivers events
- Kafka event bus → Audit log: delivers events
- Kafka event bus → Analytics and reports: delivers events
- Money transactions → PostgreSQL: stores operations
- Authentication → Redis: stores sessions
- Double-entry ledger → gRPC contracts: implements contract (evidence: `README.md`)
- API gateway → gRPC contracts: internal gRPC (evidence: `README.md`)
- Banking products → S3 documents: stores documents (evidence: `README.md`)
