# thing-t6/cliexpensetracker architecture

> Architecture diagram of the GitHub repository thing-t6/cliexpensetracker, 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/thing-t6/cliexpensetracker
- Repository: https://github.com/thing-t6/cliexpensetracker

## Overview

This is a small Java CLI expense tracker. The user enters income and dated expenses; Main collects and totals them, computes the remaining balance through Income, displays the results, and optionally appends a report to a local file or reads it back. The object model is limited to Income and Expenses. Relationships shown are supported by the sampled source; the README also documents input validation and LocalDate-based dates.

Main entry points: [`src/Main.java`](https://github.com/thing-t6/cliexpensetracker/blob/main/src/Main.java) (CLI orchestration), [`src/Income.java`](https://github.com/thing-t6/cliexpensetracker/blob/main/src/Income.java) (Income balance), [`src/Expenses.java`](https://github.com/thing-t6/cliexpensetracker/blob/main/src/Expenses.java) (Expense records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["CLI workflow"]
  node_main["CLI orchestration<br/>[Main.java]"]
end

subgraph group_domain["Transaction model"]
  node_income["Income balance<br/>[Income.java]"]
  node_expenses["Expense records<br/>[Expenses.java]"]
end

subgraph group_persistence["Local reports"]
  node_report[("Local report file<br/>[Main.java]")]
end

node_user(("User"))

node_user -->|"enters data"| node_main
node_main -->|"sets income"| node_income
node_main -->|"creates records"| node_expenses
node_main -->|"updates balance"| node_income
node_main -->|"appends report"| node_report
node_main -->|"reads report"| node_report

click node_main "https://github.com/thing-t6/cliexpensetracker/blob/main/src/Main.java"
click node_income "https://github.com/thing-t6/cliexpensetracker/blob/main/src/Income.java"
click node_expenses "https://github.com/thing-t6/cliexpensetracker/blob/main/src/Expenses.java"
click node_report "https://github.com/thing-t6/cliexpensetracker/blob/main/src/Main.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_income,node_expenses toneAmber
class node_report toneMint
```

## Components

### CLI workflow

- [CLI orchestration](https://github.com/thing-t6/cliexpensetracker/blob/main/src/Main.java): `src/Main.java`

### Transaction model

- [Income balance](https://github.com/thing-t6/cliexpensetracker/blob/main/src/Income.java): `src/Income.java`
- [Expense records](https://github.com/thing-t6/cliexpensetracker/blob/main/src/Expenses.java): `src/Expenses.java`

### Local reports

- [Local report file](https://github.com/thing-t6/cliexpensetracker/blob/main/src/Main.java): `src/Main.java`

### Other components

- **User**

## Connections

- User → CLI orchestration: enters data (evidence: `src/Main.java`)
- CLI orchestration → Income balance: sets income (evidence: `src/Main.java`)
- CLI orchestration → Expense records: creates records (evidence: `src/Main.java`)
- CLI orchestration → Income balance: updates balance (evidence: `src/Main.java`)
- CLI orchestration → Local report file: appends report (evidence: `src/Main.java`)
- CLI orchestration → Local report file: reads report (evidence: `src/Main.java`)
