# jameskokoska/cashew architecture

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

- Interactive diagram: https://gitdiagram.com/jameskokoska/cashew
- Repository: https://github.com/jameskokoska/cashew

## Overview

Cashew is a cross-platform personal-finance app built with Flutter, Drift SQL, and Firebase. The main user workflow is to manage accounts and currencies, record and categorize transactions, organize spending into budgets and goals, then review results through summaries and graphs. The README also documents search and filtering, reminders, authentication, backup, and cross-device sync. Main application source was not sampled, so feature-level links below reflect README-documented behavior; the SQL WebAssembly files are included as indexed core modules, but their connection to app storage is unverified.

Main entry points: [`budget/lib/main.dart`](https://github.com/jameskokoska/cashew/blob/main/budget/lib/main.dart) (Cashew app), [`budget/lib/pages/addTransactionPage.dart`](https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/addTransactionPage.dart) (Transactions), [`budget/lib/pages/homePage/homePage.dart`](https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/homePage/homePage.dart) (Home dashboard), [`budget/lib/struct/syncClient.dart`](https://github.com/jameskokoska/cashew/blob/main/budget/lib/struct/syncClient.dart) (Cross-device sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_finance["Finance workflows"]
  node_transactions["Transactions"]
  node_transaction_search["Search and filters"]
  node_categories["Categories"]
  node_accounts["Accounts and wallets<br/>[accountsPage.dart]"]
  node_currencies["Currencies"]
  node_budgets["Budgets<br/>[addBudgetPage.dart]"]
  node_goals["Goals"]
end

subgraph group_insights["Financial insights"]
  node_dashboard["Home dashboard<br/>[homePage.dart]"]
  node_graphs["Spending graphs"]
end

subgraph group_platform["App platform"]
  node_app["Cashew app<br/>[main.dart]"]
  node_notifications["Reminders"]
  node_biometrics["Biometric lock"]
  node_authentication["Google login"]
end

subgraph group_storage["Data and sync"]
  node_database[("Local database<br/>[tables.dart]")]
  node_sync["Cross-device sync<br/>[syncClient.dart]"]
  node_drive["Google Drive"]
  node_sql_wasm["SQL WebAssembly<br/>[sql-wasm.js]"]
  node_sql_worker["SQL worker<br/>[worker.sql-wasm.js]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"manages"| node_transactions
node_app -->|"manages"| node_budgets
node_app -->|"manages"| node_accounts
node_app -->|"tracks"| node_goals
node_app -->|"searches"| node_transaction_search
node_transactions -->|"categorizes"| node_categories
node_app -->|"converts"| node_currencies
node_app -->|"presents"| node_dashboard
node_dashboard -->|"visualizes"| node_graphs
node_app -->|"reminds"| node_notifications
node_app -->|"secures"| node_biometrics
node_app -->|"authenticates"| node_authentication
node_app -->|"stores data"| node_database
node_app -->|"synchronizes"| node_sync
node_sync -->|"backs up"| node_drive
node_sql_worker -->|"executes SQL"| node_sql_wasm

click node_app "https://github.com/jameskokoska/cashew/blob/main/budget/lib/main.dart"
click node_transactions "https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/addTransactionPage.dart"
click node_transaction_search "https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/transactionsSearchPage.dart"
click node_categories "https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/addCategoryPage.dart"
click node_accounts "https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/accountsPage.dart"
click node_currencies "https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/exchangeRatesPage.dart"
click node_budgets "https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/addBudgetPage.dart"
click node_goals "https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/addObjectivePage.dart"
click node_dashboard "https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/homePage/homePage.dart"
click node_graphs "https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/homePage/homePageLineGraph.dart"
click node_notifications "https://github.com/jameskokoska/cashew/blob/main/budget/lib/struct/initializeNotifications.dart"
click node_biometrics "https://github.com/jameskokoska/cashew/blob/main/budget/lib/struct/initializeBiometrics.dart"
click node_authentication "https://github.com/jameskokoska/cashew/blob/main/budget/lib/struct/firebaseAuthGlobal.dart"
click node_database "https://github.com/jameskokoska/cashew/blob/main/budget/lib/database/tables.dart"
click node_sync "https://github.com/jameskokoska/cashew/blob/main/budget/lib/struct/syncClient.dart"
click node_sql_wasm "https://github.com/jameskokoska/cashew/blob/main/budget/web/sql-wasm.js"
click node_sql_worker "https://github.com/jameskokoska/cashew/blob/main/budget/web/worker.sql-wasm.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_transactions,node_transaction_search,node_categories,node_accounts,node_currencies,node_budgets,node_goals,node_user toneBlue
class node_dashboard,node_graphs toneAmber
class node_app,node_notifications,node_biometrics,node_authentication toneMint
class node_database,node_sync,node_drive,node_sql_wasm,node_sql_worker toneRose
```

## Components

### Finance workflows

- [Transactions](https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/addTransactionPage.dart): `budget/lib/pages/addTransactionPage.dart`
- [Search and filters](https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/transactionsSearchPage.dart): `budget/lib/pages/transactionsSearchPage.dart`
- [Categories](https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/addCategoryPage.dart): `budget/lib/pages/addCategoryPage.dart`
- [Accounts and wallets](https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/accountsPage.dart): `budget/lib/pages/accountsPage.dart`
- [Currencies](https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/exchangeRatesPage.dart): `budget/lib/pages/exchangeRatesPage.dart`
- [Budgets](https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/addBudgetPage.dart): `budget/lib/pages/addBudgetPage.dart`
- [Goals](https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/addObjectivePage.dart): `budget/lib/pages/addObjectivePage.dart`

### Financial insights

- [Home dashboard](https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/homePage/homePage.dart): `budget/lib/pages/homePage/homePage.dart`
- [Spending graphs](https://github.com/jameskokoska/cashew/blob/main/budget/lib/pages/homePage/homePageLineGraph.dart): `budget/lib/pages/homePage/homePageLineGraph.dart`

### App platform

- [Cashew app](https://github.com/jameskokoska/cashew/blob/main/budget/lib/main.dart): `budget/lib/main.dart`
- [Reminders](https://github.com/jameskokoska/cashew/blob/main/budget/lib/struct/initializeNotifications.dart): `budget/lib/struct/initializeNotifications.dart`
- [Biometric lock](https://github.com/jameskokoska/cashew/blob/main/budget/lib/struct/initializeBiometrics.dart): `budget/lib/struct/initializeBiometrics.dart`
- [Google login](https://github.com/jameskokoska/cashew/blob/main/budget/lib/struct/firebaseAuthGlobal.dart): `budget/lib/struct/firebaseAuthGlobal.dart`

### Data and sync

- [Local database](https://github.com/jameskokoska/cashew/blob/main/budget/lib/database/tables.dart): `budget/lib/database/tables.dart`
- [Cross-device sync](https://github.com/jameskokoska/cashew/blob/main/budget/lib/struct/syncClient.dart): `budget/lib/struct/syncClient.dart`
- **Google Drive**
- [SQL WebAssembly](https://github.com/jameskokoska/cashew/blob/main/budget/web/sql-wasm.js): `budget/web/sql-wasm.js`
- [SQL worker](https://github.com/jameskokoska/cashew/blob/main/budget/web/worker.sql-wasm.js): `budget/web/worker.sql-wasm.js`

### Other components

- **User**

## Connections

- User → Cashew app: uses (evidence: `README.md`)
- Cashew app → Transactions: manages (evidence: `README.md`)
- Cashew app → Budgets: manages (evidence: `README.md`)
- Cashew app → Accounts and wallets: manages (evidence: `README.md`)
- Cashew app → Goals: tracks (evidence: `README.md`)
- Cashew app → Search and filters: searches (evidence: `README.md`)
- Transactions → Categories: categorizes (evidence: `README.md`)
- Cashew app → Currencies: converts (evidence: `README.md`)
- Cashew app → Home dashboard: presents (evidence: `README.md`)
- Home dashboard → Spending graphs: visualizes (evidence: `README.md`)
- Cashew app → Reminders: reminds (evidence: `README.md`)
- Cashew app → Biometric lock: secures (evidence: `README.md`)
- Cashew app → Google login: authenticates (evidence: `README.md`)
- Cashew app → Local database: stores data (evidence: `README.md`)
- Cashew app → Cross-device sync: synchronizes (evidence: `README.md`)
- Cross-device sync → Google Drive: backs up (evidence: `README.md`)
- SQL worker → SQL WebAssembly: executes SQL (evidence: `budget/web/worker.sql-wasm.js`)
