# antonio111698/expense_ledger architecture

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

- Interactive diagram: https://gitdiagram.com/antonio111698/expense_ledger
- Repository: https://github.com/antonio111698/expense_ledger

## Overview

Expense Ledger is a Spring Boot web app for recording and reviewing personal expenses. A user submits an entry through the home page; HomeController creates a FinancialEntry and saves it through the repository. The home route loads entries into the page model for display, and a delete route removes entries. The README also describes filtering, sorting, and calculations, but their implementation is not shown in the sampled source. The README identifies JPA/Flyway and PostgreSQL in production, with H2 locally; database and migration wiring is not sampled, so those links are documented or unverified.

Main entry points: [`src/main/java/com/antonio/expenseledger/HomeController.java`](https://github.com/antonio111698/expense_ledger/blob/main/src/main/java/com/antonio/expenseledger/HomeController.java) (Home controller), [`src/main/java/com/antonio/expenseledger/FinancialEntryRepository.java`](https://github.com/antonio111698/expense_ledger/blob/main/src/main/java/com/antonio/expenseledger/FinancialEntryRepository.java) (Entry repository), [`src/main/java/com/antonio/expenseledger/FinancialEntry.java`](https://github.com/antonio111698/expense_ledger/blob/main/src/main/java/com/antonio/expenseledger/FinancialEntry.java) (Financial entry), [`src/main/resources/db/migration/V1__create_financial_entry_table.sql`](https://github.com/antonio111698/expense_ledger/blob/main/src/main/resources/db/migration/V1__create_financial_entry_table.sql) (Entry table migration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_controller["Home controller"]
  node_page["Ledger page<br/>[index.html]"]
end

subgraph group_domain["Ledger domain"]
  node_entry["Financial entry"]
end

subgraph group_persistence["Persistence"]
  node_repo["Entry repository"]
  node_db[("Relational database")]
  node_migration["Entry table migration"]
end

node_user(("User"))

node_user -->|"requests routes"| node_controller
node_controller -->|"loads entries"| node_repo
node_controller -->|"creates entry"| node_entry
node_controller -->|"saves entry"| node_repo
node_controller -->|"deletes entry"| node_repo
node_repo -->|"manages entities"| node_entry
node_controller -->|"renders page"| node_page
node_repo -.->|"persists entries"| node_db
node_migration -.->|"defines schema"| node_db

click node_controller "https://github.com/antonio111698/expense_ledger/blob/main/src/main/java/com/antonio/expenseledger/HomeController.java"
click node_page "https://github.com/antonio111698/expense_ledger/blob/main/src/main/resources/templates/index.html"
click node_entry "https://github.com/antonio111698/expense_ledger/blob/main/src/main/java/com/antonio/expenseledger/FinancialEntry.java"
click node_repo "https://github.com/antonio111698/expense_ledger/blob/main/src/main/java/com/antonio/expenseledger/FinancialEntryRepository.java"
click node_migration "https://github.com/antonio111698/expense_ledger/blob/main/src/main/resources/db/migration/V1__create_financial_entry_table.sql"

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_controller,node_page,node_user toneBlue
class node_entry toneAmber
class node_repo,node_db,node_migration toneMint
```

## Components

### Web interface

- [Home controller](https://github.com/antonio111698/expense_ledger/blob/main/src/main/java/com/antonio/expenseledger/HomeController.java): `src/main/java/com/antonio/expenseledger/HomeController.java`
- [Ledger page](https://github.com/antonio111698/expense_ledger/blob/main/src/main/resources/templates/index.html): `src/main/resources/templates/index.html`

### Ledger domain

- [Financial entry](https://github.com/antonio111698/expense_ledger/blob/main/src/main/java/com/antonio/expenseledger/FinancialEntry.java): `src/main/java/com/antonio/expenseledger/FinancialEntry.java`

### Persistence

- [Entry repository](https://github.com/antonio111698/expense_ledger/blob/main/src/main/java/com/antonio/expenseledger/FinancialEntryRepository.java): `src/main/java/com/antonio/expenseledger/FinancialEntryRepository.java`
- **Relational database**
- [Entry table migration](https://github.com/antonio111698/expense_ledger/blob/main/src/main/resources/db/migration/V1__create_financial_entry_table.sql): `src/main/resources/db/migration/V1__create_financial_entry_table.sql`

### Other components

- **User**

## Connections

- User → Home controller: requests routes (evidence: `src/main/java/com/antonio/expenseledger/HomeController.java`)
- Home controller → Entry repository: loads entries (evidence: `src/main/java/com/antonio/expenseledger/HomeController.java`)
- Home controller → Financial entry: creates entry (evidence: `src/main/java/com/antonio/expenseledger/HomeController.java`)
- Home controller → Entry repository: saves entry (evidence: `src/main/java/com/antonio/expenseledger/HomeController.java`)
- Home controller → Entry repository: deletes entry (evidence: `src/main/java/com/antonio/expenseledger/HomeController.java`)
- Entry repository → Financial entry: manages entities (evidence: `src/main/java/com/antonio/expenseledger/FinancialEntryRepository.java`)
- Home controller → Ledger page: renders page (evidence: `src/main/java/com/antonio/expenseledger/HomeController.java`)
- Entry repository → Relational database: persists entries (evidence: `README.md`)
- Entry table migration → Relational database: defines schema
