# vyavahareyash/cashflow architecture

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

## Overview

Cashflow is an offline-first personal finance app: users record income, spending, and transfers, then review physical balances, goal reserves, budgets, and safe-to-spend money. A second major path captures spoken transactions, parses them locally, stages drafts for review, and commits approved entries. The README also documents analytics, payday-cycle budgets, privacy controls, and portable backups. Relationships follow documented workflows and the source tree; Dart implementation details were not sampled, so uncertain wiring is omitted.

Main entry points: [`lib/services/database_helper.dart`](https://github.com/vyavahareyash/cashflow/blob/main/lib/services/database_helper.dart) (SQLite data), [`lib/services/voice_pipeline_coordinator.dart`](https://github.com/vyavahareyash/cashflow/blob/main/lib/services/voice_pipeline_coordinator.dart) (Voice coordinator), [`lib/screens/backup_restore_screen.dart`](https://github.com/vyavahareyash/cashflow/blob/main/lib/screens/backup_restore_screen.dart) (Backup and restore), [`lib/main.dart`](https://github.com/vyavahareyash/cashflow/blob/main/lib/main.dart) (App entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_entry["App entry<br/>[main.dart]"]
  node_dashboard["Safe-to-spend"]
end

subgraph group_finance["Finance workflows"]
  node_budget["Budgets<br/>[budget_screen.dart]"]
  node_accounts["Accounts"]
  node_goals["Savings goals<br/>[goals_screen.dart]"]
  node_history["Transaction history"]
  node_analytics["Analytics"]
end

subgraph group_voice["Voice journaling"]
  node_voice_ui["Voice capture and review"]
  node_staging["Draft review"]
  node_coordinator["Voice coordinator"]
  node_audio["Audio pipeline"]
  node_speech["On-device speech"]
  node_inference["Local inference"]
  node_parser["Entity parser"]
end

subgraph group_data["Local data and privacy"]
  node_backup["Backup and restore"]
  node_codec["Backup codec<br/>[backup_codec.dart]"]
  node_database[("SQLite data")]
  node_platform_db["Platform database"]
  node_security["Platform security"]
end

node_user(("User"))

node_user -->|"opens"| node_entry
node_user -->|"views balance"| node_dashboard
node_user -->|"tracks spending"| node_budget
node_user -->|"manages accounts"| node_accounts
node_user -->|"sets goals"| node_goals
node_user -->|"reviews ledger"| node_history
node_user -->|"explores trends"| node_analytics
node_user -->|"dictates entries"| node_voice_ui
node_user -->|"manages backup"| node_backup
node_voice_ui -->|"starts capture"| node_coordinator
node_coordinator -->|"processes audio"| node_audio
node_audio -->|"transcribes on-device"| node_speech
node_coordinator -->|"extracts transactions"| node_inference
node_coordinator -->|"parses entities"| node_parser
node_coordinator -->|"presents drafts"| node_staging
node_staging -->|"commits approved entries"| node_database
node_backup -->|"encodes or decodes"| node_codec
node_backup -->|"imports or exports"| node_database
node_database -->|"uses platform storage"| node_platform_db
node_dashboard -->|"reads balances"| node_database
node_budget -->|"reads budget activity"| node_database
node_accounts -->|"stores account changes"| node_database
node_goals -->|"stores goal allocations"| node_database
node_history -->|"reads transactions"| node_database
node_analytics -->|"reads trends"| node_database
node_entry -->|"uses device security"| node_security

click node_entry "https://github.com/vyavahareyash/cashflow/blob/main/lib/main.dart"
click node_dashboard "https://github.com/vyavahareyash/cashflow/blob/main/lib/screens/dashboard_screen.dart"
click node_budget "https://github.com/vyavahareyash/cashflow/blob/main/lib/screens/budget_screen.dart"
click node_accounts "https://github.com/vyavahareyash/cashflow/blob/main/lib/screens/accounts_screen.dart"
click node_goals "https://github.com/vyavahareyash/cashflow/blob/main/lib/screens/goals_screen.dart"
click node_history "https://github.com/vyavahareyash/cashflow/blob/main/lib/screens/history_screen.dart"
click node_analytics "https://github.com/vyavahareyash/cashflow/blob/main/lib/screens/analytics_screen.dart"
click node_voice_ui "https://github.com/vyavahareyash/cashflow/blob/main/lib/components/voice_recording_modal.dart"
click node_staging "https://github.com/vyavahareyash/cashflow/blob/main/lib/components/voice_transaction_staging_sheet.dart"
click node_coordinator "https://github.com/vyavahareyash/cashflow/blob/main/lib/services/voice_pipeline_coordinator.dart"
click node_audio "https://github.com/vyavahareyash/cashflow/blob/main/lib/services/voice_audio_pipeline.dart"
click node_speech "https://github.com/vyavahareyash/cashflow/blob/main/lib/services/speech_to_text_service.dart"
click node_inference "https://github.com/vyavahareyash/cashflow/blob/main/lib/services/slm_inference_service.dart"
click node_parser "https://github.com/vyavahareyash/cashflow/blob/main/lib/services/voice_entity_parser.dart"
click node_backup "https://github.com/vyavahareyash/cashflow/blob/main/lib/screens/backup_restore_screen.dart"
click node_codec "https://github.com/vyavahareyash/cashflow/blob/main/lib/services/backup_codec.dart"
click node_database "https://github.com/vyavahareyash/cashflow/blob/main/lib/services/database_helper.dart"
click node_platform_db "https://github.com/vyavahareyash/cashflow/blob/main/lib/services/platform_database.dart"
click node_security "https://github.com/vyavahareyash/cashflow/blob/main/lib/services/platform_security_service.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_entry,node_dashboard,node_user toneBlue
class node_budget,node_accounts,node_goals,node_history,node_analytics toneAmber
class node_voice_ui,node_staging,node_coordinator,node_audio,node_speech,node_inference,node_parser toneMint
class node_backup,node_codec,node_database,node_platform_db,node_security toneRose
```

## Components

### App experience

- [App entry](https://github.com/vyavahareyash/cashflow/blob/main/lib/main.dart): `lib/main.dart`
- [Safe-to-spend](https://github.com/vyavahareyash/cashflow/blob/main/lib/screens/dashboard_screen.dart): `lib/screens/dashboard_screen.dart`

### Finance workflows

- [Budgets](https://github.com/vyavahareyash/cashflow/blob/main/lib/screens/budget_screen.dart): `lib/screens/budget_screen.dart`
- [Accounts](https://github.com/vyavahareyash/cashflow/blob/main/lib/screens/accounts_screen.dart): `lib/screens/accounts_screen.dart`
- [Savings goals](https://github.com/vyavahareyash/cashflow/blob/main/lib/screens/goals_screen.dart): `lib/screens/goals_screen.dart`
- [Transaction history](https://github.com/vyavahareyash/cashflow/blob/main/lib/screens/history_screen.dart): `lib/screens/history_screen.dart`
- [Analytics](https://github.com/vyavahareyash/cashflow/blob/main/lib/screens/analytics_screen.dart): `lib/screens/analytics_screen.dart`

### Voice journaling

- [Voice capture and review](https://github.com/vyavahareyash/cashflow/blob/main/lib/components/voice_recording_modal.dart): `lib/components/voice_recording_modal.dart`
- [Draft review](https://github.com/vyavahareyash/cashflow/blob/main/lib/components/voice_transaction_staging_sheet.dart): `lib/components/voice_transaction_staging_sheet.dart`
- [Voice coordinator](https://github.com/vyavahareyash/cashflow/blob/main/lib/services/voice_pipeline_coordinator.dart): `lib/services/voice_pipeline_coordinator.dart`
- [Audio pipeline](https://github.com/vyavahareyash/cashflow/blob/main/lib/services/voice_audio_pipeline.dart): `lib/services/voice_audio_pipeline.dart`
- [On-device speech](https://github.com/vyavahareyash/cashflow/blob/main/lib/services/speech_to_text_service.dart): `lib/services/speech_to_text_service.dart`
- [Local inference](https://github.com/vyavahareyash/cashflow/blob/main/lib/services/slm_inference_service.dart): `lib/services/slm_inference_service.dart`
- [Entity parser](https://github.com/vyavahareyash/cashflow/blob/main/lib/services/voice_entity_parser.dart): `lib/services/voice_entity_parser.dart`

### Local data and privacy

- [Backup and restore](https://github.com/vyavahareyash/cashflow/blob/main/lib/screens/backup_restore_screen.dart): `lib/screens/backup_restore_screen.dart`
- [Backup codec](https://github.com/vyavahareyash/cashflow/blob/main/lib/services/backup_codec.dart): `lib/services/backup_codec.dart`
- [SQLite data](https://github.com/vyavahareyash/cashflow/blob/main/lib/services/database_helper.dart): `lib/services/database_helper.dart`
- [Platform database](https://github.com/vyavahareyash/cashflow/blob/main/lib/services/platform_database.dart): `lib/services/platform_database.dart`
- [Platform security](https://github.com/vyavahareyash/cashflow/blob/main/lib/services/platform_security_service.dart): `lib/services/platform_security_service.dart`

### Other components

- **User**

## Connections

- User → App entry: opens
- User → Safe-to-spend: views balance
- User → Budgets: tracks spending
- User → Accounts: manages accounts
- User → Savings goals: sets goals
- User → Transaction history: reviews ledger
- User → Analytics: explores trends
- User → Voice capture and review: dictates entries
- User → Backup and restore: manages backup
- Voice capture and review → Voice coordinator: starts capture
- Voice coordinator → Audio pipeline: processes audio
- Audio pipeline → On-device speech: transcribes on-device
- Voice coordinator → Local inference: extracts transactions
- Voice coordinator → Entity parser: parses entities
- Voice coordinator → Draft review: presents drafts
- Draft review → SQLite data: commits approved entries
- Backup and restore → Backup codec: encodes or decodes
- Backup and restore → SQLite data: imports or exports
- SQLite data → Platform database: uses platform storage
- Safe-to-spend → SQLite data: reads balances
- Budgets → SQLite data: reads budget activity
- Accounts → SQLite data: stores account changes
- Savings goals → SQLite data: stores goal allocations
- Transaction history → SQLite data: reads transactions
- Analytics → SQLite data: reads trends
- App entry → Platform security: uses device security
