# tanmoy20005/atm_simulator architecture

> Architecture diagram of the GitHub repository tanmoy20005/atm_simulator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tanmoy20005/atm_simulator
- Repository: https://github.com/tanmoy20005/atm_simulator

## Overview

Smart ATM Simulator is a console application whose main workflow is menu selection, account-number and PIN authentication, then a balance inquiry, deposit, withdrawal, or history lookup. Deposits and withdrawals rewrite account records through a temporary file and append timestamped entries to a ledger. The single C++ source implements the menu, authentication, operations, and timestamp formatting. The README documents these capabilities; no hardware or bank-service integration is shown.

Main entry points: [`atm_simulator.cpp`](https://github.com/tanmoy20005/atm_simulator/blob/main/atm_simulator.cpp) (Cash Deposit), [`account.txt`](https://github.com/tanmoy20005/atm_simulator/blob/main/account.txt) (Account Records), [`README.md`](https://github.com/tanmoy20005/atm_simulator/blob/main/README.md) (Transaction Ledger)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User Interaction"]
  node_menu["ATM Menu<br/>[atm_simulator.cpp]"]
  node_login["Account Login<br/>[atm_simulator.cpp]"]
  node_pin["PIN Check<br/>[atm_simulator.cpp]"]
end

subgraph group_services["ATM Operations"]
  node_balance["Balance Inquiry<br/>[atm_simulator.cpp]"]
  node_deposit["Cash Deposit<br/>[atm_simulator.cpp]"]
  node_withdraw["Cash Withdrawal<br/>[atm_simulator.cpp]"]
  node_history_view["History Lookup<br/>[atm_simulator.cpp]"]
  node_timestamp["Timestamp Formatter<br/>[atm_simulator.cpp]"]
end

subgraph group_storage["File Storage"]
  node_accounts[("Account Records<br/>[account.txt]")]
  node_temporary["Temporary Records<br/>[atm_simulator.cpp]"]
  node_ledger[("Transaction Ledger<br/>[README.md]")]
end

node_customer(("Customer"))

node_customer -->|"selects option"| node_menu
node_menu -->|"dispatches"| node_balance
node_menu -->|"dispatches"| node_deposit
node_menu -->|"dispatches"| node_withdraw
node_menu -->|"dispatches"| node_history_view
node_balance -->|"calls"| node_login
node_deposit -->|"calls"| node_login
node_withdraw -->|"calls"| node_login
node_history_view -->|"calls"| node_login
node_login -->|"calls"| node_pin
node_login -->|"reads"| node_accounts
node_pin -->|"reads"| node_accounts
node_balance -->|"reads balance"| node_accounts
node_deposit -->|"reads records"| node_accounts
node_deposit -->|"writes records"| node_temporary
node_deposit -->|"replaces file"| node_accounts
node_deposit -->|"appends entry"| node_ledger
node_deposit -->|"calls"| node_timestamp
node_withdraw -->|"reads records"| node_accounts
node_withdraw -->|"writes records"| node_temporary
node_withdraw -->|"replaces file"| node_accounts
node_withdraw -->|"appends entry"| node_ledger
node_withdraw -->|"calls"| node_timestamp
node_history_view -->|"reads entries"| node_ledger

click node_menu "https://github.com/tanmoy20005/atm_simulator/blob/main/atm_simulator.cpp"
click node_login "https://github.com/tanmoy20005/atm_simulator/blob/main/atm_simulator.cpp"
click node_pin "https://github.com/tanmoy20005/atm_simulator/blob/main/atm_simulator.cpp"
click node_balance "https://github.com/tanmoy20005/atm_simulator/blob/main/atm_simulator.cpp"
click node_deposit "https://github.com/tanmoy20005/atm_simulator/blob/main/atm_simulator.cpp"
click node_withdraw "https://github.com/tanmoy20005/atm_simulator/blob/main/atm_simulator.cpp"
click node_history_view "https://github.com/tanmoy20005/atm_simulator/blob/main/atm_simulator.cpp"
click node_timestamp "https://github.com/tanmoy20005/atm_simulator/blob/main/atm_simulator.cpp"
click node_accounts "https://github.com/tanmoy20005/atm_simulator/blob/main/account.txt"
click node_temporary "https://github.com/tanmoy20005/atm_simulator/blob/main/atm_simulator.cpp"
click node_ledger "https://github.com/tanmoy20005/atm_simulator/blob/main/README.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_menu,node_login,node_pin toneBlue
class node_balance,node_deposit,node_withdraw,node_history_view,node_timestamp toneAmber
class node_accounts,node_temporary,node_ledger toneMint
class node_customer toneIndigo
```

## Components

### User Interaction

- [ATM Menu](https://github.com/tanmoy20005/atm_simulator/blob/main/atm_simulator.cpp): `atm_simulator.cpp`
- [Account Login](https://github.com/tanmoy20005/atm_simulator/blob/main/atm_simulator.cpp): `atm_simulator.cpp`
- [PIN Check](https://github.com/tanmoy20005/atm_simulator/blob/main/atm_simulator.cpp): `atm_simulator.cpp`

### ATM Operations

- [Balance Inquiry](https://github.com/tanmoy20005/atm_simulator/blob/main/atm_simulator.cpp): `atm_simulator.cpp`
- [Cash Deposit](https://github.com/tanmoy20005/atm_simulator/blob/main/atm_simulator.cpp): `atm_simulator.cpp`
- [Cash Withdrawal](https://github.com/tanmoy20005/atm_simulator/blob/main/atm_simulator.cpp): `atm_simulator.cpp`
- [History Lookup](https://github.com/tanmoy20005/atm_simulator/blob/main/atm_simulator.cpp): `atm_simulator.cpp`
- [Timestamp Formatter](https://github.com/tanmoy20005/atm_simulator/blob/main/atm_simulator.cpp): `atm_simulator.cpp`

### File Storage

- [Account Records](https://github.com/tanmoy20005/atm_simulator/blob/main/account.txt): `account.txt`
- [Temporary Records](https://github.com/tanmoy20005/atm_simulator/blob/main/atm_simulator.cpp): `atm_simulator.cpp`
- [Transaction Ledger](https://github.com/tanmoy20005/atm_simulator/blob/main/README.md): `README.md`

### Other components

- **Customer**

## Connections

- Customer → ATM Menu: selects option (evidence: `atm_simulator.cpp`)
- ATM Menu → Balance Inquiry: dispatches (evidence: `atm_simulator.cpp`)
- ATM Menu → Cash Deposit: dispatches (evidence: `atm_simulator.cpp`)
- ATM Menu → Cash Withdrawal: dispatches (evidence: `atm_simulator.cpp`)
- ATM Menu → History Lookup: dispatches (evidence: `atm_simulator.cpp`)
- Balance Inquiry → Account Login: calls (evidence: `atm_simulator.cpp`)
- Cash Deposit → Account Login: calls (evidence: `atm_simulator.cpp`)
- Cash Withdrawal → Account Login: calls (evidence: `atm_simulator.cpp`)
- History Lookup → Account Login: calls (evidence: `atm_simulator.cpp`)
- Account Login → PIN Check: calls (evidence: `atm_simulator.cpp`)
- Account Login → Account Records: reads (evidence: `atm_simulator.cpp`)
- PIN Check → Account Records: reads (evidence: `atm_simulator.cpp`)
- Balance Inquiry → Account Records: reads balance (evidence: `atm_simulator.cpp`)
- Cash Deposit → Account Records: reads records (evidence: `atm_simulator.cpp`)
- Cash Deposit → Temporary Records: writes records (evidence: `atm_simulator.cpp`)
- Cash Deposit → Account Records: replaces file (evidence: `atm_simulator.cpp`)
- Cash Deposit → Transaction Ledger: appends entry (evidence: `atm_simulator.cpp`)
- Cash Deposit → Timestamp Formatter: calls (evidence: `atm_simulator.cpp`)
- Cash Withdrawal → Account Records: reads records (evidence: `atm_simulator.cpp`)
- Cash Withdrawal → Temporary Records: writes records (evidence: `atm_simulator.cpp`)
- Cash Withdrawal → Account Records: replaces file (evidence: `atm_simulator.cpp`)
- Cash Withdrawal → Transaction Ledger: appends entry (evidence: `atm_simulator.cpp`)
- Cash Withdrawal → Timestamp Formatter: calls (evidence: `atm_simulator.cpp`)
- History Lookup → Transaction Ledger: reads entries (evidence: `atm_simulator.cpp`)
