# hamzaalwajeeh/bank-system architecture

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

- Interactive diagram: https://gitdiagram.com/hamzaalwajeeh/bank-system
- Repository: https://github.com/hamzaalwajeeh/bank-system

## Overview

##### Project type and purpose
- This is a monolithic, console-based C++ application (“Bank System”) whose sole purpose is to manage clients, users, and transfers via a text-file–backed data store.
- It is not a web or distributed system but a single executable with a command-line interface and flat file persistence.

##### File structure
- Top-level items:
- Bank_2.cpp – the sole C++ source file containing all modules (UI menus, data models, business logic, file I/O).
- Bank_2.exe – compiled binary.
- Client.txt, Users.txt, Transfers.txt – plain-text data files acting as the “database.”
- README.md – project overview and instructions.
- .vscode – IDE settings folder (not relevant to runtime architecture).
- No subdirectories or separate modules; everything lives in one file, suggesting a simple layered approach within that file.

##### README for additional insights
- Confirms three main domains: Client Management, User Management (with permissions), and Money Transfers.
- Data is read/written per operation to the three text files.
- Interactive console menus drive the business logic.

##### Elements
- CLI / Presentation
- File I/O layer
- Client.txt, Users.txt, Transfers.txt storage
- User → CLI
- CLI → Business Logic services
- Services → Data Access
- Data Access → corresponding .txt file
- Responses flowing back up.
- UI layer = blue
- Business logic = green
- Data access = orange
- Storage = gray

##### Putting it all together
- Optionally, note that everything compiles into one monolithic .exe for deployment.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Actors and external entities
    User["User"]:::external

    %% Presentation Layer
    subgraph "Presentation Layer"
        CLI["CLI"]:::ui
    end

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        ClientService["Client Service"]:::logic
        UserService["User Service (Permissions)"]:::logic
        TransferService["Transfer Service"]:::logic
    end

    %% Data Access Layer
    DataAccess["Data Access Layer"]:::data

    %% Data Store
    subgraph "Data Store"
        ClientsStorage["Client.txt"]:::storage
        UsersStorage["Users.txt"]:::storage
        TransfersStorage["Transfers.txt"]:::storage
    end

    %% Documentation and Deployment
    README["README.md"]:::doc
    Executable["Bank_2.exe"]:::exe

    %% Flow Connections
    User -->|"interacts with"| CLI
    CLI -->|"invoke client ops"| ClientService
    CLI -->|"invoke user ops"| UserService
    CLI -->|"invoke transfer ops"| TransferService

    ClientService -->|"read/write clients"| DataAccess
    UserService -->|"permission checks & user data"| DataAccess
    TransferService -->|"execute transfer logic"| DataAccess

    DataAccess -->|"loads/saves clients"| ClientsStorage
    DataAccess -->|"loads/saves users"| UsersStorage
    DataAccess -->|"loads/saves transfers"| TransfersStorage

    %% Compilation arrow
    CLI -->|"source code"| Executable
    ClientService -->|"source code"| Executable
    UserService -->|"source code"| Executable
    TransferService -->|"source code"| Executable
    DataAccess -->|"source code"| Executable

    %% Click Events
    click CLI "https://github.com/hamzaalwajeeh/bank-system/blob/main/Bank_2.cpp"
    click ClientService "https://github.com/hamzaalwajeeh/bank-system/blob/main/Bank_2.cpp"
    click UserService "https://github.com/hamzaalwajeeh/bank-system/blob/main/Bank_2.cpp"
    click TransferService "https://github.com/hamzaalwajeeh/bank-system/blob/main/Bank_2.cpp"
    click DataAccess "https://github.com/hamzaalwajeeh/bank-system/blob/main/Bank_2.cpp"
    click ClientsStorage "https://github.com/hamzaalwajeeh/bank-system/blob/main/Client.txt"
    click UsersStorage "https://github.com/hamzaalwajeeh/bank-system/blob/main/Users.txt"
    click TransfersStorage "https://github.com/hamzaalwajeeh/bank-system/blob/main/Transfers.txt"
    click README "https://github.com/hamzaalwajeeh/bank-system/blob/main/README.md"
    click Executable "https://github.com/hamzaalwajeeh/bank-system/blob/main/Bank_2.exe"

    %% Styles
    classDef external fill:#ffffff,stroke:#000000,stroke-width:1px
    classDef ui fill:#D0E6FF,stroke:#0057D9
    classDef logic fill:#D6FFD0,stroke:#2D8A00
    classDef data fill:#FFE9B3,stroke:#D99500
    classDef storage fill:#E0E0E0,stroke:#666666
    classDef doc fill:#F0F0F0,stroke:#999999,stroke-dasharray: 2 2
    classDef exe fill:#D3D3D3,stroke:#444444,stroke-dasharray: 4 2
```
