# preetichaudhary-it/expense-tracker architecture

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

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

## Overview

DailySpend is a browser-based expense tracker. Users register, log in, and reach a per-user dashboard where they add, edit, delete, search, and filter transactions while viewing income, expenses, and balance totals. Authentication and transaction data are stored in browser LocalStorage; there is no server-side service in the documented design. The dashboard excerpt shows its session guard, transaction rendering, summary calculations, and form handling. HTML page wiring was not sampled, so page-to-script links are not asserted.

Main entry points: [`js/dashboard.js`](https://github.com/preetichaudhary-it/expense-tracker/blob/main/js/dashboard.js) (Dashboard Controller), [`js/login.js`](https://github.com/preetichaudhary-it/expense-tracker/blob/main/js/login.js) (Login), [`js/register.js`](https://github.com/preetichaudhary-it/expense-tracker/blob/main/js/register.js) (Registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth["Account Access"]
  node_registration["Registration<br/>[register.js]"]
  node_login["Login<br/>[login.js]"]
end

subgraph group_dashboard["Expense Dashboard"]
  node_dashboard_controller["Dashboard Controller<br/>[dashboard.js]"]
  node_transaction_list["Transaction List<br/>[dashboard.js]"]
  node_summary["Income &amp; Balance<br/>[dashboard.js]"]
end

subgraph group_storage["Browser Storage"]
  node_transactions[("User Transactions")]
  node_users[("Registered Users")]
  node_session[("Active Session")]
end

node_user(("User"))

node_user -->|"submits details"| node_registration
node_registration -->|"reads and writes"| node_users
node_registration -->|"redirects"| node_login
node_user -->|"submits credentials"| node_login
node_login -->|"reads users"| node_users
node_login -->|"writes session"| node_session
node_login -->|"redirects"| node_dashboard_controller
node_dashboard_controller -->|"reads session"| node_session
node_dashboard_controller -->|"reads and writes"| node_transactions
node_dashboard_controller -->|"updates totals"| node_summary
node_dashboard_controller -->|"refreshes list"| node_transaction_list
node_transaction_list -->|"displays filtered items"| node_user

click node_registration "https://github.com/preetichaudhary-it/expense-tracker/blob/main/js/register.js"
click node_login "https://github.com/preetichaudhary-it/expense-tracker/blob/main/js/login.js"
click node_dashboard_controller "https://github.com/preetichaudhary-it/expense-tracker/blob/main/js/dashboard.js"
click node_transaction_list "https://github.com/preetichaudhary-it/expense-tracker/blob/main/js/dashboard.js"
click node_summary "https://github.com/preetichaudhary-it/expense-tracker/blob/main/js/dashboard.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_registration,node_login,node_user toneBlue
class node_dashboard_controller,node_transaction_list,node_summary toneAmber
class node_transactions,node_users,node_session toneMint
```

## Components

### Account Access

- [Registration](https://github.com/preetichaudhary-it/expense-tracker/blob/main/js/register.js): `js/register.js`
- [Login](https://github.com/preetichaudhary-it/expense-tracker/blob/main/js/login.js): `js/login.js`

### Expense Dashboard

- [Dashboard Controller](https://github.com/preetichaudhary-it/expense-tracker/blob/main/js/dashboard.js): `js/dashboard.js`
- [Transaction List](https://github.com/preetichaudhary-it/expense-tracker/blob/main/js/dashboard.js): `js/dashboard.js`
- [Income & Balance](https://github.com/preetichaudhary-it/expense-tracker/blob/main/js/dashboard.js): `js/dashboard.js`

### Browser Storage

- **User Transactions**
- **Registered Users**
- **Active Session**

### Other components

- **User**

## Connections

- User → Registration: submits details (evidence: `js/register.js`)
- Registration → Registered Users: reads and writes (evidence: `js/register.js`)
- Registration → Login: redirects (evidence: `js/register.js`)
- User → Login: submits credentials (evidence: `js/login.js`)
- Login → Registered Users: reads users (evidence: `js/login.js`)
- Login → Active Session: writes session (evidence: `js/login.js`)
- Login → Dashboard Controller: redirects (evidence: `js/login.js`)
- Dashboard Controller → Active Session: reads session (evidence: `js/dashboard.js`)
- Dashboard Controller → User Transactions: reads and writes (evidence: `js/dashboard.js`)
- Dashboard Controller → Income & Balance: updates totals (evidence: `js/dashboard.js`)
- Dashboard Controller → Transaction List: refreshes list (evidence: `js/dashboard.js`)
- Transaction List → User: displays filtered items (evidence: `js/dashboard.js`)
