# kodingkhurram/bank-management-system architecture

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

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

## Overview

##### Project Type and Purpose
- BankMan is a full-stack, monolithic web application written in PHP (5.6) that implements a Bank Management System.
- It exposes two main user-facing modules:
- Employee Work-Space (EWS): for bank employees to register new customers, handle deposits (cash/cheque), withdrawals, transfers, account updates, and summaries.
- ATM Banking: for customers (via ATM number + PIN) to withdraw cash, transfer funds, and view account summaries.
- Both modules share the same PHP codebase and connect to a central MySQL database.

##### Key Components (to represent
a. Clients
- Bank Employee’s Web Browser (EWS UI)
- Bank Customer’s/ATM Terminal Browser (ATM UI)
b. Web Tier
- Apache HTTP Server + PHP runtime
- PHP scripts (index.php, home.php, emp_wspace.php, account_summary.php, credit_cash.php, credit_cheque.php, debit.php, transfer.php, new_customer.php, update_info.php, transaction.php, manager_permission.php, logout.php, md5.php, get_logged.inc.php, server_connect.inc.php)
- Static assets: CSS (pure‐release, templatemo_main.css, layout/style CSS), JS (init.js, templatemo_script.js, jqvmap plugin & data, custom scripts), images, fonts
c. Data Tier
- MySQL Database (BankMan_db.sql schema)
d. (Optional) External/Infrastructure
- ATM hardware or third-party PIN validation (if applicable)
- Hosting environment: Linux server (Apache/Tomcat), network connectivity, power supply

##### Relationships & Data Flow
- Presentation Layer (HTML/CSS/JS served by PHP)
- Business Logic Layer (the PHP scripts and includes implementing EWS and ATM workflows)
- Data Access Layer (server_connect.inc.php + SQL queries).

##### Architectural Patterns & Principles
- Monolithic three-tier architecture: Presentation → Application Logic → Data
- Reusable includes (get_logged.inc.php, server_connect.inc.php) demonstrate modularization within the monolith.
- Use of third-party UI/CSS frameworks (Pure.css, templatemo) and JS libraries (jqvmap) for UI consistency and data visualization.

