# bryant-tomilloso/expense-tracker architecture

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

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

## Overview

Expense Tracker is a personal-finance web app for recording and reviewing income and expenses. Users enter or edit transactions in the browser; the client sends requests to the Express server, which validates and stores them in SQLite. The browser also requests filtered lists and totals, and offers date-range PDF or Excel downloads. Separate report views request monthly and category aggregates for charts. The sampled code shows these client/server and server/database interactions; the report-generation routes are in the same server file as the API handlers.

Main entry points: [`public/app.js`](https://github.com/bryant-tomilloso/expense-tracker/blob/main/public/app.js) (Transaction UI), [`server.js`](https://github.com/bryant-tomilloso/expense-tracker/blob/main/server.js) (Summary API), [`public/reports.js`](https://github.com/bryant-tomilloso/expense-tracker/blob/main/public/reports.js) (Report charts), [`public/index.html`](https://github.com/bryant-tomilloso/expense-tracker/blob/main/public/index.html) (App page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser app"]
  node_page["App page<br/>[index.html]"]
  node_transactions_ui["Transaction UI<br/>[app.js]"]
  node_reports_ui["Report charts<br/>[reports.js]"]
end

subgraph group_api["Application API"]
  node_transaction_api["Transaction API<br/>[server.js]"]
  node_summary_api["Summary API<br/>[server.js]"]
  node_chart_api["Chart data API<br/>[server.js]"]
end

subgraph group_data["Transaction storage"]
  node_sqlite[("SQLite database")]
end

subgraph group_exports["Reports and exports"]
  node_excel_export["Excel export<br/>[server.js]"]
  node_pdf_export["PDF export<br/>[server.js]"]
end

node_user(("User"))

node_user -->|"uses"| node_page
node_page -.->|"hosts"| node_transactions_ui
node_transactions_ui -->|"requests"| node_transaction_api
node_transactions_ui -->|"requests"| node_summary_api
node_reports_ui -->|"requests"| node_chart_api
node_reports_ui -->|"requests"| node_summary_api
node_transactions_ui -->|"downloads"| node_excel_export
node_transactions_ui -->|"downloads"| node_pdf_export
node_transaction_api -->|"reads and writes"| node_sqlite
node_summary_api -->|"aggregates"| node_sqlite
node_chart_api -->|"aggregates"| node_sqlite
node_excel_export -->|"reads range"| node_sqlite
node_pdf_export -->|"reads range"| node_sqlite

click node_page "https://github.com/bryant-tomilloso/expense-tracker/blob/main/public/index.html"
click node_transactions_ui "https://github.com/bryant-tomilloso/expense-tracker/blob/main/public/app.js"
click node_reports_ui "https://github.com/bryant-tomilloso/expense-tracker/blob/main/public/reports.js"
click node_transaction_api "https://github.com/bryant-tomilloso/expense-tracker/blob/main/server.js"
click node_summary_api "https://github.com/bryant-tomilloso/expense-tracker/blob/main/server.js"
click node_chart_api "https://github.com/bryant-tomilloso/expense-tracker/blob/main/server.js"
click node_excel_export "https://github.com/bryant-tomilloso/expense-tracker/blob/main/server.js"
click node_pdf_export "https://github.com/bryant-tomilloso/expense-tracker/blob/main/server.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_page,node_transactions_ui,node_reports_ui,node_user toneBlue
class node_transaction_api,node_summary_api,node_chart_api toneAmber
class node_sqlite toneMint
class node_excel_export,node_pdf_export toneRose
```

## Components

### Browser app

- [App page](https://github.com/bryant-tomilloso/expense-tracker/blob/main/public/index.html): `public/index.html`
- [Transaction UI](https://github.com/bryant-tomilloso/expense-tracker/blob/main/public/app.js): `public/app.js`
- [Report charts](https://github.com/bryant-tomilloso/expense-tracker/blob/main/public/reports.js): `public/reports.js`

### Application API

- [Transaction API](https://github.com/bryant-tomilloso/expense-tracker/blob/main/server.js): `server.js`
- [Summary API](https://github.com/bryant-tomilloso/expense-tracker/blob/main/server.js): `server.js`
- [Chart data API](https://github.com/bryant-tomilloso/expense-tracker/blob/main/server.js): `server.js`

### Transaction storage

- **SQLite database**

### Reports and exports

- [Excel export](https://github.com/bryant-tomilloso/expense-tracker/blob/main/server.js): `server.js`
- [PDF export](https://github.com/bryant-tomilloso/expense-tracker/blob/main/server.js): `server.js`

### Other components

- **User**

## Connections

- User → App page: uses (evidence: `README.md`)
- App page → Transaction UI: hosts
- Transaction UI → Transaction API: requests (evidence: `public/app.js`)
- Transaction UI → Summary API: requests (evidence: `public/app.js`)
- Report charts → Chart data API: requests (evidence: `public/reports.js`)
- Report charts → Summary API: requests (evidence: `public/reports.js`)
- Transaction UI → Excel export: downloads (evidence: `public/app.js`)
- Transaction UI → PDF export: downloads (evidence: `public/app.js`)
- Transaction API → SQLite database: reads and writes (evidence: `server.js`)
- Summary API → SQLite database: aggregates (evidence: `server.js`)
- Chart data API → SQLite database: aggregates (evidence: `server.js`)
- Excel export → SQLite database: reads range (evidence: `server.js`)
- PDF export → SQLite database: reads range (evidence: `server.js`)
