# sudeep-ps/moneymanagement architecture

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

- Interactive diagram: https://gitdiagram.com/sudeep-ps/moneymanagement
- Repository: https://github.com/sudeep-ps/moneymanagement

## Overview

#### Purpose and Runtime
This is a Flutter personal money-management application. Its meaningful implementation is in Dart under `lib/`; Android, iOS, web, Linux, macOS, and Windows directories are Flutter host shells. No backend, network service, or cloud infrastructure is evident.

#### Application Entry and Bootstrap
`lib/main.dart` is the Dart entry point and is responsible for initializing the application before presenting Flutter UI. Native launch points embed the Flutter runtime, notably `android/app/src/main/kotlin/com/example/moneymanagement/MainActivity.kt` and `ios/Runner/AppDelegate.swift`.

A splash stage exists at `lib/screens/splash_screen.dart`, likely acting as the initial UI boundary before the main application views.

#### Domain Model Layer
The app centers on two persisted business entities:
- Categories: `lib/models/category/category_model.dart`
- Transactions: `lib/models/transaction/transaction_model.dart`

Generated companion files, `lib/models/category/category_model.g.dart` and `lib/models/transaction/transaction_model.g.dart`, indicate code-generated serialization/adapters for local persistence. Categories distinguish income versus expense flows, reflected in separate category list screens.

#### Local Persistence Boundary
Database access is isolated by entity:
- `lib/db/category/category_db.dart`
- `lib/db/transactions/transaction_db.dart`

UI should interact with these database modules rather than directly with generated model serialization. This is the principal state and data boundary: category records supply transaction classification, while transaction records drive balances, details, and transaction-list presentation. The repository structure suggests an embedded on-device database rather than a remote API.

#### Navigation and Primary UI Shell
The home screen and bottom navigation form the primary application shell:
- `lib/screens/home/screen_home.dart`
- `lib/screens/home/widgets/bottomnavigation.dart`

The shell routes users among summary/home, transaction, and category workflows. `lib/screens/transactions/screen_transaction.dart` and `lib/screens/category/screen_category.dart` are top-level feature views rather than reusable widgets.

#### Transaction Workflow
Transaction creation starts in `lib/screens/add_transaction/screen_add_transaction.dart`. It should collect a transaction’s amount/type/date/category data, use the category store for selectable classifications, then write through `transaction_db.dart`.

Transaction browsing and inspection are separated:
- List/history: `lib/screens/transactions/screen_transaction.dart`
- Transaction details: `lib/screens/transactions/transtn_details.dart`

This keeps creation, collection display, and per-record inspection as distinct UI stages over the same persisted transaction data.

#### Categories, Reporting, and Auxiliary Views
Category management is organized around a parent screen and type-specific lists:
- `lib/screens/category/screen_category.dart`
- `lib/screens/category/income_categorylist.dart`
- `lib/screens/category/expense_categorylist.dart`

`lib/screens/category/category_add_poup.dart` provides the add-category interaction. Balance presentation is isolated in `lib/screens/popup/balance.dart`, consuming transaction-derived totals. `lib/screens/popup/about.dart` is static/support UI.

#### Platform Delivery
Flutter packages and asset declarations are governed by `pubspec.yaml`. Mobile packaging uses Gradle under `android/app/build.gradle` and Xcode Runner projects under `ios/Runner.xcodeproj`; desktop and web targets are also committed. Android signing material exists at `android/app/key/private_key.pepk`, a release-security concern that should be managed outside source control.

