# sarosh13/project-banking-application architecture

> Architecture diagram of the GitHub repository sarosh13/project-banking-application, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sarosh13/project-banking-application
- Repository: https://github.com/sarosh13/project-banking-application

## Overview

##### Main Components
- User Interface (UI) Layer: Represented by the Swing components. This includes several screens such as:
- FirstFrame – The dashboard where users choose to log in or create a new account.
- Login – The authentication screen for existing users.
- NewAccount – The registration screen for new users.
- Cash – Likely handling the core banking transactions (Deposit, Withdrawal, Balance enquiry, etc.).
- EndFrame – The exit or logout screen.
- Business Logic / Application Layer: Although not clearly compartmentalized into separate packages in the file tree, the code classes encapsulate the logic of handling user actions (login validations, account creation, security protocols, and money related operations).
- Data Access Layer: While there is no explicit “database” folder in the file tree, the README indicates that MySQL is used with the JDBC Connector. This suggests that database operations (like storing account balances, user credentials, transaction history) are performed through JDBC calls likely embedded within these classes.
- External Systems / Dependencies: This includes the MySQL database server and security protocols to validate login entries.

##### Relationships and Data Flow
- Upon successful login (using the Login screen), the user is taken to the ATM UI (Cash class), where they can choose deposit, withdrawal, balance enquiry, or exit.
- Operations from the Cash component interact with the backend (business logic) that, in turn, communicates with the MySQL database using the JDBC Connector.
- Finally, upon choosing exit, the EndFrame is displayed.

- User input → FirstFrame → (choice between “Login” or “Create Account”).
- Login → Validate credentials through business logic → Query/Update MySQL DB (via JDBC).
- Cash (ATM UI) → Transaction processing → Database update, etc.

##### Important Architectural Patterns
- Presentation Layer (Swing UI components)
- Business Logic Layer (which includes security checks and banking operations)
- Data Access Layer (MySQL interactions via JDBC)
- Noting any security check patterns, such as verifying login credentials before allowing access to sensitive transactions.

##### Relevant Technologies and Frameworks
- Java as the programming language.
- Swing for building the graphical user interface.
- MySQL for data persistence.
- JDBC Connector for database communication.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["Bank Customer"]:::external

    subgraph "Presentation Layer"
        firstFrame["Dashboard (FirstFrame)"]:::frontend
        login["Login Screen"]:::frontend
        newAccount["Registration (NewAccount)"]:::frontend
        cash["ATM Operations (Cash)"]:::frontend
        endFrame["Exit Screen (EndFrame)"]:::frontend
    end

    businessLogic["Business Logic & Security"]:::logic
    database["MySQL Database (via JDBC)"]:::database

    User -->|"initiates"| firstFrame
    firstFrame -->|"chooses_Login"| login
    firstFrame -->|"chooses_Registration"| newAccount
    login -->|"validate_credentials"| businessLogic
    newAccount -->|"create_account"| businessLogic
    businessLogic -->|"process_transactions"| cash
    cash -->|"update_read_DB"| database
    cash -->|"trigger_exit"| endFrame

    click firstFrame "https://github.com/sarosh13/project-banking-application/blob/main/code/FirstFrame.java"
    click login "https://github.com/sarosh13/project-banking-application/blob/main/code/Login.java"
    click newAccount "https://github.com/sarosh13/project-banking-application/blob/main/code/NewAccount.java"
    click cash "https://github.com/sarosh13/project-banking-application/blob/main/code/Cash.java"
    click endFrame "https://github.com/sarosh13/project-banking-application/blob/main/code/EndFrame.java"

    classDef frontend fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef logic fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef database fill:#A9DFBF,stroke:#1E8449,stroke-width:2px;
    classDef external fill:#FADBD8,stroke:#922B21,stroke-width:2px;
```
