# shahedpy/exptra architecture

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

- Interactive diagram: https://gitdiagram.com/shahedpy/exptra
- Repository: https://github.com/shahedpy/exptra

## Overview

EXPTRA is an offline-first personal finance app. Users navigate to transaction entry, record income or expenses (optionally organized by categories and sources), or record lending and borrowing; they can review activity on the dashboard and inspect scoped reports. The app also manages categories and sources and supports exporting and restoring local backups. The README documents Drift/SQLite storage and backup integrations, but the Dart implementations were not sampled, so internal call ownership and detailed data flow cannot be verified; the graph shows only documented high-level relationships.

Main entry points: [`lib/modules/navigation/main_navigation_page.dart`](https://github.com/shahedpy/exptra/blob/main/lib/modules/navigation/main_navigation_page.dart) (Main navigation), [`lib/data/repositories`](https://github.com/shahedpy/exptra/tree/main/lib/data/repositories) (Data repositories), [`lib/core/db/database_backup_service.dart`](https://github.com/shahedpy/exptra/blob/main/lib/core/db/database_backup_service.dart) (Backup and restore), [`lib/modules/lend_borrow`](https://github.com/shahedpy/exptra/tree/main/lib/modules/lend_borrow) (Lend and borrow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_entry["App entry<br/>[main.dart]"]
  node_navigation["Main navigation"]
  node_dashboard["Dashboard"]
  node_backup["Backup and restore"]
end

subgraph group_finance["Finance activity"]
  node_transaction_view["Transaction history"]
  node_income["Income entry"]
  node_expense["Expense entry"]
  node_lend_borrow["Lend and borrow"]
end

subgraph group_insights["Organization and insights"]
  node_expense_categories["Expense categories"]
  node_income_sources["Income sources"]
  node_reports["Reports"]
end

subgraph group_storage["Local data"]
  node_repositories["Data repositories"]
  node_database[("Local database<br/>[app_database.dart]")]
end

node_user(("User"))
node_file_picker["File picker"]
node_share_sheet["System share sheet"]

node_user -->|"opens app"| node_entry
node_entry -->|"starts"| node_navigation
node_user -->|"navigates"| node_navigation
node_navigation -->|"opens"| node_dashboard
node_navigation -->|"opens"| node_transaction_view
node_navigation -->|"opens"| node_lend_borrow
node_navigation -->|"opens"| node_expense_categories
node_navigation -->|"opens"| node_income_sources
node_navigation -->|"opens"| node_reports
node_user -->|"enters income"| node_income
node_user -->|"enters expense"| node_expense
node_user -->|"records activity"| node_lend_borrow
node_user -->|"backs up or restores"| node_backup
node_user -->|"manages categories"| node_expense_categories
node_user -->|"manages sources"| node_income_sources
node_user -->|"reviews totals"| node_reports
node_backup -.->|"selects backup"| node_file_picker
node_backup -.->|"shares backup"| node_share_sheet
node_income -->|"stores entries"| node_repositories
node_expense -->|"stores entries"| node_repositories
node_lend_borrow -->|"stores activity"| node_repositories
node_expense_categories -->|"manages categories"| node_repositories
node_income_sources -->|"manages sources"| node_repositories
node_dashboard -->|"reads summaries"| node_repositories
node_transaction_view -->|"reads history"| node_repositories
node_reports -->|"reads aggregates"| node_repositories
node_repositories -->|"reads and writes"| node_database
node_backup -->|"exports or restores"| node_database

click node_entry "https://github.com/shahedpy/exptra/blob/main/lib/main.dart"
click node_navigation "https://github.com/shahedpy/exptra/blob/main/lib/modules/navigation/main_navigation_page.dart"
click node_dashboard "https://github.com/shahedpy/exptra/tree/main/lib/modules/dashboard"
click node_transaction_view "https://github.com/shahedpy/exptra/blob/main/lib/modules/income_expense/income_expense_page.dart"
click node_income "https://github.com/shahedpy/exptra/blob/main/lib/modules/income_expense/add_income_page.dart"
click node_expense "https://github.com/shahedpy/exptra/blob/main/lib/modules/income_expense/add_expense_page.dart"
click node_lend_borrow "https://github.com/shahedpy/exptra/tree/main/lib/modules/lend_borrow"
click node_expense_categories "https://github.com/shahedpy/exptra/tree/main/lib/modules/expense_category"
click node_income_sources "https://github.com/shahedpy/exptra/tree/main/lib/modules/income_source"
click node_reports "https://github.com/shahedpy/exptra/tree/main/lib/modules/reports"
click node_repositories "https://github.com/shahedpy/exptra/tree/main/lib/data/repositories"
click node_database "https://github.com/shahedpy/exptra/blob/main/lib/core/db/app_database.dart"
click node_backup "https://github.com/shahedpy/exptra/blob/main/lib/core/db/database_backup_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_navigation,node_dashboard,node_backup,node_user toneBlue
class node_transaction_view,node_income,node_expense,node_lend_borrow toneAmber
class node_expense_categories,node_income_sources,node_reports toneMint
class node_repositories,node_database toneRose
class node_file_picker,node_share_sheet toneIndigo
```

## Components

### App experience

- [App entry](https://github.com/shahedpy/exptra/blob/main/lib/main.dart): `lib/main.dart`
- [Main navigation](https://github.com/shahedpy/exptra/blob/main/lib/modules/navigation/main_navigation_page.dart): `lib/modules/navigation/main_navigation_page.dart`
- [Dashboard](https://github.com/shahedpy/exptra/tree/main/lib/modules/dashboard): `lib/modules/dashboard`
- [Backup and restore](https://github.com/shahedpy/exptra/blob/main/lib/core/db/database_backup_service.dart): `lib/core/db/database_backup_service.dart`

### Finance activity

- [Transaction history](https://github.com/shahedpy/exptra/blob/main/lib/modules/income_expense/income_expense_page.dart): `lib/modules/income_expense/income_expense_page.dart`
- [Income entry](https://github.com/shahedpy/exptra/blob/main/lib/modules/income_expense/add_income_page.dart): `lib/modules/income_expense/add_income_page.dart`
- [Expense entry](https://github.com/shahedpy/exptra/blob/main/lib/modules/income_expense/add_expense_page.dart): `lib/modules/income_expense/add_expense_page.dart`
- [Lend and borrow](https://github.com/shahedpy/exptra/tree/main/lib/modules/lend_borrow): `lib/modules/lend_borrow`

### Organization and insights

- [Expense categories](https://github.com/shahedpy/exptra/tree/main/lib/modules/expense_category): `lib/modules/expense_category`
- [Income sources](https://github.com/shahedpy/exptra/tree/main/lib/modules/income_source): `lib/modules/income_source`
- [Reports](https://github.com/shahedpy/exptra/tree/main/lib/modules/reports): `lib/modules/reports`

### Local data

- [Data repositories](https://github.com/shahedpy/exptra/tree/main/lib/data/repositories): `lib/data/repositories`
- [Local database](https://github.com/shahedpy/exptra/blob/main/lib/core/db/app_database.dart): `lib/core/db/app_database.dart`

### Other components

- **User**
- **File picker**
- **System share sheet**

## Connections

- User → App entry: opens app
- App entry → Main navigation: starts
- User → Main navigation: navigates
- Main navigation → Dashboard: opens
- Main navigation → Transaction history: opens
- Main navigation → Lend and borrow: opens
- Main navigation → Expense categories: opens
- Main navigation → Income sources: opens
- Main navigation → Reports: opens
- User → Income entry: enters income
- User → Expense entry: enters expense
- User → Lend and borrow: records activity
- User → Backup and restore: backs up or restores
- User → Expense categories: manages categories
- User → Income sources: manages sources
- User → Reports: reviews totals
- Backup and restore → File picker: selects backup
- Backup and restore → System share sheet: shares backup
- Income entry → Data repositories: stores entries
- Expense entry → Data repositories: stores entries
- Lend and borrow → Data repositories: stores activity
- Expense categories → Data repositories: manages categories
- Income sources → Data repositories: manages sources
- Dashboard → Data repositories: reads summaries
- Transaction history → Data repositories: reads history
- Reports → Data repositories: reads aggregates
- Data repositories → Local database: reads and writes
- Backup and restore → Local database: exports or restores
