# thudao612/cashew architecture

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

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

## Overview

Cashew is a cross-platform personal-finance app. The main workflow is to record and organize transactions, apply them to budgets or goals, then review spending and account summaries. Local Drift storage underpins financial records; documented branches include currency conversion, sync and backup, reminders, and CSV import/export. The README documents capabilities, but sampled implementation is limited, so several internal call relationships cannot be verified and are not shown.

Main entry points: [`budget/lib/database/tables.dart`](https://github.com/thudao612/cashew/blob/main/budget/lib/database/tables.dart) (Drift database), [`budget/lib/main.dart`](https://github.com/thudao612/cashew/blob/main/budget/lib/main.dart) (App shell), [`budget/lib/pages/addTransactionPage.dart`](https://github.com/thudao612/cashew/blob/main/budget/lib/pages/addTransactionPage.dart) (Transactions), [`budget/lib/pages/accountsPage.dart`](https://github.com/thudao612/cashew/blob/main/budget/lib/pages/accountsPage.dart) (Accounts and wallets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_finance["Finance workflows"]
  node_transactions["Transactions"]
  node_transaction_lists["Search and history"]
  node_budgets["Budgets<br/>[addBudgetPage.dart]"]
  node_goals["Goals"]
end

subgraph group_insights["Insights and accounts"]
  node_accounts["Accounts and wallets<br/>[accountsPage.dart]"]
  node_dashboard["Dashboard insights<br/>[homePage.dart]"]
  node_currency["Currency conversion"]
end

subgraph group_platform["Storage and platform"]
  node_app["App shell<br/>[main.dart]"]
  node_drift[("Drift database<br/>[tables.dart]")]
  node_database_global["Database access"]
  node_csv_import["CSV import<br/>[importCSV.dart]"]
  node_csv_export["CSV export<br/>[exportCSV.dart]"]
end

subgraph group_connectivity["Sync and integrations"]
  node_sync["Sync client<br/>[syncClient.dart]"]
  node_auth["Firebase authentication"]
  node_backup["Backup controls"]
  node_notifications["Notifications"]
end

node_user(("User"))
node_cloud[("Firebase services")]
node_drive[("Google Drive")]

node_user -->|"opens"| node_app
node_app -->|"shows finance UI"| node_transactions
node_app -->|"shows summaries"| node_dashboard
node_transactions -->|"stores records"| node_drift
node_transaction_lists -->|"reads records"| node_drift
node_budgets -->|"stores budgets"| node_drift
node_goals -->|"stores goals"| node_drift
node_accounts -->|"reads accounts"| node_drift
node_dashboard -->|"reads financial data"| node_drift
node_currency -->|"supports conversion"| node_accounts
node_csv_import -->|"imports records"| node_drift
node_csv_export -->|"exports records"| node_drift
node_sync -.->|"syncs data"| node_cloud
node_auth -.->|"authenticates"| node_cloud
node_backup -.->|"backs up data"| node_drive
node_notifications -.->|"sends reminders"| node_user

click node_app "https://github.com/thudao612/cashew/blob/main/budget/lib/main.dart"
click node_transactions "https://github.com/thudao612/cashew/blob/main/budget/lib/pages/addTransactionPage.dart"
click node_transaction_lists "https://github.com/thudao612/cashew/blob/main/budget/lib/pages/transactionsListPage.dart"
click node_budgets "https://github.com/thudao612/cashew/blob/main/budget/lib/pages/addBudgetPage.dart"
click node_goals "https://github.com/thudao612/cashew/blob/main/budget/lib/pages/addObjectivePage.dart"
click node_accounts "https://github.com/thudao612/cashew/blob/main/budget/lib/pages/accountsPage.dart"
click node_dashboard "https://github.com/thudao612/cashew/blob/main/budget/lib/pages/homePage/homePage.dart"
click node_currency "https://github.com/thudao612/cashew/blob/main/budget/lib/struct/currencyFunctions.dart"
click node_drift "https://github.com/thudao612/cashew/blob/main/budget/lib/database/tables.dart"
click node_database_global "https://github.com/thudao612/cashew/blob/main/budget/lib/struct/databaseGlobal.dart"
click node_csv_import "https://github.com/thudao612/cashew/blob/main/budget/lib/widgets/importCSV.dart"
click node_csv_export "https://github.com/thudao612/cashew/blob/main/budget/lib/widgets/exportCSV.dart"
click node_sync "https://github.com/thudao612/cashew/blob/main/budget/lib/struct/syncClient.dart"
click node_auth "https://github.com/thudao612/cashew/blob/main/budget/lib/struct/firebaseAuthGlobal.dart"
click node_backup "https://github.com/thudao612/cashew/blob/main/budget/lib/widgets/accountAndBackup.dart"
click node_notifications "https://github.com/thudao612/cashew/blob/main/budget/lib/struct/initializeNotifications.dart"

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_lists,node_budgets,node_goals,node_user toneBlue
class node_accounts,node_dashboard,node_currency,node_cloud,node_drive toneAmber
class node_app,node_drift,node_database_global,node_csv_import,node_csv_export toneMint
class node_sync,node_auth,node_backup,node_notifications toneRose
```

## Components

### Finance workflows

- [Transactions](https://github.com/thudao612/cashew/blob/main/budget/lib/pages/addTransactionPage.dart): `budget/lib/pages/addTransactionPage.dart`
- [Search and history](https://github.com/thudao612/cashew/blob/main/budget/lib/pages/transactionsListPage.dart): `budget/lib/pages/transactionsListPage.dart`
- [Budgets](https://github.com/thudao612/cashew/blob/main/budget/lib/pages/addBudgetPage.dart): `budget/lib/pages/addBudgetPage.dart`
- [Goals](https://github.com/thudao612/cashew/blob/main/budget/lib/pages/addObjectivePage.dart): `budget/lib/pages/addObjectivePage.dart`

### Insights and accounts

- [Accounts and wallets](https://github.com/thudao612/cashew/blob/main/budget/lib/pages/accountsPage.dart): `budget/lib/pages/accountsPage.dart`
- [Dashboard insights](https://github.com/thudao612/cashew/blob/main/budget/lib/pages/homePage/homePage.dart): `budget/lib/pages/homePage/homePage.dart`
- [Currency conversion](https://github.com/thudao612/cashew/blob/main/budget/lib/struct/currencyFunctions.dart): `budget/lib/struct/currencyFunctions.dart`

### Storage and platform

- [App shell](https://github.com/thudao612/cashew/blob/main/budget/lib/main.dart): `budget/lib/main.dart`
- [Drift database](https://github.com/thudao612/cashew/blob/main/budget/lib/database/tables.dart): `budget/lib/database/tables.dart`
- [Database access](https://github.com/thudao612/cashew/blob/main/budget/lib/struct/databaseGlobal.dart): `budget/lib/struct/databaseGlobal.dart`
- [CSV import](https://github.com/thudao612/cashew/blob/main/budget/lib/widgets/importCSV.dart): `budget/lib/widgets/importCSV.dart`
- [CSV export](https://github.com/thudao612/cashew/blob/main/budget/lib/widgets/exportCSV.dart): `budget/lib/widgets/exportCSV.dart`

### Sync and integrations

- [Sync client](https://github.com/thudao612/cashew/blob/main/budget/lib/struct/syncClient.dart): `budget/lib/struct/syncClient.dart`
- [Firebase authentication](https://github.com/thudao612/cashew/blob/main/budget/lib/struct/firebaseAuthGlobal.dart): `budget/lib/struct/firebaseAuthGlobal.dart`
- [Backup controls](https://github.com/thudao612/cashew/blob/main/budget/lib/widgets/accountAndBackup.dart): `budget/lib/widgets/accountAndBackup.dart`
- [Notifications](https://github.com/thudao612/cashew/blob/main/budget/lib/struct/initializeNotifications.dart): `budget/lib/struct/initializeNotifications.dart`

### Other components

- **User**
- **Firebase services**
- **Google Drive**

## Connections

- User → App shell: opens
- App shell → Transactions: shows finance UI
- App shell → Dashboard insights: shows summaries
- Transactions → Drift database: stores records
- Search and history → Drift database: reads records
- Budgets → Drift database: stores budgets
- Goals → Drift database: stores goals
- Accounts and wallets → Drift database: reads accounts
- Dashboard insights → Drift database: reads financial data
- Currency conversion → Accounts and wallets: supports conversion
- CSV import → Drift database: imports records
- CSV export → Drift database: exports records
- Sync client → Firebase services: syncs data
- Firebase authentication → Firebase services: authenticates
- Backup controls → Google Drive: backs up data
- Notifications → User: sends reminders
