# janardhanamb/loan-payoff-visualizer architecture

> Architecture diagram of the GitHub repository janardhanamb/loan-payoff-visualizer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/janardhanamb/loan-payoff-visualizer
- Repository: https://github.com/janardhanamb/loan-payoff-visualizer

## Overview

Loan Payoff Visualizer is a console application for calculating EMIs, managing loans, finding loans by ID, ranking loans by interest rate, and creating payment records. The workflow starts in Main: users enter loan or payment details, Main invokes the calculator or updates loan state, and LoanManager holds loan collections and displays the avalanche ordering. PaymentManager exposes a transaction list, but the shown payment flow creates Payment objects without adding them to that list. Connections reflect the excerpts and README; unsampled behavior is not inferred.

Main entry points: [`Main.java`](https://github.com/janardhanamb/loan-payoff-visualizer/blob/main/Main.java) (Menu workflow), [`Loan.java`](https://github.com/janardhanamb/loan-payoff-visualizer/blob/main/Loan.java) (Loan state), [`LoanCalculator.java`](https://github.com/janardhanamb/loan-payoff-visualizer/blob/main/LoanCalculator.java) (EMI calculator), [`LoanManager.java`](https://github.com/janardhanamb/loan-payoff-visualizer/blob/main/LoanManager.java) (Loan collections)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Console workflow"]
  node_main["Menu workflow<br/>[Main.java]"]
end

subgraph group_loans["Loan management"]
  node_loan["Loan state<br/>[Loan.java]"]
  node_calculator["EMI calculator"]
  node_loan_manager["Loan collections<br/>[LoanManager.java]"]
end

subgraph group_payments["Payment management"]
  node_payment["Payment record<br/>[Payment.java]"]
  node_payment_manager["Transaction list"]
end

node_user(("User"))

node_user -->|"selects options"| node_main
node_main -->|"creates and updates"| node_loan
node_main -->|"calculates EMI"| node_calculator
node_main -->|"manages and queries"| node_loan_manager
node_loan_manager -->|"stores and displays"| node_loan
node_main -->|"creates record"| node_payment
node_main -->|"reads transaction count"| node_payment_manager
node_payment_manager -->|"types records"| node_payment
node_calculator -->|"reads loan terms"| node_loan

click node_main "https://github.com/janardhanamb/loan-payoff-visualizer/blob/main/Main.java"
click node_loan "https://github.com/janardhanamb/loan-payoff-visualizer/blob/main/Loan.java"
click node_calculator "https://github.com/janardhanamb/loan-payoff-visualizer/blob/main/LoanCalculator.java"
click node_loan_manager "https://github.com/janardhanamb/loan-payoff-visualizer/blob/main/LoanManager.java"
click node_payment "https://github.com/janardhanamb/loan-payoff-visualizer/blob/main/Payment.java"
click node_payment_manager "https://github.com/janardhanamb/loan-payoff-visualizer/blob/main/PaymentManager.java"

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_main,node_user toneBlue
class node_loan,node_calculator,node_loan_manager toneAmber
class node_payment,node_payment_manager toneMint
```

## Components

### Console workflow

- [Menu workflow](https://github.com/janardhanamb/loan-payoff-visualizer/blob/main/Main.java): `Main.java`

### Loan management

- [Loan state](https://github.com/janardhanamb/loan-payoff-visualizer/blob/main/Loan.java): `Loan.java`
- [EMI calculator](https://github.com/janardhanamb/loan-payoff-visualizer/blob/main/LoanCalculator.java): `LoanCalculator.java`
- [Loan collections](https://github.com/janardhanamb/loan-payoff-visualizer/blob/main/LoanManager.java): `LoanManager.java`

### Payment management

- [Payment record](https://github.com/janardhanamb/loan-payoff-visualizer/blob/main/Payment.java): `Payment.java`
- [Transaction list](https://github.com/janardhanamb/loan-payoff-visualizer/blob/main/PaymentManager.java): `PaymentManager.java`

### Other components

- **User**

## Connections

- User → Menu workflow: selects options (evidence: `Main.java`)
- Menu workflow → Loan state: creates and updates (evidence: `Main.java`)
- Menu workflow → EMI calculator: calculates EMI (evidence: `Main.java`)
- Menu workflow → Loan collections: manages and queries (evidence: `Main.java`)
- Loan collections → Loan state: stores and displays (evidence: `LoanManager.java`)
- Menu workflow → Payment record: creates record (evidence: `Main.java`)
- Menu workflow → Transaction list: reads transaction count (evidence: `Main.java`)
- Transaction list → Payment record: types records (evidence: `PaymentManager.java`)
- EMI calculator → Loan state: reads loan terms (evidence: `LoanCalculator.java`)
