# allwinnavise/ledger architecture

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

- Interactive diagram: https://gitdiagram.com/allwinnavise/ledger
- Repository: https://github.com/allwinnavise/ledger

## Overview

This is a React personal-finance ledger interface: users can record spending and savings, review current spending, and browse dated transaction history. The browser entry mounts the routed application; the application loads ledger data and shares state with the feature views. Spending entry is delegated to a form component, while the spending and savings views send changes to an HTTP API at localhost:3500. The README only documents Create React App setup, and no backend source is present in the tree, so API internals and the role of data/db.json cannot be verified.

Main entry points: [`src/App.js`](https://github.com/allwinnavise/ledger/blob/main/src/App.js) (Routed app and shared state), [`src/spendings.js`](https://github.com/allwinnavise/ledger/blob/main/src/spendings.js) (Today's spending), [`src/index.js`](https://github.com/allwinnavise/ledger/blob/main/src/index.js) (Browser entry), [`src/addSpending.js`](https://github.com/allwinnavise/ledger/blob/main/src/addSpending.js) (Spending form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_entry["Browser entry<br/>[index.js]"]
  node_app["Routed app and shared state<br/>[App.js]"]
end

subgraph group_ledger["Ledger actions"]
  node_spendings["Today's spending<br/>[spendings.js]"]
  node_addform["Spending form<br/>[addSpending.js]"]
  node_savings["Savings entry and history<br/>[savings.js]"]
end

subgraph group_views["Ledger views"]
  node_home["Home view<br/>[homepage.js]"]
  node_history["Dated transaction history<br/>[expensesHistory.js]"]
end

node_user(("User"))
node_api{{"Ledger HTTP API"}}

node_user -->|"opens"| node_entry
node_entry -->|"mounts"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_spendings
node_app -->|"routes to"| node_savings
node_app -->|"routes to"| node_history
node_app -->|"loads ledger data"| node_api
node_spendings -->|"renders"| node_addform
node_addform -->|"submits callback"| node_spendings
node_spendings -->|"writes spending"| node_api
node_savings -->|"reads and writes savings"| node_api

click node_entry "https://github.com/allwinnavise/ledger/blob/main/src/index.js"
click node_app "https://github.com/allwinnavise/ledger/blob/main/src/App.js"
click node_home "https://github.com/allwinnavise/ledger/blob/main/src/homepage.js"
click node_spendings "https://github.com/allwinnavise/ledger/blob/main/src/spendings.js"
click node_addform "https://github.com/allwinnavise/ledger/blob/main/src/addSpending.js"
click node_savings "https://github.com/allwinnavise/ledger/blob/main/src/savings.js"
click node_history "https://github.com/allwinnavise/ledger/blob/main/src/expensesHistory.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_entry,node_app,node_user toneBlue
class node_spendings,node_addform,node_savings toneAmber
class node_home,node_history,node_api toneMint
```

## Components

### Application shell

- [Browser entry](https://github.com/allwinnavise/ledger/blob/main/src/index.js): `src/index.js`
- [Routed app and shared state](https://github.com/allwinnavise/ledger/blob/main/src/App.js): `src/App.js`

### Ledger actions

- [Today's spending](https://github.com/allwinnavise/ledger/blob/main/src/spendings.js): `src/spendings.js`
- [Spending form](https://github.com/allwinnavise/ledger/blob/main/src/addSpending.js): `src/addSpending.js`
- [Savings entry and history](https://github.com/allwinnavise/ledger/blob/main/src/savings.js): `src/savings.js`

### Ledger views

- [Home view](https://github.com/allwinnavise/ledger/blob/main/src/homepage.js): `src/homepage.js`
- [Dated transaction history](https://github.com/allwinnavise/ledger/blob/main/src/expensesHistory.js): `src/expensesHistory.js`

### Other components

- **User**
- **Ledger HTTP API**

## Connections

- User → Browser entry: opens
- Browser entry → Routed app and shared state: mounts (evidence: `src/index.js`)
- Routed app and shared state → Home view: routes to (evidence: `src/App.js`)
- Routed app and shared state → Today's spending: routes to (evidence: `src/App.js`)
- Routed app and shared state → Savings entry and history: routes to (evidence: `src/App.js`)
- Routed app and shared state → Dated transaction history: routes to (evidence: `src/App.js`)
- Routed app and shared state → Ledger HTTP API: loads ledger data (evidence: `src/App.js`)
- Today's spending → Spending form: renders (evidence: `src/spendings.js`)
- Spending form → Today's spending: submits callback (evidence: `src/addSpending.js`)
- Today's spending → Ledger HTTP API: writes spending (evidence: `src/spendings.js`)
- Savings entry and history → Ledger HTTP API: reads and writes savings (evidence: `src/savings.js`)
