# albertjyllhed/bankapp architecture

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

- Interactive diagram: https://gitdiagram.com/albertjyllhed/bankapp
- Repository: https://github.com/albertjyllhed/bankapp

## Overview

Liskov Bank is a console banking application. A user enters through login, then Bank dispatches to role-specific menus; customer actions cover accounts, transfers, transactions and loans, while admins manage customers and currency rates. Data maintains in-memory users, accounts and rates and persists user/currency state to data.json. The graph follows documented capabilities and excerpted calls; unsampled UI, savings-account, and loan details are represented by their documented responsibilities, without asserting unshown call paths.

Main entry points: [`Users/Customer.cs`](https://github.com/albertjyllhed/bankapp/blob/main/Users/Customer.cs) (Customer profile), [`Data.cs`](https://github.com/albertjyllhed/bankapp/blob/main/Data.cs) (Bank state), [`Bank.cs`](https://github.com/albertjyllhed/bankapp/blob/main/Bank.cs) (Login and dispatch), [`Menu.cs`](https://github.com/albertjyllhed/bankapp/blob/main/Menu.cs) (Role menus)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application flow"]
  node_customer(("Bank customer"))
  node_admin_actor(("Bank administrator"))
  node_program["Application entry<br/>[Program.cs]"]
  node_bank["Login and dispatch<br/>[Bank.cs]"]
  node_menu["Role menus<br/>[Menu.cs]"]
  node_input["Input validation<br/>[InputUtilities.cs]"]
  node_ui["Console presentation<br/>[UI.cs]"]
end

subgraph group_domain["Banking domain"]
  node_user["User identity<br/>[User.cs]"]
  node_customer_model["Customer profile<br/>[Customer.cs]"]
  node_admin["Admin actions<br/>[Admin.cs]"]
  node_account["Bank account<br/>[BankAccount.cs]"]
  node_savings["Savings account<br/>[SavingsAccount.cs]"]
  node_loan["Loan record<br/>[Loan.cs]"]
  node_transaction["Transaction record<br/>[Transaction.cs]"]
end

subgraph group_services["Customer services"]
  node_account_service["Account setup<br/>[AccountService.cs]"]
  node_loan_service["Loan operations<br/>[LoanService.cs]"]
  node_transaction_service["Money movement"]
end

subgraph group_state["State and persistence"]
  node_data[("Bank state<br/>[Data.cs]")]
  node_save_data["Persistence envelope<br/>[SaveData.cs]"]
  node_json_store[("JSON data file<br/>[data.json]")]
end

node_customer -->|"logs in"| node_bank
node_admin_actor -->|"logs in"| node_bank
node_program -->|"starts"| node_bank
node_bank -->|"loads and saves"| node_data
node_bank -->|"reads credentials"| node_input
node_bank -->|"authenticates"| node_user
node_bank -->|"dispatches"| node_menu
node_bank -->|"displays"| node_ui
node_menu -->|"reads choices"| node_input
node_menu -->|"serves"| node_customer_model
node_menu -->|"serves"| node_admin
node_menu -->|"starts setup"| node_account_service
node_menu -->|"dispatches"| node_loan_service
node_menu -->|"dispatches"| node_transaction_service
node_user -->|"base class"| node_customer_model
node_user -->|"base class"| node_admin
node_customer_model -->|"owns accounts"| node_account
node_customer_model -->|"owns loans"| node_loan
node_customer_model -->|"looks up account"| node_data
node_customer_model -->|"selects account"| node_input
node_customer_model -->|"prints activity"| node_ui
node_admin -->|"manages customers and rates"| node_data
node_admin -->|"reads admin input"| node_input
node_account_service -->|"reads setup"| node_input
node_account_service -->|"registers account"| node_data
node_account_service -->|"creates"| node_account
node_account_service -->|"creates"| node_savings
node_account_service -->|"adds account"| node_customer_model
node_transaction_service -->|"reads transaction"| node_input
node_transaction_service -->|"changes balances"| node_account
node_transaction_service -->|"resolves transfers"| node_data
node_transaction_service -->|"uses customer accounts"| node_customer_model
node_account -->|"records movement"| node_transaction
node_loan_service -->|"reads loan choices"| node_input
node_loan_service -->|"updates loan list"| node_customer_model
node_loan_service -->|"creates loan"| node_loan
node_loan_service -->|"deposits or debits"| node_account
node_loan_service -->|"converts currency"| node_data
node_data -->|"initializes accounts"| node_account_service
node_data -->|"serializes state"| node_save_data
node_data -->|"reads and writes"| node_json_store
node_save_data -->|"stores users"| node_user

click node_program "https://github.com/albertjyllhed/bankapp/blob/main/Program.cs"
click node_bank "https://github.com/albertjyllhed/bankapp/blob/main/Bank.cs"
click node_menu "https://github.com/albertjyllhed/bankapp/blob/main/Menu.cs"
click node_input "https://github.com/albertjyllhed/bankapp/blob/main/InputUtilities.cs"
click node_ui "https://github.com/albertjyllhed/bankapp/blob/main/UI.cs"
click node_user "https://github.com/albertjyllhed/bankapp/blob/main/Users/User.cs"
click node_customer_model "https://github.com/albertjyllhed/bankapp/blob/main/Users/Customer.cs"
click node_admin "https://github.com/albertjyllhed/bankapp/blob/main/Users/Admin.cs"
click node_account "https://github.com/albertjyllhed/bankapp/blob/main/BankAccounts/BankAccount.cs"
click node_savings "https://github.com/albertjyllhed/bankapp/blob/main/BankAccounts/SavingsAccount.cs"
click node_loan "https://github.com/albertjyllhed/bankapp/blob/main/Loan.cs"
click node_transaction "https://github.com/albertjyllhed/bankapp/blob/main/Transaction.cs"
click node_account_service "https://github.com/albertjyllhed/bankapp/blob/main/Services/AccountService.cs"
click node_loan_service "https://github.com/albertjyllhed/bankapp/blob/main/Services/LoanService.cs"
click node_transaction_service "https://github.com/albertjyllhed/bankapp/blob/main/Services/TransactionService.cs"
click node_data "https://github.com/albertjyllhed/bankapp/blob/main/Data.cs"
click node_save_data "https://github.com/albertjyllhed/bankapp/blob/main/SaveData.cs"
click node_json_store "https://github.com/albertjyllhed/bankapp/blob/main/data.json"

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_customer,node_admin_actor,node_program,node_bank,node_menu,node_input,node_ui toneBlue
class node_user,node_customer_model,node_admin,node_account,node_savings,node_loan,node_transaction toneAmber
class node_account_service,node_loan_service,node_transaction_service toneMint
class node_data,node_save_data,node_json_store toneRose
```

## Components

### Application flow

- **Bank customer**
- **Bank administrator**
- [Application entry](https://github.com/albertjyllhed/bankapp/blob/main/Program.cs): `Program.cs`
- [Login and dispatch](https://github.com/albertjyllhed/bankapp/blob/main/Bank.cs): `Bank.cs`
- [Role menus](https://github.com/albertjyllhed/bankapp/blob/main/Menu.cs): `Menu.cs`
- [Input validation](https://github.com/albertjyllhed/bankapp/blob/main/InputUtilities.cs): `InputUtilities.cs`
- [Console presentation](https://github.com/albertjyllhed/bankapp/blob/main/UI.cs): `UI.cs`

### Banking domain

- [User identity](https://github.com/albertjyllhed/bankapp/blob/main/Users/User.cs): `Users/User.cs`
- [Customer profile](https://github.com/albertjyllhed/bankapp/blob/main/Users/Customer.cs): `Users/Customer.cs`
- [Admin actions](https://github.com/albertjyllhed/bankapp/blob/main/Users/Admin.cs): `Users/Admin.cs`
- [Bank account](https://github.com/albertjyllhed/bankapp/blob/main/BankAccounts/BankAccount.cs): `BankAccounts/BankAccount.cs`
- [Savings account](https://github.com/albertjyllhed/bankapp/blob/main/BankAccounts/SavingsAccount.cs): `BankAccounts/SavingsAccount.cs`
- [Loan record](https://github.com/albertjyllhed/bankapp/blob/main/Loan.cs): `Loan.cs`
- [Transaction record](https://github.com/albertjyllhed/bankapp/blob/main/Transaction.cs): `Transaction.cs`

### Customer services

- [Account setup](https://github.com/albertjyllhed/bankapp/blob/main/Services/AccountService.cs): `Services/AccountService.cs`
- [Loan operations](https://github.com/albertjyllhed/bankapp/blob/main/Services/LoanService.cs): `Services/LoanService.cs`
- [Money movement](https://github.com/albertjyllhed/bankapp/blob/main/Services/TransactionService.cs): `Services/TransactionService.cs`

### State and persistence

- [Bank state](https://github.com/albertjyllhed/bankapp/blob/main/Data.cs): `Data.cs`
- [Persistence envelope](https://github.com/albertjyllhed/bankapp/blob/main/SaveData.cs): `SaveData.cs`
- [JSON data file](https://github.com/albertjyllhed/bankapp/blob/main/data.json): `data.json`

## Connections

- Bank customer → Login and dispatch: logs in (evidence: `README.md`)
- Bank administrator → Login and dispatch: logs in (evidence: `README.md`)
- Application entry → Login and dispatch: starts (evidence: `Program.cs`)
- Login and dispatch → Bank state: loads and saves (evidence: `Bank.cs`)
- Login and dispatch → Input validation: reads credentials (evidence: `Bank.cs`)
- Login and dispatch → User identity: authenticates (evidence: `Bank.cs`)
- Login and dispatch → Role menus: dispatches (evidence: `Bank.cs`)
- Login and dispatch → Console presentation: displays (evidence: `Bank.cs`)
- Role menus → Input validation: reads choices (evidence: `Menu.cs`)
- Role menus → Customer profile: serves (evidence: `Menu.cs`)
- Role menus → Admin actions: serves (evidence: `Menu.cs`)
- Role menus → Account setup: starts setup (evidence: `Menu.cs`)
- Role menus → Loan operations: dispatches (evidence: `Menu.cs`)
- Role menus → Money movement: dispatches (evidence: `Menu.cs`)
- User identity → Customer profile: base class (evidence: `Users/Customer.cs`)
- User identity → Admin actions: base class (evidence: `Users/Admin.cs`)
- Customer profile → Bank account: owns accounts (evidence: `Users/Customer.cs`)
- Customer profile → Loan record: owns loans (evidence: `Users/Customer.cs`)
- Customer profile → Bank state: looks up account (evidence: `Users/Customer.cs`)
- Customer profile → Input validation: selects account (evidence: `Users/Customer.cs`)
- Customer profile → Console presentation: prints activity (evidence: `README.md`)
- Admin actions → Bank state: manages customers and rates (evidence: `Users/Admin.cs`)
- Admin actions → Input validation: reads admin input (evidence: `Users/Admin.cs`)
- Account setup → Input validation: reads setup (evidence: `Services/AccountService.cs`)
- Account setup → Bank state: registers account (evidence: `Services/AccountService.cs`)
- Account setup → Bank account: creates (evidence: `Services/AccountService.cs`)
- Account setup → Savings account: creates (evidence: `Services/AccountService.cs`)
- Account setup → Customer profile: adds account (evidence: `Services/AccountService.cs`)
- Money movement → Input validation: reads transaction (evidence: `Services/TransactionService.cs`)
- Money movement → Bank account: changes balances (evidence: `Services/TransactionService.cs`)
- Money movement → Bank state: resolves transfers (evidence: `Services/TransactionService.cs`)
- Money movement → Customer profile: uses customer accounts (evidence: `Services/TransactionService.cs`)
- Bank account → Transaction record: records movement (evidence: `BankAccounts/BankAccount.cs`)
- Loan operations → Input validation: reads loan choices (evidence: `Services/LoanService.cs`)
- Loan operations → Customer profile: updates loan list (evidence: `Services/LoanService.cs`)
- Loan operations → Loan record: creates loan (evidence: `Services/LoanService.cs`)
- Loan operations → Bank account: deposits or debits (evidence: `Services/LoanService.cs`)
- Loan operations → Bank state: converts currency (evidence: `Services/LoanService.cs`)
- Bank state → Account setup: initializes accounts (evidence: `Data.cs`)
- Bank state → Persistence envelope: serializes state (evidence: `Data.cs`)
- Bank state → JSON data file: reads and writes (evidence: `Data.cs`)
- Persistence envelope → User identity: stores users (evidence: `SaveData.cs`)
