# samvesh-cs/spendwise architecture

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

- Interactive diagram: https://gitdiagram.com/samvesh-cs/spendwise
- Repository: https://github.com/samvesh-cs/spendwise

## Overview

SpendWise is a browser-based expense tracker. A user enters through the home page, navigates to the overview or transaction pages, and adds, edits, deletes, searches, or filters expense records. The overview also summarizes total and current-month spending and expense count. Expense records are shared through React context and persisted in browser localStorage; a separate context holds theme and toast state. The README also documents light/dark mode. The graph reflects shown imports, calls, and documented behavior; unsampled components are included from the source index, without inferring their internal behavior.

Main entry points: [`src/App.jsx`](https://github.com/samvesh-cs/spendwise/blob/main/src/App.jsx) (App router), [`src/components/List.jsx`](https://github.com/samvesh-cs/spendwise/blob/main/src/components/List.jsx) (Expense rows), [`src/pages/Overview.jsx`](https://github.com/samvesh-cs/spendwise/blob/main/src/pages/Overview.jsx) (Overview page), [`src/components/ExpenseForm.jsx`](https://github.com/samvesh-cs/spendwise/blob/main/src/components/ExpenseForm.jsx) (Expense form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Navigation and pages"]
  node_app["App router<br/>[App.jsx]"]
  node_home["Home page<br/>[Home.jsx]"]
  node_overview["Overview page<br/>[Overview.jsx]"]
  node_add_page["Add expense page<br/>[AddExpense.jsx]"]
  node_transactions["Transactions page<br/>[Transactions.jsx]"]
  node_navigation_bar["Navigation bar<br/>[NavigationBar.jsx]"]
end

subgraph group_expense_workflow["Expense workflow"]
  node_expense_form["Expense form<br/>[ExpenseForm.jsx]"]
  node_editing_form["Editing form<br/>[EditingForm.jsx]"]
end

subgraph group_presentation["Expense presentation"]
  node_expense_list["Expense list<br/>[ExpenseList.jsx]"]
  node_search_filter["Search and filter"]
  node_list["Expense rows<br/>[List.jsx]"]
  node_no_expense["Empty state<br/>[NoExpense.jsx]"]
  node_summary_card["Summary cards<br/>[SummaryCard.jsx]"]
  node_add_toast["Add toast<br/>[ToastExpense.jsx]"]
  node_delete_toast["Delete toast<br/>[ToastDelete.jsx]"]
end

subgraph group_shared_state["Shared state"]
  node_expense_state["Expense state"]
  node_app_state["Theme and toast state<br/>[OtherContext.jsx]"]
end

node_user(("User"))
node_browser_storage[("Browser localStorage")]

node_user -->|"opens"| node_home
node_app -->|"renders"| node_navigation_bar
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_overview
node_app -->|"routes to"| node_add_page
node_app -->|"routes to"| node_transactions
node_home -->|"links to"| node_overview
node_app -->|"reads theme"| node_app_state
node_add_page -->|"renders"| node_expense_form
node_overview -->|"renders"| node_expense_form
node_overview -->|"renders"| node_expense_list
node_overview -->|"renders"| node_summary_card
node_transactions -->|"renders"| node_expense_list
node_expense_form -->|"adds expense"| node_expense_state
node_expense_form -->|"sets toast"| node_app_state
node_expense_form -->|"renders"| node_add_toast
node_expense_list -->|"renders"| node_search_filter
node_expense_list -->|"renders"| node_list
node_search_filter -->|"sets filtered records"| node_expense_list
node_list -->|"edits or deletes"| node_expense_state
node_list -->|"renders"| node_editing_form
node_list -->|"renders"| node_no_expense
node_list -->|"renders"| node_delete_toast
node_list -->|"sets toast"| node_app_state
node_editing_form -->|"updates expense"| node_expense_state
node_navigation_bar -->|"reads theme"| node_app_state
node_expense_state -->|"reads and writes"| node_browser_storage

click node_app "https://github.com/samvesh-cs/spendwise/blob/main/src/App.jsx"
click node_home "https://github.com/samvesh-cs/spendwise/blob/main/src/pages/Home.jsx"
click node_overview "https://github.com/samvesh-cs/spendwise/blob/main/src/pages/Overview.jsx"
click node_add_page "https://github.com/samvesh-cs/spendwise/blob/main/src/pages/AddExpense.jsx"
click node_transactions "https://github.com/samvesh-cs/spendwise/blob/main/src/pages/Transactions.jsx"
click node_navigation_bar "https://github.com/samvesh-cs/spendwise/blob/main/src/components/NavigationBar.jsx"
click node_expense_form "https://github.com/samvesh-cs/spendwise/blob/main/src/components/ExpenseForm.jsx"
click node_editing_form "https://github.com/samvesh-cs/spendwise/blob/main/src/components/EditingForm.jsx"
click node_expense_list "https://github.com/samvesh-cs/spendwise/blob/main/src/components/ExpenseList.jsx"
click node_search_filter "https://github.com/samvesh-cs/spendwise/blob/main/src/components/SearchAndFilter.jsx"
click node_list "https://github.com/samvesh-cs/spendwise/blob/main/src/components/List.jsx"
click node_no_expense "https://github.com/samvesh-cs/spendwise/blob/main/src/components/NoExpense.jsx"
click node_summary_card "https://github.com/samvesh-cs/spendwise/blob/main/src/components/SummaryCard.jsx"
click node_add_toast "https://github.com/samvesh-cs/spendwise/blob/main/src/components/ToastExpense.jsx"
click node_delete_toast "https://github.com/samvesh-cs/spendwise/blob/main/src/components/ToastDelete.jsx"
click node_expense_state "https://github.com/samvesh-cs/spendwise/blob/main/src/context/ExpenseDataContext.jsx"
click node_app_state "https://github.com/samvesh-cs/spendwise/blob/main/src/context/OtherContext.jsx"

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_app,node_home,node_overview,node_add_page,node_transactions,node_navigation_bar,node_user toneBlue
class node_expense_form,node_editing_form,node_browser_storage toneAmber
class node_expense_list,node_search_filter,node_list,node_no_expense,node_summary_card,node_add_toast,node_delete_toast toneMint
class node_expense_state,node_app_state toneRose
```

## Components

### Navigation and pages

- [App router](https://github.com/samvesh-cs/spendwise/blob/main/src/App.jsx): `src/App.jsx`
- [Home page](https://github.com/samvesh-cs/spendwise/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Overview page](https://github.com/samvesh-cs/spendwise/blob/main/src/pages/Overview.jsx): `src/pages/Overview.jsx`
- [Add expense page](https://github.com/samvesh-cs/spendwise/blob/main/src/pages/AddExpense.jsx): `src/pages/AddExpense.jsx`
- [Transactions page](https://github.com/samvesh-cs/spendwise/blob/main/src/pages/Transactions.jsx): `src/pages/Transactions.jsx`
- [Navigation bar](https://github.com/samvesh-cs/spendwise/blob/main/src/components/NavigationBar.jsx): `src/components/NavigationBar.jsx`

### Expense workflow

- [Expense form](https://github.com/samvesh-cs/spendwise/blob/main/src/components/ExpenseForm.jsx): `src/components/ExpenseForm.jsx`
- [Editing form](https://github.com/samvesh-cs/spendwise/blob/main/src/components/EditingForm.jsx): `src/components/EditingForm.jsx`

### Expense presentation

- [Expense list](https://github.com/samvesh-cs/spendwise/blob/main/src/components/ExpenseList.jsx): `src/components/ExpenseList.jsx`
- [Search and filter](https://github.com/samvesh-cs/spendwise/blob/main/src/components/SearchAndFilter.jsx): `src/components/SearchAndFilter.jsx`
- [Expense rows](https://github.com/samvesh-cs/spendwise/blob/main/src/components/List.jsx): `src/components/List.jsx`
- [Empty state](https://github.com/samvesh-cs/spendwise/blob/main/src/components/NoExpense.jsx): `src/components/NoExpense.jsx`
- [Summary cards](https://github.com/samvesh-cs/spendwise/blob/main/src/components/SummaryCard.jsx): `src/components/SummaryCard.jsx`
- [Add toast](https://github.com/samvesh-cs/spendwise/blob/main/src/components/ToastExpense.jsx): `src/components/ToastExpense.jsx`
- [Delete toast](https://github.com/samvesh-cs/spendwise/blob/main/src/components/ToastDelete.jsx): `src/components/ToastDelete.jsx`

### Shared state

- [Expense state](https://github.com/samvesh-cs/spendwise/blob/main/src/context/ExpenseDataContext.jsx): `src/context/ExpenseDataContext.jsx`
- [Theme and toast state](https://github.com/samvesh-cs/spendwise/blob/main/src/context/OtherContext.jsx): `src/context/OtherContext.jsx`

### Other components

- **User**
- **Browser localStorage**

## Connections

- User → Home page: opens
- App router → Navigation bar: renders (evidence: `src/App.jsx`)
- App router → Home page: routes to (evidence: `src/App.jsx`)
- App router → Overview page: routes to (evidence: `src/App.jsx`)
- App router → Add expense page: routes to (evidence: `src/App.jsx`)
- App router → Transactions page: routes to (evidence: `src/App.jsx`)
- Home page → Overview page: links to (evidence: `src/pages/Home.jsx`)
- App router → Theme and toast state: reads theme (evidence: `src/App.jsx`)
- Add expense page → Expense form: renders (evidence: `src/pages/AddExpense.jsx`)
- Overview page → Expense form: renders (evidence: `src/pages/Overview.jsx`)
- Overview page → Expense list: renders (evidence: `src/pages/Overview.jsx`)
- Overview page → Summary cards: renders (evidence: `src/pages/Overview.jsx`)
- Transactions page → Expense list: renders (evidence: `src/pages/Transactions.jsx`)
- Expense form → Expense state: adds expense (evidence: `src/components/ExpenseForm.jsx`)
- Expense form → Theme and toast state: sets toast (evidence: `src/components/ExpenseForm.jsx`)
- Expense form → Add toast: renders (evidence: `src/components/ExpenseForm.jsx`)
- Expense list → Search and filter: renders (evidence: `src/components/ExpenseList.jsx`)
- Expense list → Expense rows: renders (evidence: `src/components/ExpenseList.jsx`)
- Search and filter → Expense list: sets filtered records (evidence: `src/components/ExpenseList.jsx`)
- Expense rows → Expense state: edits or deletes (evidence: `src/components/List.jsx`)
- Expense rows → Editing form: renders (evidence: `src/components/List.jsx`)
- Expense rows → Empty state: renders (evidence: `src/components/List.jsx`)
- Expense rows → Delete toast: renders (evidence: `src/components/List.jsx`)
- Expense rows → Theme and toast state: sets toast (evidence: `src/components/List.jsx`)
- Editing form → Expense state: updates expense (evidence: `src/components/EditingForm.jsx`)
- Navigation bar → Theme and toast state: reads theme (evidence: `src/components/NavigationBar.jsx`)
- Expense state → Browser localStorage: reads and writes (evidence: `src/context/ExpenseDataContext.jsx`)