Main entry points: [`lib/screens/home/widgets/bottomnavigation.dart`](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/home/widgets/bottomnavigation.dart) (Bottom navigation), [`lib/db/category/category_db.dart`](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/db/category/category_db.dart) (Category store), [`lib/screens/category/screen_category.dart`](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/category/screen_category.dart) (Category management), [`lib/main.dart`](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/main.dart) (App entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Platform delivery"]
  node_android_host["Android host<br/>Flutter host shell<br/>[MainActivity.kt]"]
  node_ios_host["iOS host<br/>Flutter host shell<br/>[AppDelegate.swift]"]
  node_packages["Packages &amp; assets<br/>Flutter manifest<br/>[pubspec.yaml]"]
  node_android_package["Android packaging<br/>Gradle build<br/>[build.gradle]"]
  node_ios_package["iOS packaging<br/>Xcode project<br/>[Runner.xcodeproj]"]
end

subgraph group_bootstrap["Bootstrap"]
  node_entry["App entry<br/>Dart bootstrap<br/>[main.dart]"]
  node_splash["Splash screen<br/>initial UI<br/>[splash_screen.dart]"]
end

subgraph group_data["Models &amp; local data"]
  node_category_model["Category<br/>domain model"]
  node_transaction_model["Transaction<br/>domain model"]
  node_category_db[("Category store<br/>local database module<br/>[category_db.dart]")]
  node_transaction_db[("Transaction store<br/>local database module")]
end

subgraph group_ui["Flutter UI"]
  node_home["Home shell<br/>primary UI shell<br/>[screen_home.dart]"]
  node_bottom_nav["Bottom navigation<br/>navigation widget"]
  node_add_transaction["Add transaction<br/>transaction creation UI"]
  node_transaction_list["Transaction history<br/>transaction list UI"]
  node_transaction_details["Transaction details<br/>record detail UI"]
  node_category_screen["Category management<br/>category UI"]
  node_income_categories["Income categories<br/>category list UI"]
  node_expense_categories["Expense categories<br/>category list UI"]
  node_add_category["Add category<br/>category creation UI"]
  node_balance["Balance view<br/>reporting UI<br/>[balance.dart]"]
  node_about["About view<br/>static support UI<br/>[about.dart]"]
end

node_android_host -->|"launches"| node_entry
node_ios_host -->|"launches"| node_entry
node_packages -.->|"configures"| node_entry
node_android_package -->|"packages"| node_android_host
node_ios_package -->|"packages"| node_ios_host
node_entry -->|"starts with"| node_splash
node_splash -->|"enters"| node_home
node_home -->|"contains"| node_bottom_nav
node_bottom_nav -->|"navigates to"| node_transaction_list
node_bottom_nav -->|"navigates to"| node_category_screen
node_bottom_nav -->|"opens"| node_balance
node_bottom_nav -->|"opens"| node_about
node_transaction_list -->|"inspects"| node_transaction_details
node_transaction_list -->|"reads"| node_transaction_db
node_add_transaction -->|"loads classifications"| node_category_db
node_add_transaction -->|"writes"| node_transaction_db
node_transaction_db -->|"persists"| node_transaction_model
node_category_screen -->|"shows"| node_income_categories
node_category_screen -->|"shows"| node_expense_categories
node_category_screen -->|"adds via"| node_add_category
node_income_categories -->|"reads"| node_category_db
node_expense_categories -->|"reads"| node_category_db
node_add_category -->|"writes"| node_category_db
node_category_db -->|"persists"| node_category_model
node_balance -->|"derives totals from"| node_transaction_db

click node_android_host "https://github.com/sudeep-ps/moneymanagement/blob/main/android/app/src/main/kotlin/com/example/moneymanagement/MainActivity.kt"
click node_ios_host "https://github.com/sudeep-ps/moneymanagement/blob/main/ios/Runner/AppDelegate.swift"
click node_packages "https://github.com/sudeep-ps/moneymanagement/blob/main/pubspec.yaml"
click node_android_package "https://github.com/sudeep-ps/moneymanagement/blob/main/android/app/build.gradle"
click node_ios_package "https://github.com/sudeep-ps/moneymanagement/tree/main/ios/Runner.xcodeproj"
click node_entry "https://github.com/sudeep-ps/moneymanagement/blob/main/lib/main.dart"
click node_splash "https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/splash_screen.dart"
click node_category_model "https://github.com/sudeep-ps/moneymanagement/blob/main/lib/models/category/category_model.dart"
click node_transaction_model "https://github.com/sudeep-ps/moneymanagement/blob/main/lib/models/transaction/transaction_model.dart"
click node_category_db "https://github.com/sudeep-ps/moneymanagement/blob/main/lib/db/category/category_db.dart"
click node_transaction_db "https://github.com/sudeep-ps/moneymanagement/blob/main/lib/db/transactions/transaction_db.dart"
click node_home "https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/home/screen_home.dart"
click node_bottom_nav "https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/home/widgets/bottomnavigation.dart"
click node_add_transaction "https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/add_transaction/screen_add_transaction.dart"
click node_transaction_list "https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/transactions/screen_transaction.dart"
click node_transaction_details "https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/transactions/transtn_details.dart"
click node_category_screen "https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/category/screen_category.dart"
click node_income_categories "https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/category/income_categorylist.dart"
click node_expense_categories "https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/category/expense_categorylist.dart"
click node_add_category "https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/category/category_add_poup.dart"
click node_balance "https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/popup/balance.dart"
click node_about "https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/popup/about.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_android_host,node_ios_host,node_packages,node_android_package,node_ios_package toneBlue
class node_entry,node_splash toneAmber
class node_category_model,node_transaction_model,node_category_db,node_transaction_db toneMint
class node_home,node_bottom_nav,node_add_transaction,node_transaction_list,node_transaction_details,node_category_screen,node_income_categories,node_expense_categories,node_add_category,node_balance,node_about toneRose
```

## Components

### Platform delivery

- [Android host](https://github.com/sudeep-ps/moneymanagement/blob/main/android/app/src/main/kotlin/com/example/moneymanagement/MainActivity.kt): Flutter host shell · `android/app/src/main/kotlin/com/example/moneymanagement/MainActivity.kt`
- [iOS host](https://github.com/sudeep-ps/moneymanagement/blob/main/ios/Runner/AppDelegate.swift): Flutter host shell · `ios/Runner/AppDelegate.swift`
- [Packages & assets](https://github.com/sudeep-ps/moneymanagement/blob/main/pubspec.yaml): Flutter manifest · `pubspec.yaml`
- [Android packaging](https://github.com/sudeep-ps/moneymanagement/blob/main/android/app/build.gradle): Gradle build · `android/app/build.gradle`
- [iOS packaging](https://github.com/sudeep-ps/moneymanagement/tree/main/ios/Runner.xcodeproj): Xcode project · `ios/Runner.xcodeproj`

### Bootstrap

- [App entry](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/main.dart): Dart bootstrap · `lib/main.dart`
- [Splash screen](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/splash_screen.dart): initial UI · `lib/screens/splash_screen.dart`

### Models & local data

- [Category](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/models/category/category_model.dart): domain model · Income and expense classification. · `lib/models/category/category_model.dart`
- [Transaction](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/models/transaction/transaction_model.dart): domain model · `lib/models/transaction/transaction_model.dart`
- [Category store](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/db/category/category_db.dart): local database module · `lib/db/category/category_db.dart`
- [Transaction store](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/db/transactions/transaction_db.dart): local database module · On-device transaction persistence. · `lib/db/transactions/transaction_db.dart`

### Flutter UI

- [Home shell](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/home/screen_home.dart): primary UI shell · `lib/screens/home/screen_home.dart`
- [Bottom navigation](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/home/widgets/bottomnavigation.dart): navigation widget · `lib/screens/home/widgets/bottomnavigation.dart`
- [Add transaction](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/add_transaction/screen_add_transaction.dart): transaction creation UI · `lib/screens/add_transaction/screen_add_transaction.dart`
- [Transaction history](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/transactions/screen_transaction.dart): transaction list UI · `lib/screens/transactions/screen_transaction.dart`
- [Transaction details](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/transactions/transtn_details.dart): record detail UI · `lib/screens/transactions/transtn_details.dart`
- [Category management](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/category/screen_category.dart): category UI · `lib/screens/category/screen_category.dart`
- [Income categories](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/category/income_categorylist.dart): category list UI · `lib/screens/category/income_categorylist.dart`
- [Expense categories](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/category/expense_categorylist.dart): category list UI · `lib/screens/category/expense_categorylist.dart`
- [Add category](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/category/category_add_poup.dart): category creation UI · `lib/screens/category/category_add_poup.dart`
- [Balance view](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/popup/balance.dart): reporting UI · Presents transaction-derived totals. · `lib/screens/popup/balance.dart`
- [About view](https://github.com/sudeep-ps/moneymanagement/blob/main/lib/screens/popup/about.dart): static support UI · `lib/screens/popup/about.dart`

## Connections

- Android host → App entry: launches
- iOS host → App entry: launches
- Packages & assets → App entry: configures
- Android packaging → Android host: packages
- iOS packaging → iOS host: packages
- App entry → Splash screen: starts with
- Splash screen → Home shell: enters
- Home shell → Bottom navigation: contains
- Bottom navigation → Transaction history: navigates to
- Bottom navigation → Category management: navigates to
- Bottom navigation → Balance view: opens
- Bottom navigation → About view: opens
- Transaction history → Transaction details: inspects
- Transaction history → Transaction store: reads
- Add transaction → Category store: loads classifications
- Add transaction → Transaction store: writes
- Transaction store → Transaction: persists
- Category management → Income categories: shows
- Category management → Expense categories: shows
- Category management → Add category: adds via
- Income categories → Category store: reads
- Expense categories → Category store: reads
- Add category → Category store: writes
- Category store → Category: persists
- Balance view → Transaction store: derives totals from
