# rajyash1904/atm-machine architecture

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

- Interactive diagram: https://gitdiagram.com/rajyash1904/atm-machine
- Repository: https://github.com/rajyash1904/atm-machine

## Overview

##### Project type and purpose
- This is a small, console-based Java application that simulates an ATM machine.
- Its purpose is to allow a user to deposit, withdraw, and view a bank account’s balance via a command-line interface.

##### File structure
- Top-level files:
- README.md – describes the project, features, and usage
- Jenkinsfile – pipeline definition for CI
- .gitignore, LICENSE, .project – metadata and IDE config
- ATM/ directory:
- ATM.java – entry-point class with main()
- Account.java – domain model for a bank account
- OptionMenu.java – CLI UI and menu logic

##### README for additional insights
- Confirms Java 8+ requirement
- Describes three core operations: deposit, withdraw, view balance
- No external database or network services—data is held in memory

a. Main components
- ATM Application (ATM.java) – initializes the program
- Menu/UI Layer (OptionMenu.java) – handles user prompts and input
- Business Model (Account.java) – holds account state and operations
- In-Memory Data Store – simple Java objects in runtime
- CI Pipeline (Jenkins) – builds and (potentially) tests the code on each commit
b. Relationships & data flow
- ATM.main() → creates OptionMenu instance
- OptionMenu prompts user → invokes Account.deposit()/ withdraw()/getBalance()
- Account updates its internal state → returns results to OptionMenu
- OptionMenu displays updated balance or error messages
- Jenkins triggers on Git commits → checks out code → runs javac → reports status
c. Architectural patterns / principles
- Single-process, layered approach: UI layer vs. domain layer
- Separation of concerns:
– ATM.java owns application launch
– OptionMenu.java owns interaction flow
– Account.java owns business logic and state
- No external persistence—ideal for extension to a database if needed
d. Key technologies and frameworks
- Java 8+ (JDK)
- Jenkins (defined in Jenkinsfile) for CI
- Standard Java libraries (no third-party dependencies)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "CLI Application"
        ATM["ATM (main)"]:::code
        OptionMenu["OptionMenu (UI)"]:::code
        Account["Account (Model)"]:::code
        Store["In-Memory Store"]:::datastore
    end

    subgraph "CI Pipeline"
        Repo["GitHub Repo"]:::external
        Jenkins["Jenkins CI"]:::ci
    end

    Docs["README.md"]:::docs

    ATM -->|"init()"| OptionMenu
    OptionMenu -->|"deposit(amount)\nwithdraw(amount)\ngetBalance()"| Account
    Account -->|"return balance\nor status"| OptionMenu
    Account -->|"update state"| Store

    Repo -->|"on push"| Jenkins
    Jenkins -->|"javac build"| Repo

    click ATM "https://github.com/rajyash1904/atm-machine/blob/master/ATM/ATM.java"
    click OptionMenu "https://github.com/rajyash1904/atm-machine/blob/master/ATM/OptionMenu.java"
    click Account "https://github.com/rajyash1904/atm-machine/blob/master/ATM/Account.java"
    click Jenkins "https://github.com/rajyash1904/atm-machine/tree/master/Jenkinsfile"
    click Docs "https://github.com/rajyash1904/atm-machine/blob/master/README.md"

    classDef code fill:#cce5ff,stroke:#004085,stroke-width:1px;
    classDef ci fill:#d4edda,stroke:#155724,stroke-width:1px;
    classDef datastore stroke-dasharray: 5 5,stroke:#6c757d;
    classDef external fill:#e2e3e5,stroke:#6c757d,stroke-width:1px;
    classDef docs fill:#fff3cd,stroke:#856404,stroke-width:1px;
```
