# lolokeia/abv-bank architecture

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

- Interactive diagram: https://gitdiagram.com/lolokeia/abv-bank
- Repository: https://github.com/lolokeia/abv-bank

## Overview

ABV-BANK is a Python client/server banking project. The user workflow runs from the desktop UI through client request logic to server-side authentication or account operations, then to SQLite-backed state and a response. The server also exposes a separate administration console. The README documents framed TCP messaging, expiring tokens, localization, and account operations. Some entry-point and client transport details are not excerpted, so those links are marked unverified rather than presented as confirmed calls.

Main entry points: [`server_main.py`](https://github.com/lolokeia/abv-bank/blob/main/server_main.py) (Server runtime), [`server/cmd_handle.py`](https://github.com/lolokeia/abv-bank/blob/main/server/cmd_handle.py) (Command dispatch), [`server/transactions.py`](https://github.com/lolokeia/abv-bank/blob/main/server/transactions.py) (Account operations), [`server/auth.py`](https://github.com/lolokeia/abv-bank/blob/main/server/auth.py) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Desktop client"]
  node_ui["Client screens<br/>[client_main.py]"]
  node_client_logic["Request logic<br/>[logic.py]"]
  node_client_cli["Client CLI<br/>[cli.py]"]
  node_client_state["Client session<br/>[session.py]"]
  node_locales["Localization<br/>[locales.py]"]
  node_tooltip["Tooltip widget<br/>[ctk_tooltip.py]"]
  node_client_config["Client config<br/>[client_config.py]"]
end

subgraph group_server["Server operations"]
  node_server_entry["Server runtime<br/>[server_main.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_transactions["Account operations<br/>[transactions.py]"]
  node_token_service["Token service<br/>[tokens.py]"]
  node_checksum["Account checksum<br/>[luhn.py]"]
  node_config["Server config<br/>[config.py]"]
end

subgraph group_state["Banking state"]
  node_database[("SQLite storage<br/>[db.py]")]
end

subgraph group_shared["Shared infrastructure"]
  node_protocol["Message framing<br/>[protocol.py]"]
  node_comms["Response objects<br/>[comms.py]"]
  node_codes["Error codes<br/>[codes.py]"]
  node_logging["Server logging<br/>[log.py]"]
  node_colors["Terminal colors<br/>[collibry.py]"]
end

subgraph group_admin["Administration"]
  node_commands["Command dispatch<br/>[cmd_handle.py]"]
end

node_user(("Bank customer"))

node_user -->|"uses"| node_ui
node_ui -->|"requests"| node_client_logic
node_ui -->|"updates"| node_client_state
node_ui -.->|"localizes"| node_locales
node_ui -.->|"uses"| node_tooltip
node_client_logic -.->|"uses framing"| node_protocol
node_client_logic -.->|"builds requests"| node_comms
node_client_logic -.->|"checks codes"| node_codes
node_client_cli -.->|"uses framing"| node_protocol
node_client_cli -.->|"builds requests"| node_comms
node_client_cli -.->|"reads config"| node_client_config
node_client_logic -.->|"sends requests"| node_server_entry
node_server_entry -.->|"uses framing"| node_protocol
node_server_entry -.->|"dispatches auth"| node_auth
node_server_entry -.->|"dispatches operations"| node_transactions
node_server_entry -.->|"starts console"| node_commands
node_server_entry -.->|"logs activity"| node_logging
node_auth -->|"reads and writes"| node_database
node_auth -->|"revokes tokens"| node_token_service
node_auth -->|"returns status"| node_comms
node_transactions -->|"reads and writes"| node_database
node_transactions -->|"checks PIN"| node_auth
node_transactions -->|"checks account number"| node_checksum
node_transactions -->|"returns status"| node_comms
node_token_service -->|"reads and updates"| node_database
node_commands -->|"administers data"| node_database
node_commands -->|"creates users"| node_auth
node_commands -->|"runs operations"| node_transactions
node_commands -->|"cleans tokens"| node_token_service
node_commands -->|"records actions"| node_logging
node_database -.->|"generates account numbers"| node_checksum
node_database -->|"reads token expiry"| node_config
node_logging -->|"reads log path"| node_config
node_logging -->|"formats output"| node_colors
node_comms -->|"uses defaults"| node_codes

click node_ui "https://github.com/lolokeia/abv-bank/blob/main/client_main.py"
click node_client_logic "https://github.com/lolokeia/abv-bank/blob/main/client/logic.py"
click node_client_cli "https://github.com/lolokeia/abv-bank/blob/main/client/cli.py"
click node_client_state "https://github.com/lolokeia/abv-bank/blob/main/client/session.py"
click node_locales "https://github.com/lolokeia/abv-bank/blob/main/client/locales.py"
click node_tooltip "https://github.com/lolokeia/abv-bank/blob/main/ctktooltip/ctk_tooltip.py"
click node_server_entry "https://github.com/lolokeia/abv-bank/blob/main/server_main.py"
click node_auth "https://github.com/lolokeia/abv-bank/blob/main/server/auth.py"
click node_transactions "https://github.com/lolokeia/abv-bank/blob/main/server/transactions.py"
click node_token_service "https://github.com/lolokeia/abv-bank/blob/main/server/tokens.py"
click node_commands "https://github.com/lolokeia/abv-bank/blob/main/server/cmd_handle.py"
click node_database "https://github.com/lolokeia/abv-bank/blob/main/server/db.py"
click node_checksum "https://github.com/lolokeia/abv-bank/blob/main/server/luhn.py"
click node_config "https://github.com/lolokeia/abv-bank/blob/main/config.py"
click node_client_config "https://github.com/lolokeia/abv-bank/blob/main/client_config.py"
click node_protocol "https://github.com/lolokeia/abv-bank/blob/main/shared/protocol.py"
click node_comms "https://github.com/lolokeia/abv-bank/blob/main/shared/comms.py"
click node_codes "https://github.com/lolokeia/abv-bank/blob/main/shared/codes.py"
click node_logging "https://github.com/lolokeia/abv-bank/blob/main/shared/log.py"
click node_colors "https://github.com/lolokeia/abv-bank/blob/main/shared/collibry.py"

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_ui,node_client_logic,node_client_cli,node_client_state,node_locales,node_tooltip,node_client_config toneBlue
class node_server_entry,node_auth,node_transactions,node_token_service,node_checksum,node_config toneAmber
class node_database toneMint
class node_protocol,node_comms,node_codes,node_logging,node_colors toneRose
class node_commands,node_user toneIndigo
```

## Components

### Desktop client

- [Client screens](https://github.com/lolokeia/abv-bank/blob/main/client_main.py): `client_main.py`
- [Request logic](https://github.com/lolokeia/abv-bank/blob/main/client/logic.py): `client/logic.py`
- [Client CLI](https://github.com/lolokeia/abv-bank/blob/main/client/cli.py): `client/cli.py`
- [Client session](https://github.com/lolokeia/abv-bank/blob/main/client/session.py): `client/session.py`
- [Localization](https://github.com/lolokeia/abv-bank/blob/main/client/locales.py): `client/locales.py`
- [Tooltip widget](https://github.com/lolokeia/abv-bank/blob/main/ctktooltip/ctk_tooltip.py): `ctktooltip/ctk_tooltip.py`
- [Client config](https://github.com/lolokeia/abv-bank/blob/main/client_config.py): `client_config.py`

### Server operations

- [Server runtime](https://github.com/lolokeia/abv-bank/blob/main/server_main.py): `server_main.py`
- [Authentication](https://github.com/lolokeia/abv-bank/blob/main/server/auth.py): `server/auth.py`
- [Account operations](https://github.com/lolokeia/abv-bank/blob/main/server/transactions.py): `server/transactions.py`
- [Token service](https://github.com/lolokeia/abv-bank/blob/main/server/tokens.py): `server/tokens.py`
- [Account checksum](https://github.com/lolokeia/abv-bank/blob/main/server/luhn.py): `server/luhn.py`
- [Server config](https://github.com/lolokeia/abv-bank/blob/main/config.py): `config.py`

### Banking state

- [SQLite storage](https://github.com/lolokeia/abv-bank/blob/main/server/db.py): `server/db.py`

### Shared infrastructure

- [Message framing](https://github.com/lolokeia/abv-bank/blob/main/shared/protocol.py): `shared/protocol.py`
- [Response objects](https://github.com/lolokeia/abv-bank/blob/main/shared/comms.py): `shared/comms.py`
- [Error codes](https://github.com/lolokeia/abv-bank/blob/main/shared/codes.py): `shared/codes.py`
- [Server logging](https://github.com/lolokeia/abv-bank/blob/main/shared/log.py): `shared/log.py`
- [Terminal colors](https://github.com/lolokeia/abv-bank/blob/main/shared/collibry.py): `shared/collibry.py`

### Administration

- [Command dispatch](https://github.com/lolokeia/abv-bank/blob/main/server/cmd_handle.py): `server/cmd_handle.py`

### Other components

- **Bank customer**

## Connections

- Bank customer → Client screens: uses (evidence: `README.md`)
- Client screens → Request logic: requests (evidence: `client_main.py`)
- Client screens → Client session: updates (evidence: `client_main.py`)
- Client screens → Localization: localizes (evidence: `client_main.py`)
- Client screens → Tooltip widget: uses (evidence: `client_main.py`)
- Request logic → Message framing: uses framing (evidence: `client/logic.py`)
- Request logic → Response objects: builds requests (evidence: `client/logic.py`)
- Request logic → Error codes: checks codes (evidence: `client/logic.py`)
- Client CLI → Message framing: uses framing (evidence: `client/cli.py`)
- Client CLI → Response objects: builds requests (evidence: `client/cli.py`)
- Client CLI → Client config: reads config (evidence: `client/cli.py`)
- Request logic → Server runtime: sends requests (evidence: `README.md`)
- Server runtime → Message framing: uses framing (evidence: `server_main.py`)
- Server runtime → Authentication: dispatches auth (evidence: `server_main.py`)
- Server runtime → Account operations: dispatches operations (evidence: `server_main.py`)
- Server runtime → Command dispatch: starts console (evidence: `server_main.py`)
- Server runtime → Server logging: logs activity (evidence: `server_main.py`)
- Authentication → SQLite storage: reads and writes (evidence: `server/auth.py`)
- Authentication → Token service: revokes tokens (evidence: `server/auth.py`)
- Authentication → Response objects: returns status (evidence: `server/auth.py`)
- Account operations → SQLite storage: reads and writes (evidence: `server/transactions.py`)
- Account operations → Authentication: checks PIN (evidence: `server/transactions.py`)
- Account operations → Account checksum: checks account number (evidence: `server/transactions.py`)
- Account operations → Response objects: returns status (evidence: `server/transactions.py`)
- Token service → SQLite storage: reads and updates (evidence: `server/tokens.py`)
- Command dispatch → SQLite storage: administers data (evidence: `server/cmd_handle.py`)
- Command dispatch → Authentication: creates users (evidence: `server/cmd_handle.py`)
- Command dispatch → Account operations: runs operations (evidence: `server/cmd_handle.py`)
- Command dispatch → Token service: cleans tokens (evidence: `server/cmd_handle.py`)
- Command dispatch → Server logging: records actions (evidence: `server/cmd_handle.py`)
- SQLite storage → Account checksum: generates account numbers (evidence: `server/db.py`)
- SQLite storage → Server config: reads token expiry (evidence: `server/db.py`)
- Server logging → Server config: reads log path (evidence: `shared/log.py`)
- Server logging → Terminal colors: formats output (evidence: `shared/log.py`)
- Response objects → Error codes: uses defaults (evidence: `shared/comms.py`)
