# quantumjv/bank-management-system architecture

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

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

## Overview

##### Project type and purpose
- This is a monolithic, command-line Banking Management System written in Python, backed by a MySQL database (schema in bank.sql).
- Purpose: Provide basic banking operations (create/close accounts, deposit/withdraw money, view individual/all customer details) with username/password authentication.

##### File structure
- Top-level files:
- bank.py – the single Python entry point containing CLI menus, business logic, and data-access calls
- bank.sql – DDL/DML script defining the MySQL schema (tables for customers, transactions, users, etc.)
- screenshots/ – UI snapshots (CLI output)
- README.md, License – documentation
- No separate “frontend” or “backend” folders: UI, logic, and DB integration are all in bank.py.
- No containers, microservices, or API layers—it's a simple, direct DB-driven script.

##### Extract insights from README
- Confirms Python + MySQL stack.
- Lists features: withdraw/deposit, view/add/close accounts, authentication.
- Operational flow is linear: user logs in → selects operation → Python executes SQL queries → displays results.

a. Main components
1. User (CLI client)
2. bank.py application (three sub-layers: Presentation/CLI module, Business Logic module, Data Access module)
3. MySQL Database (tables: Users, Customers, Transactions)
4. Optional: Operating System / Python runtime
b. Relationships & interactions
- User → (stdin/CLI commands) → Presentation layer of bank.py
- Presentation layer → invokes Business Logic functions
- Business Logic → issues SQL via Data Access layer (using MySQL connector)
- Data Access layer → communicates over TCP/IP or socket with MySQL Server
- MySQL Server → returns query results → Data Access → Business Logic → Presentation → User
c. Architectural patterns/design principles
- Monolithic, layered approach (UI/logic/data access)
- Single responsibility per layer:
– Presentation: menu rendering & input parsing
– Business Logic: validation, transaction rules, flow control
– Data Access: raw SQL execution, connection management
- Authentication gate at entry point enforcing security before business ops
d. Key technologies
- Python 3.x, mysql-connector or PyMySQL
- MySQL Community Server
- bank.sql for schema setup

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Actors
    User(["User/CLI"]):::actor

    %% Application Layers
    subgraph "Bank.py Application"
        Presentation["Presentation Layer\n(CLI menus & I/O)"]:::app
        BusinessLogic["Business Logic Layer\n(authentication, account ops, transaction rules)"]:::app
        DataAccess["Data Access Layer\n(SQL connection & raw query execution)"]:::app
    end

    %% External Database
    MySQL["MySQL Database\n(Users, Customers, Transactions)"]:::db

    %% Project Artifacts
    subgraph "Project Artifacts"
        README["README.md"]:::doc
        License["License"]:::doc
        Screenshots["screenshots/"]:::doc
    end

    %% Data Flow
    User -->|"command input"| Presentation
    Presentation -->|"authenticate user / invoke operation"| BusinessLogic
    BusinessLogic -->|"execute SQL"| DataAccess
    DataAccess -->|"TCP/IP query"| MySQL
    MySQL -->|"query results"| DataAccess
    DataAccess -->|"return data"| BusinessLogic
    BusinessLogic -->|"show result"| Presentation
    Presentation -->|"display output"| User

    %% Click Events
    click Presentation "https://github.com/quantumjv/bank-management-system/blob/main/bank.py"
    click BusinessLogic "https://github.com/quantumjv/bank-management-system/blob/main/bank.py"
    click DataAccess "https://github.com/quantumjv/bank-management-system/blob/main/bank.py"
    click MySQL "https://github.com/quantumjv/bank-management-system/blob/main/bank.sql"
    click README "https://github.com/quantumjv/bank-management-system/blob/main/README.md"
    click License "https://github.com/quantumjv/bank-management-system/tree/main/License"
    click Screenshots "https://github.com/quantumjv/bank-management-system/tree/main/screenshots/"

    %% Styling
    classDef actor fill:#f9f,stroke:#333,stroke-width:2px;
    classDef app fill:#bbf,stroke:#333,stroke-width:2px;
    classDef db fill:#bfb,stroke:#333,stroke-width:2px;
    classDef doc fill:#fbf,stroke:#333,stroke-width:2px;
```
