# 0xkareemai/oobs-object_oriented_bank_system architecture

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

- Interactive diagram: https://gitdiagram.com/0xkareemai/oobs-object_oriented_bank_system
- Repository: https://github.com/0xkareemai/oobs-object_oriented_bank_system

## Overview

##### Project Type and Purpose
- This is a C++ CLI (Command-Line Interface) Bank Management System (OOBS) that simulates two applications: a Bank Application and an ATM Application.
- It implements a layered architecture (Presentation → Business → Data Access) to manage admins, clients, currencies, and transactions, persisting data in CSV/TXT files.

##### File Structure
- Top-level elements:
- build/run.sh – build and run script
- src/1-Presentation – all CLI screens and menus (UI layer)
- src/2-Business – domain models and logic (service layer)
- src/3-Data Access – data handlers, file I/O, core banking abstraction
- src/DataBase – CSV/TXT data files (persistent storage)
- /libs – helper/util libraries (I/O, file, data manipulation, UI)
- test – unit tests for helper libraries
- Patterns:
- Layered (strict separation Presentation/Business/DataAccess)
- Utility modules for cross-cutting concerns in include/libs
- Configuration:
- run.sh orchestrates compilation and execution
- main.cpp is the entry point that initializes the layers and launches the CLI

##### README for Additional Insights
- Confirms C++ project, CLI interface, build via g++, run via Bash script.
- Mentions SDLC steps documented in doc/, but implementation follows a 3-layer design.
- Two “applications” share same core but differ in starting screens (Bank vs. ATM).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build and entry
    Build["build/run.sh"]:::script
    Main["main.cpp"]:::script

    Build -->|"build & run"| Main

    %% Presentation Layer
    subgraph "Presentation Layer" 
        direction TB
        App["App.h"] 
        Global["Global.h"]
        subgraph "Screens"
            direction TB
            AdminScreens["AdminScreens"] 
            ClientScreens["ClientScreens"] 
            CurrencyScreens["CurrencyScreens"] 
            TransactionScreens["TransactionScreens"] 
            Login["Login/Logout/Dashboard/Error"] 
        end
    end

    Main -->|"initialize UI"| App
    App --> Global
    App --> Screens

    %% Business Layer
    subgraph "Business Layer"
        direction TB
        AdminModel["Admin"] 
        ClientModel["Client"] 
        CurrencyModel["Currency"] 
        TransactionModel["Transaction"] 
        PersonModel["Person"]
    end

    Screens -->|"invoke services"| AdminModel
    Screens --> ClientModel
    Screens --> CurrencyModel
    Screens --> TransactionModel

    %% Data Access Layer
    subgraph "Data Access Layer"
        direction TB
        BankFacade["Bank (Facade)"] 
        CoreBank["CoreBank"] 
        DataHandler["DataHandler"]
    end

    AdminModel -->|"CRUD operations"| BankFacade
    ClientModel --> BankFacade
    CurrencyModel --> BankFacade
    TransactionModel --> BankFacade
    PersonModel --> BankFacade

    BankFacade --> CoreBank
    BankFacade --> DataHandler

    %% Persistence
    subgraph "Persistence (CSV/TXT Files)"
        direction TB
        AdminsCSV["Admins.csv"] 
        AdminsLogCSV["AdminsLog.csv"] 
        ClientsCSV["Clients.csv"] 
        CurrenciesTXT["Currencies.txt"]
    end

    DataHandler --> AdminsCSV
    DataHandler --> AdminsLogCSV
    DataHandler --> ClientsCSV
    DataHandler --> CurrenciesTXT

    %% Utility Libraries
    subgraph "Utilities & Helpers"
        direction TB
        DataManip["DataManip_helpers"] 
        FileHelpers["File_helpers"] 
        InputHelpers["Input_helpers"] 
        OutputHelpers["Output_helpers"] 
        Utilities["Utilities"] 
        UIHelpers["Ui_helpers"]
    end

    App --> UIHelpers
    AdminModel --> DataManip
    ClientModel --> DataManip
    CoreBank --> FileHelpers
    DataHandler --> FileHelpers
    Screens --> InputHelpers
    Screens --> OutputHelpers
    Main --> Utilities

    %% Click events
    click App "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/src/1-Presentation/App.h"
    click Global "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/src/1-Presentation/Global.h"
    click Screens "https://github.com/0xkareemai/oobs-object_oriented_bank_system/tree/main/src/1-Presentation/screens"
    click AdminScreens "https://github.com/0xkareemai/oobs-object_oriented_bank_system/tree/main/src/1-Presentation/screens/AdminScreens"
    click ClientScreens "https://github.com/0xkareemai/oobs-object_oriented_bank_system/tree/main/src/1-Presentation/screens/ClientScreens"
    click CurrencyScreens "https://github.com/0xkareemai/oobs-object_oriented_bank_system/tree/main/src/1-Presentation/screens/CurrencyScreens"
    click TransactionScreens "https://github.com/0xkareemai/oobs-object_oriented_bank_system/tree/main/src/1-Presentation/screens/TransactionScreens"
    click Login "https://github.com/0xkareemai/oobs-object_oriented_bank_system/tree/main/src/1-Presentation/screens/Login"
    click BankFacade "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/src/3-Data Access/Bank/Bank.h"
    click CoreBank "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/src/3-Data Access/CoreBank/CoreBank.h"
    click DataHandler "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/src/3-Data Access/DataHandeler/DataHandeler.h"
    click AdminModel "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/src/2-Business/Admin/Admin.h"
    click ClientModel "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/src/2-Business/Client/Client.h"
    click CurrencyModel "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/src/2-Business/Currency/Currency.h"
    click TransactionModel "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/src/2-Business/Transaction/Transaction.h"
    click PersonModel "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/src/2-Business/Person.h"
    click AdminsCSV "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/src/DataBase/Admins.csv"
    click AdminsLogCSV "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/src/DataBase/AdminsLog.csv"
    click ClientsCSV "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/src/DataBase/Clients.csv"
    click CurrenciesTXT "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/src/DataBase/Currencies.txt"
    click DataManip "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/include/libs/Data_Manip/DataManip_helpers.h"
    click FileHelpers "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/include/libs/F_Helpers/File_helpers.h"
    click InputHelpers "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/include/libs/I_Helpers/Input_helpers.h"
    click OutputHelpers "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/include/libs/O_Helpers/Output_helpers.h"
    click Utilities "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/include/libs/Utilities/Utilities.h"
    click UIHelpers "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/include/Ui_Helpers/Ui_helpers.h"
    click Build "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/build/run.sh"
    click Main "https://github.com/0xkareemai/oobs-object_oriented_bank_system/blob/main/src/main.cpp"

    %% Styles
    classDef script fill:#F9E79F,stroke:#B7950B,color:#000;
    classDef layer fill:#AED6F1,stroke:#2980B9,color:#000;
    classDef business fill:#D5F5E3,stroke:#27AE60,color:#000;
    classDef dataAccess fill:#FCF3CF,stroke:#B9770E,color:#000;
    classDef persistence fill:#ABEBC6,stroke:#229954,color:#000;
    classDef utility fill:#FADBD8,stroke:#C0392B,color:#000;

    class Build,Main script
    class App,Global,Screens layer
    class AdminScreens,ClientScreens,CurrencyScreens,TransactionScreens,Login layer
    class AdminModel,ClientModel,CurrencyModel,TransactionModel,PersonModel business
    class BankFacade,CoreBank,DataHandler dataAccess
    class AdminsCSV,AdminsLogCSV,ClientsCSV,CurrenciesTXT persistence
    class DataManip,FileHelpers,InputHelpers,OutputHelpers,Utilities,UIHelpers utility
```
