# dushansenura/zentrix-bank architecture

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

- Interactive diagram: https://gitdiagram.com/dushansenura/zentrix-bank
- Repository: https://github.com/dushansenura/zentrix-bank

## Overview

Zentrix Bank is a Flutter banking prototype whose repositories default to in-memory mocks; an optional API configuration switches core repositories to HTTP. The main customer journey is sign-in, account overview, then a payment draft reviewed, locally authorized, processed, and receipted. The README documents the broader banking, savings, analytics, security, and resilience capabilities. Source excerpts are limited to platform runners, so product relationships below rely on README statements; unsampled implementation details are not inferred.

Main entry points: [`lib/app/router.dart`](https://github.com/dushansenura/zentrix-bank/blob/main/lib/app/router.dart) (Auth routing), [`lib/features/payments/presentation/payment_submission.dart`](https://github.com/dushansenura/zentrix-bank/blob/main/lib/features/payments/presentation/payment_submission.dart) (Draft and authorize), [`lib/features/payments/data`](https://github.com/dushansenura/zentrix-bank/tree/main/lib/features/payments/data) (Payment repositories), [`lib/features/dashboard/presentation/dashboard_page.dart`](https://github.com/dushansenura/zentrix-bank/blob/main/lib/features/dashboard/presentation/dashboard_page.dart) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_app_shell["App shell<br/>[app.dart]"]
  node_routing["Auth routing<br/>[router.dart]"]
  node_auth["Authentication"]
end

subgraph group_banking["Banking services"]
  node_dashboard["Dashboard"]
  node_account_data["Banking repositories"]
  node_cards["Card management"]
  node_savings_loans["Savings and loans"]
  node_analytics["Analytics and budgets"]
end

subgraph group_payments["Payment flow"]
  node_payment_ui["Payment journeys"]
  node_payment_pipeline["Draft and authorize"]
  node_payment_data["Payment repositories"]
  node_mock_ledger[("Mock ledger<br/>[mock_ledger.dart]")]
  node_receipts["Receipt service"]
end

subgraph group_platform["Core platform"]
  node_network["HTTP client<br/>[api_client.dart]"]
  node_secure_session["Device security"]
end

node_customer(("Customer"))
node_external_api{{"Bank API"}}

node_customer -->|"opens app"| node_app_shell
node_app_shell -->|"routes through"| node_routing
node_routing -->|"redirects signed-out"| node_auth
node_routing -->|"shows signed-in"| node_dashboard
node_dashboard -.->|"loads accounts"| node_account_data
node_customer -.->|"views accounts"| node_dashboard
node_customer -->|"starts payment"| node_payment_ui
node_payment_ui -->|"submits draft"| node_payment_pipeline
node_payment_pipeline -->|"processes payment"| node_payment_data
node_payment_data -->|"enforces rules"| node_mock_ledger
node_payment_pipeline -->|"creates receipt"| node_receipts
node_payment_data -.->|"uses HTTP when configured"| node_network
node_network -.->|"sends requests"| node_external_api
node_customer -->|"manages cards"| node_cards
node_customer -->|"uses services"| node_savings_loans
node_customer -.->|"reviews budgets"| node_analytics
node_auth -->|"stores session"| node_secure_session

click node_app_shell "https://github.com/dushansenura/zentrix-bank/blob/main/lib/app/app.dart"
click node_routing "https://github.com/dushansenura/zentrix-bank/blob/main/lib/app/router.dart"
click node_auth "https://github.com/dushansenura/zentrix-bank/tree/main/lib/features/authentication/presentation"
click node_dashboard "https://github.com/dushansenura/zentrix-bank/blob/main/lib/features/dashboard/presentation/dashboard_page.dart"
click node_account_data "https://github.com/dushansenura/zentrix-bank/tree/main/lib/features/dashboard/data"
click node_cards "https://github.com/dushansenura/zentrix-bank/tree/main/lib/features/cards/presentation"
click node_savings_loans "https://github.com/dushansenura/zentrix-bank/tree/main/lib/features/savings/presentation"
click node_analytics "https://github.com/dushansenura/zentrix-bank/tree/main/lib/features/analytics/presentation"
click node_payment_ui "https://github.com/dushansenura/zentrix-bank/tree/main/lib/features/payments/presentation"
click node_payment_pipeline "https://github.com/dushansenura/zentrix-bank/blob/main/lib/features/payments/presentation/payment_submission.dart"
click node_payment_data "https://github.com/dushansenura/zentrix-bank/tree/main/lib/features/payments/data"
click node_mock_ledger "https://github.com/dushansenura/zentrix-bank/blob/main/lib/features/payments/data/mock_ledger.dart"
click node_receipts "https://github.com/dushansenura/zentrix-bank/blob/main/lib/features/payments/data/local_receipt_service.dart"
click node_network "https://github.com/dushansenura/zentrix-bank/blob/main/lib/core/network/api_client.dart"
click node_secure_session "https://github.com/dushansenura/zentrix-bank/tree/main/lib/core/security"

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_shell,node_routing,node_auth toneBlue
class node_dashboard,node_account_data,node_cards,node_savings_loans,node_analytics toneAmber
class node_payment_ui,node_payment_pipeline,node_payment_data,node_mock_ledger,node_receipts,node_external_api toneMint
class node_network,node_secure_session toneRose
class node_customer toneIndigo
```

## Components

### App experience

- [App shell](https://github.com/dushansenura/zentrix-bank/blob/main/lib/app/app.dart): `lib/app/app.dart`
- [Auth routing](https://github.com/dushansenura/zentrix-bank/blob/main/lib/app/router.dart): `lib/app/router.dart`
- [Authentication](https://github.com/dushansenura/zentrix-bank/tree/main/lib/features/authentication/presentation): `lib/features/authentication/presentation`

### Banking services

- [Dashboard](https://github.com/dushansenura/zentrix-bank/blob/main/lib/features/dashboard/presentation/dashboard_page.dart): `lib/features/dashboard/presentation/dashboard_page.dart`
- [Banking repositories](https://github.com/dushansenura/zentrix-bank/tree/main/lib/features/dashboard/data): `lib/features/dashboard/data`
- [Card management](https://github.com/dushansenura/zentrix-bank/tree/main/lib/features/cards/presentation): `lib/features/cards/presentation`
- [Savings and loans](https://github.com/dushansenura/zentrix-bank/tree/main/lib/features/savings/presentation): `lib/features/savings/presentation`
- [Analytics and budgets](https://github.com/dushansenura/zentrix-bank/tree/main/lib/features/analytics/presentation): `lib/features/analytics/presentation`

### Payment flow

- [Payment journeys](https://github.com/dushansenura/zentrix-bank/tree/main/lib/features/payments/presentation): `lib/features/payments/presentation`
- [Draft and authorize](https://github.com/dushansenura/zentrix-bank/blob/main/lib/features/payments/presentation/payment_submission.dart): `lib/features/payments/presentation/payment_submission.dart`
- [Payment repositories](https://github.com/dushansenura/zentrix-bank/tree/main/lib/features/payments/data): `lib/features/payments/data`
- [Mock ledger](https://github.com/dushansenura/zentrix-bank/blob/main/lib/features/payments/data/mock_ledger.dart): `lib/features/payments/data/mock_ledger.dart`
- [Receipt service](https://github.com/dushansenura/zentrix-bank/blob/main/lib/features/payments/data/local_receipt_service.dart): `lib/features/payments/data/local_receipt_service.dart`

### Core platform

- [HTTP client](https://github.com/dushansenura/zentrix-bank/blob/main/lib/core/network/api_client.dart): `lib/core/network/api_client.dart`
- [Device security](https://github.com/dushansenura/zentrix-bank/tree/main/lib/core/security): `lib/core/security`

### Other components

- **Customer**
- **Bank API**

## Connections

- Customer → App shell: opens app (evidence: `README.md`)
- App shell → Auth routing: routes through (evidence: `README.md`)
- Auth routing → Authentication: redirects signed-out (evidence: `README.md`)
- Auth routing → Dashboard: shows signed-in (evidence: `README.md`)
- Dashboard → Banking repositories: loads accounts
- Customer → Dashboard: views accounts
- Customer → Payment journeys: starts payment (evidence: `README.md`)
- Payment journeys → Draft and authorize: submits draft (evidence: `README.md`)
- Draft and authorize → Payment repositories: processes payment (evidence: `README.md`)
- Payment repositories → Mock ledger: enforces rules (evidence: `README.md`)
- Draft and authorize → Receipt service: creates receipt (evidence: `README.md`)
- Payment repositories → HTTP client: uses HTTP when configured (evidence: `README.md`)
- HTTP client → Bank API: sends requests (evidence: `README.md`)
- Customer → Card management: manages cards (evidence: `README.md`)
- Customer → Savings and loans: uses services (evidence: `README.md`)
- Customer → Analytics and budgets: reviews budgets
- Authentication → Device security: stores session (evidence: `README.md`)
