# thangtranitwork/multi-wallet-management architecture

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

- Interactive diagram: https://gitdiagram.com/thangtranitwork/multi-wallet-management
- Repository: https://github.com/thangtranitwork/multi-wallet-management

## Overview

MultiWallet is an offline-first personal-finance mobile app for tracking wallets, transactions, debts, planned payments, and financial health. The main workflow is users navigating to a finance screen, recording or managing activity through shared wallet state, and persisting it in local SQLite; analytics and the home-screen widget surface derived results. The README documents installment repayment, category management, reminders, and analytics as distinct capabilities. Optional AI and cloud-backup integrations are shown separately. Some screens and service internals were not sampled, so uncertain call links are omitted.

Main entry points: [`src/context/WalletContext.tsx`](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/context/WalletContext.tsx) (Wallet state), [`src/navigation/RootNavigator.tsx`](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/navigation/RootNavigator.tsx) (Root navigation), [`App.tsx`](https://github.com/thangtranitwork/multi-wallet-management/blob/main/App.tsx) (App root), [`src/context/SecurityContext.tsx`](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/context/SecurityContext.tsx) (App security)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App navigation"]
  node_app["App root<br/>[App.tsx]"]
  node_navigation["Root navigation<br/>[RootNavigator.tsx]"]
  node_wallet_context["Wallet state<br/>[WalletContext.tsx]"]
  node_security["App security"]
end

subgraph group_finance["Finance workflows"]
  node_dashboard["Dashboard"]
  node_transactions["Transactions"]
  node_wallets["Wallet management<br/>[WalletsScreen.tsx]"]
  node_debts["Debt tracking<br/>[DebtsScreen.tsx]"]
  node_planned["Planned payments"]
  node_categories["Category management"]
end

subgraph group_insights["Insights and reminders"]
  node_analytics["Financial analytics"]
  node_prediction["Habit prediction"]
  node_reminders["Habit reminders"]
end

subgraph group_platform["Device and integrations"]
  node_widget["Home widget<br/>[WalletWidget.tsx]"]
  node_widget_handler["Widget actions"]
  node_widget_sync["Widget sync"]
  node_ai["Receipt scanning<br/>[geminiService.ts]"]
  node_copilot["Financial copilot"]
  node_drive["Google Drive backup"]
  node_backup_config["Backup settings"]
  node_notification_service["Local notifications"]
end

subgraph group_persistence["Local data"]
  node_queries["Database queries<br/>[queries.ts]"]
  node_database[("SQLite database<br/>[db.ts]")]
end

node_user(("Mobile user"))
node_gemini["Gemini API"]
node_google_drive["Google Drive"]

node_user -->|"opens"| node_app
node_app -->|"mounts"| node_navigation
node_navigation -->|"routes"| node_dashboard
node_navigation -->|"routes"| node_transactions
node_navigation -->|"routes"| node_wallets
node_navigation -->|"routes"| node_debts
node_navigation -->|"routes"| node_analytics
node_dashboard -->|"reads state"| node_wallet_context
node_transactions -->|"records activity"| node_wallet_context
node_wallets -->|"manages wallets"| node_wallet_context
node_debts -->|"manages debts"| node_wallet_context
node_planned -->|"executes plans"| node_wallet_context
node_categories -->|"manages categories"| node_wallet_context
node_analytics -->|"reads summaries"| node_wallet_context
node_wallet_context -->|"queries and updates"| node_queries
node_queries -->|"reads and writes"| node_database
node_app -->|"provides security"| node_security
node_security -->|"loads settings"| node_database
node_security -->|"syncs lock state"| node_widget_sync
node_wallet_context -->|"syncs balances"| node_widget_sync
node_widget_handler -->|"loads and saves"| node_widget_sync
node_widget_handler -->|"renders"| node_widget
node_wallet_context -->|"uses transaction history"| node_prediction
node_reminders -->|"detects habits"| node_prediction
node_reminders -->|"schedules"| node_notification_service
node_wallet_context -.->|"scans receipts"| node_ai
node_ai -.->|"requests extraction"| node_gemini
node_wallet_context -.->|"requests assistance"| node_copilot
node_wallet_context -.->|"loads backup settings"| node_backup_config
node_wallet_context -.->|"uploads backup"| node_drive
node_backup_config -.->|"stores settings"| node_queries
node_drive -.->|"transfers backup"| node_google_drive

click node_app "https://github.com/thangtranitwork/multi-wallet-management/blob/main/App.tsx"
click node_navigation "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/navigation/RootNavigator.tsx"
click node_wallet_context "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/context/WalletContext.tsx"
click node_security "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/context/SecurityContext.tsx"
click node_dashboard "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/screens/DashboardScreen.tsx"
click node_transactions "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/screens/TransactionsScreen.tsx"
click node_wallets "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/screens/WalletsScreen.tsx"
click node_debts "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/screens/DebtsScreen.tsx"
click node_planned "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/components/PlannedExpensesModal.tsx"
click node_categories "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/components/CategoryManagementModal.tsx"
click node_analytics "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/screens/AnalyticsScreen.tsx"
click node_prediction "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/services/predictionService.ts"
click node_reminders "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/services/habitNotificationService.ts"
click node_widget "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/widgets/WalletWidget.tsx"
click node_widget_handler "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/widgets/widgetTaskHandler.tsx"
click node_widget_sync "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/services/widgetSyncService.ts"
click node_ai "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/services/geminiService.ts"
click node_copilot "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/services/aiCopilotService.ts"
click node_drive "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/services/googleDriveService.ts"
click node_backup_config "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/services/cloudBackupStorage.ts"
click node_queries "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/database/queries.ts"
click node_database "https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/database/db.ts"

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_navigation,node_wallet_context,node_security,node_user toneBlue
class node_dashboard,node_transactions,node_wallets,node_debts,node_planned,node_categories toneAmber
class node_analytics,node_prediction,node_reminders,node_gemini toneMint
class node_widget,node_widget_handler,node_widget_sync,node_ai,node_copilot,node_drive,node_backup_config,node_notification_service toneRose
class node_queries,node_database,node_google_drive toneIndigo
```

## Components

### App navigation

- [App root](https://github.com/thangtranitwork/multi-wallet-management/blob/main/App.tsx): `App.tsx`
- [Root navigation](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/navigation/RootNavigator.tsx): `src/navigation/RootNavigator.tsx`
- [Wallet state](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/context/WalletContext.tsx): `src/context/WalletContext.tsx`
- [App security](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/context/SecurityContext.tsx): `src/context/SecurityContext.tsx`

### Finance workflows

- [Dashboard](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/screens/DashboardScreen.tsx): `src/screens/DashboardScreen.tsx`
- [Transactions](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/screens/TransactionsScreen.tsx): `src/screens/TransactionsScreen.tsx`
- [Wallet management](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/screens/WalletsScreen.tsx): `src/screens/WalletsScreen.tsx`
- [Debt tracking](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/screens/DebtsScreen.tsx): `src/screens/DebtsScreen.tsx`
- [Planned payments](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/components/PlannedExpensesModal.tsx): `src/components/PlannedExpensesModal.tsx`
- [Category management](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/components/CategoryManagementModal.tsx): `src/components/CategoryManagementModal.tsx`

### Insights and reminders

- [Financial analytics](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/screens/AnalyticsScreen.tsx): `src/screens/AnalyticsScreen.tsx`
- [Habit prediction](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/services/predictionService.ts): `src/services/predictionService.ts`
- [Habit reminders](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/services/habitNotificationService.ts): `src/services/habitNotificationService.ts`

### Device and integrations

- [Home widget](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/widgets/WalletWidget.tsx): `src/widgets/WalletWidget.tsx`
- [Widget actions](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/widgets/widgetTaskHandler.tsx): `src/widgets/widgetTaskHandler.tsx`
- [Widget sync](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/services/widgetSyncService.ts): `src/services/widgetSyncService.ts`
- [Receipt scanning](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/services/geminiService.ts): `src/services/geminiService.ts`
- [Financial copilot](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/services/aiCopilotService.ts): `src/services/aiCopilotService.ts`
- [Google Drive backup](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/services/googleDriveService.ts): `src/services/googleDriveService.ts`
- [Backup settings](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/services/cloudBackupStorage.ts): `src/services/cloudBackupStorage.ts`
- **Local notifications**

### Local data

- [Database queries](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/database/queries.ts): `src/database/queries.ts`
- [SQLite database](https://github.com/thangtranitwork/multi-wallet-management/blob/main/src/database/db.ts): `src/database/db.ts`

### Other components

- **Mobile user**
- **Gemini API**
- **Google Drive**

## Connections

- Mobile user → App root: opens
- App root → Root navigation: mounts
- Root navigation → Dashboard: routes
- Root navigation → Transactions: routes
- Root navigation → Wallet management: routes
- Root navigation → Debt tracking: routes
- Root navigation → Financial analytics: routes
- Dashboard → Wallet state: reads state
- Transactions → Wallet state: records activity
- Wallet management → Wallet state: manages wallets
- Debt tracking → Wallet state: manages debts
- Planned payments → Wallet state: executes plans
- Category management → Wallet state: manages categories
- Financial analytics → Wallet state: reads summaries
- Wallet state → Database queries: queries and updates
- Database queries → SQLite database: reads and writes
- App root → App security: provides security
- App security → SQLite database: loads settings
- App security → Widget sync: syncs lock state
- Wallet state → Widget sync: syncs balances
- Widget actions → Widget sync: loads and saves
- Widget actions → Home widget: renders
- Wallet state → Habit prediction: uses transaction history
- Habit reminders → Habit prediction: detects habits
- Habit reminders → Local notifications: schedules
- Wallet state → Receipt scanning: scans receipts
- Receipt scanning → Gemini API: requests extraction
- Wallet state → Financial copilot: requests assistance
- Wallet state → Backup settings: loads backup settings
- Wallet state → Google Drive backup: uploads backup
- Backup settings → Database queries: stores settings
- Google Drive backup → Google Drive: transfers backup
