# edieno22/spendlog architecture

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

- Interactive diagram: https://gitdiagram.com/edieno22/spendlog
- Repository: https://github.com/edieno22/spendlog

## Overview

SpendLog is a personal expense tracker with expense entry, a paginated expense list, and category, daily, and monthly reports filtered by an inclusive date range. The browser script calls the Express API; the API validates and formats data, and uses an injected MongoDB collection for storage and aggregation. The source excerpts show these main paths, but the README is empty and no HTML or database internals were sampled.

Main entry points: [`app.js`](https://github.com/edieno22/spendlog/blob/main/app.js) (Express API), [`server.js`](https://github.com/edieno22/spendlog/blob/main/server.js) (Server setup), [`public/script.js`](https://github.com/edieno22/spendlog/blob/main/public/script.js) (Expense entry and list), [`lib/expenses.js`](https://github.com/edieno22/spendlog/blob/main/lib/expenses.js) (Expense validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser interface"]
  node_expense_ui["Expense entry and list<br/>[script.js]"]
  node_report_ui["Report filters and display<br/>[script.js]"]
end

subgraph group_api["HTTP application"]
  node_app["Express API<br/>[app.js]"]
  node_server["Server setup<br/>[server.js]"]
end

subgraph group_data["Expense data"]
  node_validation["Expense validation<br/>[expenses.js]"]
  node_range["Date range rules<br/>[expenses.js]"]
  node_aggregation["Report aggregation<br/>[expenses.js]"]
  node_formatting["Money formatting<br/>[expenses.js]"]
  node_mongo[("Expenses collection")]
end

node_user(("User"))

node_user -->|"enters expenses"| node_expense_ui
node_user -->|"filters reports"| node_report_ui
node_server -->|"creates"| node_app
node_server -->|"configures collection"| node_mongo
node_app -->|"validates entries"| node_validation
node_app -->|"checks date range"| node_range
node_app -->|"builds report pipelines"| node_aggregation
node_app -->|"formats amounts"| node_formatting
node_app -->|"inserts, reads, aggregates"| node_mongo
node_expense_ui -->|"requests expense API"| node_app
node_report_ui -->|"requests report API"| node_app

click node_expense_ui "https://github.com/edieno22/spendlog/blob/main/public/script.js"
click node_report_ui "https://github.com/edieno22/spendlog/blob/main/public/script.js"
click node_app "https://github.com/edieno22/spendlog/blob/main/app.js"
click node_validation "https://github.com/edieno22/spendlog/blob/main/lib/expenses.js"
click node_range "https://github.com/edieno22/spendlog/blob/main/lib/expenses.js"
click node_aggregation "https://github.com/edieno22/spendlog/blob/main/lib/expenses.js"
click node_formatting "https://github.com/edieno22/spendlog/blob/main/lib/expenses.js"
click node_server "https://github.com/edieno22/spendlog/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_expense_ui,node_report_ui,node_user toneBlue
class node_app,node_server toneAmber
class node_validation,node_range,node_aggregation,node_formatting,node_mongo toneMint
```

## Components

### Browser interface

- [Expense entry and list](https://github.com/edieno22/spendlog/blob/main/public/script.js): `public/script.js`
- [Report filters and display](https://github.com/edieno22/spendlog/blob/main/public/script.js): `public/script.js`

### HTTP application

- [Express API](https://github.com/edieno22/spendlog/blob/main/app.js): `app.js`
- [Server setup](https://github.com/edieno22/spendlog/blob/main/server.js): `server.js`

### Expense data

- [Expense validation](https://github.com/edieno22/spendlog/blob/main/lib/expenses.js): `lib/expenses.js`
- [Date range rules](https://github.com/edieno22/spendlog/blob/main/lib/expenses.js): `lib/expenses.js`
- [Report aggregation](https://github.com/edieno22/spendlog/blob/main/lib/expenses.js): `lib/expenses.js`
- [Money formatting](https://github.com/edieno22/spendlog/blob/main/lib/expenses.js): `lib/expenses.js`
- **Expenses collection**

### Other components

- **User**

## Connections

- User → Expense entry and list: enters expenses (evidence: `public/script.js`)
- User → Report filters and display: filters reports (evidence: `public/script.js`)
- Server setup → Express API: creates (evidence: `server.js`)
- Server setup → Expenses collection: configures collection (evidence: `server.js`)
- Express API → Expense validation: validates entries (evidence: `app.js`)
- Express API → Date range rules: checks date range (evidence: `app.js`)
- Express API → Report aggregation: builds report pipelines (evidence: `app.js`)
- Express API → Money formatting: formats amounts (evidence: `app.js`)
- Express API → Expenses collection: inserts, reads, aggregates (evidence: `app.js`)
- Expense entry and list → Express API: requests expense API (evidence: `public/script.js`)
- Report filters and display → Express API: requests report API (evidence: `public/script.js`)
