# renzosantelli/expense-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/renzosantelli/expense-tracker
- Repository: https://github.com/renzosantelli/expense-tracker

## Overview

This is a browser-based expense tracker. Users add expenses, which are validated, kept in an in-memory list, and saved to local storage; the app displays the list, totals, and category totals, with filtering, sorting, deletion, and category creation. The sampled JavaScript supports these runtime relationships; the HTML and CSS are present in the tree but were not sampled, so their internal structure and styling links are not mapped.

Main entry points: [`gastos.js`](https://github.com/renzosantelli/expense-tracker/blob/main/gastos.js) (Expense list), [`index.html`](https://github.com/renzosantelli/expense-tracker/blob/main/index.html) (Tracker interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_ui["Tracker interface<br/>[index.html]"]
  node_table["Expense table<br/>[gastos.js]"]
end

subgraph group_expenses["Expense management"]
  node_entry["Expense entry<br/>[gastos.js]"]
  node_expense_list["Expense list<br/>[gastos.js]"]
  node_category_management["Category management<br/>[gastos.js]"]
  node_filtering["Category filtering<br/>[gastos.js]"]
  node_sorting["Amount sorting<br/>[gastos.js]"]
  node_totals["Overall total<br/>[gastos.js]"]
  node_category_totals["Category totals<br/>[gastos.js]"]
end

subgraph group_persistence["Local persistence"]
  node_storage[("Browser local storage")]
end

node_user(("User"))

node_user -->|"uses"| node_ui
node_ui -->|"submits"| node_entry
node_entry -->|"adds expense"| node_expense_list
node_entry -->|"saves"| node_storage
node_entry -->|"refreshes"| node_table
node_expense_list -->|"loads and saves"| node_storage
node_expense_list -->|"renders"| node_table
node_expense_list -->|"updates"| node_totals
node_expense_list -->|"updates"| node_category_totals
node_expense_list -->|"requests filtered list"| node_filtering
node_filtering -->|"passes results"| node_sorting
node_sorting -->|"provides rows"| node_table
node_ui -->|"changes filter"| node_filtering
node_ui -->|"changes order"| node_sorting
node_ui -->|"adds category"| node_category_management
node_table -->|"deletes expense"| node_expense_list

click node_ui "https://github.com/renzosantelli/expense-tracker/blob/main/index.html"
click node_entry "https://github.com/renzosantelli/expense-tracker/blob/main/gastos.js"
click node_expense_list "https://github.com/renzosantelli/expense-tracker/blob/main/gastos.js"
click node_category_management "https://github.com/renzosantelli/expense-tracker/blob/main/gastos.js"
click node_filtering "https://github.com/renzosantelli/expense-tracker/blob/main/gastos.js"
click node_sorting "https://github.com/renzosantelli/expense-tracker/blob/main/gastos.js"
click node_table "https://github.com/renzosantelli/expense-tracker/blob/main/gastos.js"
click node_totals "https://github.com/renzosantelli/expense-tracker/blob/main/gastos.js"
click node_category_totals "https://github.com/renzosantelli/expense-tracker/blob/main/gastos.js"

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_ui,node_table,node_user toneBlue
class node_entry,node_expense_list,node_category_management,node_filtering,node_sorting,node_totals,node_category_totals toneAmber
class node_storage toneMint
```

## Components

### User interface

- [Tracker interface](https://github.com/renzosantelli/expense-tracker/blob/main/index.html): `index.html`
- [Expense table](https://github.com/renzosantelli/expense-tracker/blob/main/gastos.js): `gastos.js`

### Expense management

- [Expense entry](https://github.com/renzosantelli/expense-tracker/blob/main/gastos.js): `gastos.js`
- [Expense list](https://github.com/renzosantelli/expense-tracker/blob/main/gastos.js): `gastos.js`
- [Category management](https://github.com/renzosantelli/expense-tracker/blob/main/gastos.js): `gastos.js`
- [Category filtering](https://github.com/renzosantelli/expense-tracker/blob/main/gastos.js): `gastos.js`
- [Amount sorting](https://github.com/renzosantelli/expense-tracker/blob/main/gastos.js): `gastos.js`
- [Overall total](https://github.com/renzosantelli/expense-tracker/blob/main/gastos.js): `gastos.js`
- [Category totals](https://github.com/renzosantelli/expense-tracker/blob/main/gastos.js): `gastos.js`

### Local persistence

- **Browser local storage**

### Other components

- **User**

## Connections

- User → Tracker interface: uses
- Tracker interface → Expense entry: submits (evidence: `gastos.js`)
- Expense entry → Expense list: adds expense (evidence: `gastos.js`)
- Expense entry → Browser local storage: saves (evidence: `gastos.js`)
- Expense entry → Expense table: refreshes (evidence: `gastos.js`)
- Expense list → Browser local storage: loads and saves (evidence: `gastos.js`)
- Expense list → Expense table: renders (evidence: `gastos.js`)
- Expense list → Overall total: updates (evidence: `gastos.js`)
- Expense list → Category totals: updates (evidence: `gastos.js`)
- Expense list → Category filtering: requests filtered list (evidence: `gastos.js`)
- Category filtering → Amount sorting: passes results (evidence: `gastos.js`)
- Amount sorting → Expense table: provides rows (evidence: `gastos.js`)
- Tracker interface → Category filtering: changes filter (evidence: `gastos.js`)
- Tracker interface → Amount sorting: changes order (evidence: `gastos.js`)
- Tracker interface → Category management: adds category (evidence: `gastos.js`)
- Expense table → Expense list: deletes expense (evidence: `gastos.js`)