##### Technologies & Frameworks
- Web Server: Apache 4.5+
- Scripting: PHP 5.6
- Database: MySQL

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Clients
    BankEmployee["Bank Employee Browser"]:::client
    ATMCustomer["ATM/Customer Browser"]:::client

    %% Web Server & Application
    subgraph "Web Server & PHP Application"
        ApachePHP["Apache HTTP Server + PHP"]:::server

        subgraph "Presentation Layer"
            StaticAssets["Static Assets (CSS/JS/Images)"]:::assets
        end

        subgraph "Business Logic Layer"
            subgraph "EWS Module"
                emp_wspace["emp_wspace.php"]:::php
                new_customer["new_customer.php"]:::php
                credit_cash["credit_cash.php"]:::php
                credit_cheque["credit_cheque.php"]:::php
                debit["debit.php"]:::php
                transfer["transfer.php"]:::php
                account_summary["account_summary.php"]:::php
                update_info["update_info.php"]:::php
                transaction["transaction.php"]:::php
                manager_permission["manager_permission.php"]:::php
            end
            subgraph "ATM Module"
                atm_index["index.php"]:::php
                atm_home["home.php"]:::php
                md5["md5.php"]:::php
                logout["logout.php"]:::php
                get_logged["get_logged.inc.php"]:::php
            end
        end

        subgraph "Data Access Layer"
            server_connect["server_connect.inc.php"]:::php
        end
    end

    %% Data Tier
    Database["MySQL Database"]:::database

    %% Connections
    BankEmployee -->|HTTP GET/POST| ApachePHP
    ATMCustomer -->|HTTP GET/POST| ApachePHP

    ApachePHP --> StaticAssets
    ApachePHP --> emp_wspace
    ApachePHP --> atm_index

    emp_wspace --> server_connect
    new_customer --> server_connect
    credit_cash --> server_connect
    credit_cheque --> server_connect
    debit --> server_connect
    transfer --> server_connect
    account_summary --> server_connect
    update_info --> server_connect
    transaction --> server_connect
    manager_permission --> server_connect

    atm_index --> server_connect
    atm_home --> server_connect
    md5 --> server_connect
    logout --> server_connect
    get_logged --> server_connect

    server_connect -->|SQL SELECT/UPDATE| Database

    ApachePHP -->|HTML/CSS/JS Response| BankEmployee
    ApachePHP -->|HTML/CSS/JS Response| ATMCustomer

    %% Click Events - EWS Module
    click emp_wspace "https://github.com/kodingkhurram/bank-management-system/blob/main/emp_wspace.php"
    click new_customer "https://github.com/kodingkhurram/bank-management-system/blob/main/new_customer.php"
    click credit_cash "https://github.com/kodingkhurram/bank-management-system/blob/main/credit_cash.php"
    click credit_cheque "https://github.com/kodingkhurram/bank-management-system/blob/main/credit_cheque.php"
    click debit "https://github.com/kodingkhurram/bank-management-system/blob/main/debit.php"
    click transfer "https://github.com/kodingkhurram/bank-management-system/blob/main/transfer.php"
    click account_summary "https://github.com/kodingkhurram/bank-management-system/blob/main/account_summary.php"
    click update_info "https://github.com/kodingkhurram/bank-management-system/blob/main/update_info.php"
    click transaction "https://github.com/kodingkhurram/bank-management-system/blob/main/transaction.php"
    click manager_permission "https://github.com/kodingkhurram/bank-management-system/blob/main/manager_permission.php"

    %% Click Events - ATM Module
    click atm_index "https://github.com/kodingkhurram/bank-management-system/blob/main/index.php"
    click atm_home "https://github.com/kodingkhurram/bank-management-system/blob/main/home.php"
    click md5 "https://github.com/kodingkhurram/bank-management-system/blob/main/md5.php"
    click logout "https://github.com/kodingkhurram/bank-management-system/blob/main/logout.php"
    click get_logged "https://github.com/kodingkhurram/bank-management-system/blob/main/get_logged.inc.php"

    %% Click Events - Utilities
    click server_connect "https://github.com/kodingkhurram/bank-management-system/blob/main/server_connect.inc.php"

    %% Click Events - Static Assets
    click StaticAssets "https://github.com/kodingkhurram/bank-management-system/tree/main/pure-release-0.5.0/"
    click StaticAssets "https://github.com/kodingkhurram/bank-management-system/blob/main/css/templatemo_main.css"
    click StaticAssets "https://github.com/kodingkhurram/bank-management-system/tree/main/about/css/"
    click StaticAssets "https://github.com/kodingkhurram/bank-management-system/blob/main/js/templatemo_script.js"
    click StaticAssets "https://github.com/kodingkhurram/bank-management-system/blob/main/about/js/init.js"
    click StaticAssets "https://github.com/kodingkhurram/bank-management-system/tree/main/jqvmap/"
    click StaticAssets "https://github.com/kodingkhurram/bank-management-system/blob/main/fonts/FontAwesome.otf"
    click StaticAssets "https://github.com/kodingkhurram/bank-management-system/blob/main/fonts/fontawesome-webfont.eot"
    click StaticAssets "https://github.com/kodingkhurram/bank-management-system/tree/main/about/fonts/"
    click StaticAssets "https://github.com/kodingkhurram/bank-management-system/tree/main/img/"
    click StaticAssets "https://github.com/kodingkhurram/bank-management-system/tree/main/about/images/"

    %% Click Events - Database Schema
    click Database "https://github.com/kodingkhurram/bank-management-system/blob/main/BankMan_db.sql"

    %% Styles
    classDef client fill:#cce5ff,stroke:#0066cc,color:#000
    classDef server fill:#d4edda,stroke:#28a745,color:#000
    classDef database fill:#fff3cd,stroke:#fd7e14,color:#000
    classDef assets fill:#e2e3e5,stroke:#6c757d,color:#000
    classDef php fill:#d1ecf1,stroke:#17a2b8,color:#000
```
