# dinhan125/cashew_group8_mobile architecture

> Architecture diagram of the GitHub repository dinhan125/cashew_group8_mobile, 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/dinhan125/cashew_group8_mobile
- Repository: https://github.com/dinhan125/cashew_group8_mobile

## Overview

Cashew is a cross-platform Flutter personal-finance app. Users organize accounts and currencies, record and find transactions, and review budgets, goals, and spending insights; the app persists finance data locally and offers sync, backup, reminders, and automation. The tree and README support these capability-level relationships, but the supplied source excerpts are platform boilerplate and a web SQLite engine, not the Dart application logic. Consequently, links between individual screens and services are shown only where README-described workflows support them.

Main entry points: [`budget/lib/database/tables.dart`](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/database/tables.dart) (Local finance database), [`budget/lib/main.dart`](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/main.dart) (App entry), [`budget/lib/pages/accountsPage.dart`](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/pages/accountsPage.dart) (Accounts), [`budget/lib/struct/syncClient.dart`](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/struct/syncClient.dart) (Cross-device sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app_entry["App entry<br/>[main.dart]"]
  node_home["Home dashboard<br/>[homePage.dart]"]
  node_settings["Settings<br/>[settingsPage.dart]"]
end

subgraph group_finance["Finance workflows"]
  node_transactions["Transactions"]
  node_transaction_search["Search and filters"]
  node_accounts["Accounts<br/>[accountsPage.dart]"]
  node_budgets["Budgets<br/>[budgetPage.dart]"]
  node_objectives["Goals<br/>[objectivePage.dart]"]
  node_insights["Spending insights"]
  node_currency["Currency conversion"]
end

subgraph group_storage["Data and sync"]
  node_local_db[("Local finance database<br/>[tables.dart]")]
  node_db_init["Database setup"]
  node_sync["Cross-device sync<br/>[syncClient.dart]"]
  node_backup["Import and backup<br/>[exportDB.dart]"]
  node_csv["CSV transfer<br/>[importCSV.dart]"]
end

subgraph group_services["Platform services"]
  node_auth["Google login"]
  node_firebase{{"Firebase"}}
  node_drive{{"Google Drive"}}
  node_notifications["Reminders"]
  node_exchange["Exchange rates"]
end

node_user(("User"))

node_user -->|"opens"| node_app_entry
node_app_entry -->|"initializes"| node_db_init
node_db_init -->|"creates or opens"| node_local_db
node_app_entry -->|"shows"| node_home
node_user -->|"records"| node_transactions
node_transactions -->|"writes transactions"| node_local_db
node_user -->|"searches"| node_transaction_search
node_transaction_search -->|"queries transactions"| node_local_db
node_user -->|"manages"| node_accounts
node_accounts -->|"stores account data"| node_local_db
node_user -->|"plans spending"| node_budgets
node_budgets -->|"stores budgets"| node_local_db
node_user -->|"sets goals"| node_objectives
node_objectives -->|"stores goals"| node_local_db
node_home -->|"presents summaries"| node_insights
node_insights -->|"reads finance data"| node_local_db
node_accounts -->|"selects currency"| node_currency
node_currency -->|"uses rates"| node_exchange
node_user -->|"configures"| node_settings
node_sync -->|"synchronizes data"| node_local_db
node_sync -.->|"syncs across devices"| node_firebase
node_auth -.->|"authenticates with"| node_firebase
node_user -->|"backs up or restores"| node_backup
node_backup -.->|"backs up data"| node_drive
node_user -->|"imports records"| node_csv
node_csv -->|"imports transactions"| node_local_db
node_notifications -->|"sends reminders"| node_user

click node_app_entry "https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/main.dart"
click node_home "https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/pages/homePage/homePage.dart"
click node_settings "https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/pages/settingsPage.dart"
click node_transactions "https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/pages/addTransactionPage.dart"
click node_transaction_search "https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/pages/transactionsSearchPage.dart"
click node_accounts "https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/pages/accountsPage.dart"
click node_budgets "https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/pages/budgetPage.dart"
click node_objectives "https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/pages/objectivePage.dart"
click node_insights "https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/pages/homePage/homePageAllSpendingSummary.dart"
click node_currency "https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/struct/currencyFunctions.dart"
click node_local_db "https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/database/tables.dart"
click node_db_init "https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/database/initializeDefaultDatabase.dart"
click node_sync "https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/struct/syncClient.dart"
click node_backup "https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/widgets/exportDB.dart"
click node_csv "https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/widgets/importCSV.dart"
click node_auth "https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/struct/firebaseAuthGlobal.dart"
click node_notifications "https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/struct/initializeNotifications.dart"
click node_exchange "https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/pages/exchangeRatesPage.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_app_entry,node_home,node_settings,node_user toneBlue
class node_transactions,node_transaction_search,node_accounts,node_budgets,node_objectives,node_insights,node_currency toneAmber
class node_local_db,node_db_init,node_sync,node_backup,node_csv toneMint
class node_auth,node_firebase,node_drive,node_notifications,node_exchange toneRose
```

## Components

### Application shell

- [App entry](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/main.dart): `budget/lib/main.dart`
- [Home dashboard](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/pages/homePage/homePage.dart): `budget/lib/pages/homePage/homePage.dart`
- [Settings](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/pages/settingsPage.dart): `budget/lib/pages/settingsPage.dart`

### Finance workflows

- [Transactions](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/pages/addTransactionPage.dart): `budget/lib/pages/addTransactionPage.dart`
- [Search and filters](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/pages/transactionsSearchPage.dart): `budget/lib/pages/transactionsSearchPage.dart`
- [Accounts](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/pages/accountsPage.dart): `budget/lib/pages/accountsPage.dart`
- [Budgets](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/pages/budgetPage.dart): `budget/lib/pages/budgetPage.dart`
- [Goals](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/pages/objectivePage.dart): `budget/lib/pages/objectivePage.dart`
- [Spending insights](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/pages/homePage/homePageAllSpendingSummary.dart): `budget/lib/pages/homePage/homePageAllSpendingSummary.dart`
- [Currency conversion](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/struct/currencyFunctions.dart): `budget/lib/struct/currencyFunctions.dart`

### Data and sync

- [Local finance database](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/database/tables.dart): `budget/lib/database/tables.dart`
- [Database setup](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/database/initializeDefaultDatabase.dart): `budget/lib/database/initializeDefaultDatabase.dart`
- [Cross-device sync](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/struct/syncClient.dart): `budget/lib/struct/syncClient.dart`
- [Import and backup](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/widgets/exportDB.dart): `budget/lib/widgets/exportDB.dart`
- [CSV transfer](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/widgets/importCSV.dart): `budget/lib/widgets/importCSV.dart`

### Platform services

- [Google login](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/struct/firebaseAuthGlobal.dart): `budget/lib/struct/firebaseAuthGlobal.dart`
- **Firebase**
- **Google Drive**
- [Reminders](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/struct/initializeNotifications.dart): `budget/lib/struct/initializeNotifications.dart`
- [Exchange rates](https://github.com/dinhan125/cashew_group8_mobile/blob/main/budget/lib/pages/exchangeRatesPage.dart): `budget/lib/pages/exchangeRatesPage.dart`

### Other components

- **User**

## Connections

- User → App entry: opens
- App entry → Database setup: initializes
- Database setup → Local finance database: creates or opens
- App entry → Home dashboard: shows
- User → Transactions: records
- Transactions → Local finance database: writes transactions
- User → Search and filters: searches
- Search and filters → Local finance database: queries transactions
- User → Accounts: manages
- Accounts → Local finance database: stores account data
- User → Budgets: plans spending
- Budgets → Local finance database: stores budgets
- User → Goals: sets goals
- Goals → Local finance database: stores goals
- Home dashboard → Spending insights: presents summaries
- Spending insights → Local finance database: reads finance data
- Accounts → Currency conversion: selects currency
- Currency conversion → Exchange rates: uses rates
- User → Settings: configures
- Cross-device sync → Local finance database: synchronizes data
- Cross-device sync → Firebase: syncs across devices
- Google login → Firebase: authenticates with
- User → Import and backup: backs up or restores
- Import and backup → Google Drive: backs up data
- User → CSV transfer: imports records
- CSV transfer → Local finance database: imports transactions
- Reminders → User: sends reminders
