# radi8og/monthly-balance-enquiry-app architecture

> Architecture diagram of the GitHub repository radi8og/monthly-balance-enquiry-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/radi8og/monthly-balance-enquiry-app
- Repository: https://github.com/radi8og/monthly-balance-enquiry-app

## Overview

MonoBal is a Flutter monthly balance and spending tracker. Users enter through the app’s authentication/security gates, then manage the current month: set a starting balance, add or edit categorized income and expenses, and view the recalculated balance. They can browse read-only archived months and category charts, manage recurring entries, and export or restore data. The README documents local persistence, authentication, and security responsibilities; most Dart implementation files were not sampled, so edges reflect documented behavior rather than inspected calls.

Main entry points: [`lib/screens/balance_home_page.dart`](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/screens/balance_home_page.dart) (Monthly Balance), [`lib/services/storage_service.dart`](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/services/storage_service.dart) (Local Storage), [`lib/app.dart`](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/app.dart) (App & Auth Gate), [`lib/services/auth_service.dart`](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/services/auth_service.dart) (Cloud Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App Entry &amp; Security"]
  node_main["Flutter Entry<br/>[main.dart]"]
  node_app["App &amp; Auth Gate<br/>[app.dart]"]
  node_login["Login<br/>[login_screen.dart]"]
  node_auth["Cloud Authentication<br/>[auth_service.dart]"]
  node_lock["App Lock<br/>[lock_screen.dart]"]
  node_security["Security Settings"]
  node_security_service["Security Service"]
end

subgraph group_tracking["Monthly Tracking"]
  node_home["Monthly Balance"]
  node_recurring["Recurring Transactions"]
end

subgraph group_history["History &amp; Insights"]
  node_archive["Monthly Archive"]
  node_month_detail["Archived Month"]
  node_category["Category Breakdown"]
end

subgraph group_services["Data &amp; Export Services"]
  node_storage[("Local Storage")]
  node_csv["CSV Export<br/>[csv_service.dart]"]
  node_backup["Backup &amp; Restore"]
end

subgraph group_domain["Domain &amp; Presentation"]
  node_transaction["Transactions<br/>[transaction.dart]"]
  node_recurring_model["Recurring Rule"]
  node_tile["Transaction Row"]
  node_summary["Summary Card"]
  node_category_utils["Category Utilities"]
  node_currency_utils["Currency &amp; Month Utils"]
end

node_user(("User"))
node_firebase[("Firebase")]
node_native_auth["Native Biometrics"]
node_share["Native Share Sheet"]

node_user -->|"launches"| node_main
node_main -->|"launches"| node_app
node_app -->|"routes unauthenticated"| node_login
node_login -->|"authenticates"| node_auth
node_auth -->|"uses"| node_firebase
node_app -->|"gates access"| node_lock
node_lock -->|"checks identity"| node_security_service
node_security -->|"configures"| node_security_service
node_security_service -->|"prompts"| node_native_auth
node_user -->|"tracks spending"| node_home
node_home -->|"loads and saves"| node_storage
node_home -->|"records"| node_transaction
node_home -->|"shows transactions"| node_tile
node_home -->|"shows balance"| node_summary
node_home -->|"uses categories"| node_category_utils
node_home -->|"formats amounts"| node_currency_utils
node_user -->|"browses history"| node_archive
node_archive -->|"opens month"| node_month_detail
node_archive -->|"shows summaries"| node_summary
node_month_detail -->|"opens breakdown"| node_category
node_home -->|"opens breakdown"| node_category
node_user -->|"manages rules"| node_recurring
node_recurring -->|"creates rules"| node_recurring_model
node_recurring -->|"persists rules"| node_storage
node_home -->|"exports month"| node_csv
node_month_detail -->|"exports archive"| node_csv
node_csv -->|"shares file"| node_share
node_user -->|"backs up or restores"| node_backup
node_backup -->|"reads and restores"| node_storage
node_backup -->|"shares backup"| node_share
node_auth -.->|"stores session preferences"| node_storage

click node_main "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/main.dart"
click node_app "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/app.dart"
click node_login "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/screens/login_screen.dart"
click node_auth "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/services/auth_service.dart"
click node_lock "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/screens/lock_screen.dart"
click node_security "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/screens/security_settings_screen.dart"
click node_security_service "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/services/security_service.dart"
click node_home "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/screens/balance_home_page.dart"
click node_transaction "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/models/transaction.dart"
click node_recurring_model "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/models/recurring_transaction.dart"
click node_tile "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/widgets/transaction_tile.dart"
click node_summary "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/widgets/month_summary_card.dart"
click node_storage "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/services/storage_service.dart"
click node_archive "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/screens/archive_screen.dart"
click node_month_detail "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/screens/month_detail_screen.dart"
click node_category "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/screens/category_breakdown_screen.dart"
click node_recurring "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/screens/recurring_transactions_screen.dart"
click node_category_utils "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/utils/category_utils.dart"
click node_currency_utils "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/utils/currency_utils.dart"
click node_csv "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/services/csv_service.dart"
click node_backup "https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/services/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_main,node_app,node_login,node_auth,node_lock,node_security,node_security_service,node_user toneBlue
class node_home,node_recurring,node_firebase toneAmber
class node_archive,node_month_detail,node_category toneMint
class node_storage,node_csv,node_backup toneRose
class node_transaction,node_recurring_model,node_tile,node_summary,node_category_utils,node_currency_utils,node_native_auth,node_share toneIndigo
```

## Components

### App Entry & Security

- [Flutter Entry](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/main.dart): `lib/main.dart`
- [App & Auth Gate](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/app.dart): `lib/app.dart`
- [Login](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/screens/login_screen.dart): `lib/screens/login_screen.dart`
- [Cloud Authentication](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/services/auth_service.dart): `lib/services/auth_service.dart`
- [App Lock](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/screens/lock_screen.dart): `lib/screens/lock_screen.dart`
- [Security Settings](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/screens/security_settings_screen.dart): `lib/screens/security_settings_screen.dart`
- [Security Service](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/services/security_service.dart): `lib/services/security_service.dart`

### Monthly Tracking

- [Monthly Balance](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/screens/balance_home_page.dart): `lib/screens/balance_home_page.dart`
- [Recurring Transactions](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/screens/recurring_transactions_screen.dart): `lib/screens/recurring_transactions_screen.dart`

### History & Insights

- [Monthly Archive](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/screens/archive_screen.dart): `lib/screens/archive_screen.dart`
- [Archived Month](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/screens/month_detail_screen.dart): `lib/screens/month_detail_screen.dart`
- [Category Breakdown](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/screens/category_breakdown_screen.dart): `lib/screens/category_breakdown_screen.dart`

### Data & Export Services

- [Local Storage](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/services/storage_service.dart): `lib/services/storage_service.dart`
- [CSV Export](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/services/csv_service.dart): `lib/services/csv_service.dart`
- [Backup & Restore](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/services/backup_service.dart): `lib/services/backup_service.dart`

### Domain & Presentation

- [Transactions](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/models/transaction.dart): `lib/models/transaction.dart`
- [Recurring Rule](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/models/recurring_transaction.dart): `lib/models/recurring_transaction.dart`
- [Transaction Row](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/widgets/transaction_tile.dart): `lib/widgets/transaction_tile.dart`
- [Summary Card](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/widgets/month_summary_card.dart): `lib/widgets/month_summary_card.dart`
- [Category Utilities](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/utils/category_utils.dart): `lib/utils/category_utils.dart`
- [Currency & Month Utils](https://github.com/radi8og/monthly-balance-enquiry-app/blob/main/lib/utils/currency_utils.dart): `lib/utils/currency_utils.dart`

### Other components

- **User**
- **Firebase**
- **Native Biometrics**
- **Native Share Sheet**

## Connections

- User → Flutter Entry: launches (evidence: `README.md`)
- Flutter Entry → App & Auth Gate: launches (evidence: `README.md`)
- App & Auth Gate → Login: routes unauthenticated (evidence: `README.md`)
- Login → Cloud Authentication: authenticates (evidence: `README.md`)
- Cloud Authentication → Firebase: uses (evidence: `README.md`)
- App & Auth Gate → App Lock: gates access (evidence: `README.md`)
- App Lock → Security Service: checks identity (evidence: `README.md`)
- Security Settings → Security Service: configures (evidence: `README.md`)
- Security Service → Native Biometrics: prompts (evidence: `README.md`)
- User → Monthly Balance: tracks spending (evidence: `README.md`)
- Monthly Balance → Local Storage: loads and saves (evidence: `README.md`)
- Monthly Balance → Transactions: records (evidence: `README.md`)
- Monthly Balance → Transaction Row: shows transactions (evidence: `README.md`)
- Monthly Balance → Summary Card: shows balance (evidence: `README.md`)
- Monthly Balance → Category Utilities: uses categories (evidence: `README.md`)
- Monthly Balance → Currency & Month Utils: formats amounts (evidence: `README.md`)
- User → Monthly Archive: browses history (evidence: `README.md`)
- Monthly Archive → Archived Month: opens month (evidence: `README.md`)
- Monthly Archive → Summary Card: shows summaries (evidence: `README.md`)
- Archived Month → Category Breakdown: opens breakdown (evidence: `README.md`)
- Monthly Balance → Category Breakdown: opens breakdown (evidence: `README.md`)
- User → Recurring Transactions: manages rules (evidence: `README.md`)
- Recurring Transactions → Recurring Rule: creates rules (evidence: `README.md`)
- Recurring Transactions → Local Storage: persists rules (evidence: `README.md`)
- Monthly Balance → CSV Export: exports month (evidence: `README.md`)
- Archived Month → CSV Export: exports archive (evidence: `README.md`)
- CSV Export → Native Share Sheet: shares file (evidence: `README.md`)
- User → Backup & Restore: backs up or restores (evidence: `README.md`)
- Backup & Restore → Local Storage: reads and restores (evidence: `README.md`)
- Backup & Restore → Native Share Sheet: shares backup (evidence: `README.md`)
- Cloud Authentication → Local Storage: stores session preferences
