# metalha516/expenseguard- architecture

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

- Interactive diagram: https://gitdiagram.com/metalha516/expenseguard-
- Repository: https://github.com/metalha516/expenseguard-

## Overview

ExpenseGuard is a Flutter corporate expense-management app. The principal user flow is onboarding or login, opening the app shell, capturing a receipt, reviewing extracted expense details and policy feedback, then submitting it for manager approval. Separate branches cover cards, spend analytics, notifications, and profile settings. The README documents these capabilities and module boundaries; Dart implementation excerpts were not provided, so feature-to-provider and provider-to-repository call edges are omitted rather than inferred.

Main entry points: [`lib/features/home/presentation/main_shell.dart`](https://github.com/metalha516/expenseguard-/blob/master/lib/features/home/presentation/main_shell.dart) (Navigation Shell), [`lib/features/expenses/presentation/submit_expense_screen.dart`](https://github.com/metalha516/expenseguard-/blob/master/lib/features/expenses/presentation/submit_expense_screen.dart) (Expense Form), [`lib/features/approvals/presentation/approvals_queue_screen.dart`](https://github.com/metalha516/expenseguard-/blob/master/lib/features/approvals/presentation/approvals_queue_screen.dart) (Approvals Queue), [`lib/features/notifications/presentation/notifications_center_screen.dart`](https://github.com/metalha516/expenseguard-/blob/master/lib/features/notifications/presentation/notifications_center_screen.dart) (Notifications Center)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App Shell"]
  node_entry["App Entry<br/>[main.dart]"]
  node_router["App Router<br/>[app_router.dart]"]
  node_shell["Navigation Shell<br/>[main_shell.dart]"]
  node_theme["Theme System<br/>[app_theme.dart]"]
  node_home["Home Dashboard<br/>[home_screen.dart]"]
  node_home_state["Dashboard State<br/>[home_provider.dart]"]
end

subgraph group_expenses["Expense Workflow"]
  node_capture["Receipt Capture"]
  node_expense_form["Expense Form"]
  node_expense_state["Expense Form State"]
  node_policy["Policy Review"]
  node_expense_review["Expense Review"]
  node_transactions["Transaction Details"]
  node_transaction_state["Transaction State"]
  node_expense_repo["Expense Repository"]
end

subgraph group_oversight["Review and Approvals"]
  node_approvals["Approvals Queue"]
  node_approval_state["Approval State"]
end

subgraph group_spending["Spending Tools"]
  node_cards["Corporate Cards"]
  node_cards_state["Cards State"]
  node_cards_repo["Cards Repository"]
  node_insights["Spend Insights"]
  node_insights_state["Insights State"]
end

subgraph group_engagement["Account and Updates"]
  node_onboarding["Onboarding"]
  node_login["Login<br/>[login_screen.dart]"]
  node_notifications["Notifications Center"]
  node_notifications_state["Notifications State"]
  node_notifications_repo["Notifications Repository"]
  node_profile["Profile Settings"]
end

node_user(("Employee or Manager"))

node_user -->|"opens"| node_entry
node_entry -->|"starts navigation"| node_router
node_router -->|"routes to"| node_shell
node_shell -->|"shows"| node_home
node_shell -->|"routes to"| node_approvals
node_shell -->|"opens camera"| node_capture
node_shell -->|"routes to"| node_cards
node_shell -->|"routes to"| node_insights
node_shell -->|"routes to"| node_profile
node_user -->|"starts setup"| node_onboarding
node_user -.->|"signs in"| node_login
node_capture -->|"captures receipt"| node_expense_form
node_expense_form -->|"previews policy"| node_policy
node_expense_form -->|"submits for review"| node_expense_review
node_expense_review -->|"enters queue"| node_approvals
node_approvals -->|"opens details"| node_transactions
node_notifications -->|"deep-links to"| node_transactions
node_home -.->|"uses state"| node_home_state
node_expense_form -.->|"uses state"| node_expense_state
node_expense_form -.->|"persists expense"| node_expense_repo
node_approvals -.->|"uses state"| node_approval_state
node_cards -.->|"uses state"| node_cards_state
node_cards -.->|"accesses card data"| node_cards_repo
node_insights -.->|"uses state"| node_insights_state
node_transactions -.->|"uses state"| node_transaction_state
node_notifications -.->|"uses state"| node_notifications_state
node_notifications -.->|"accesses updates"| node_notifications_repo
node_entry -.->|"configures appearance"| node_theme

click node_entry "https://github.com/metalha516/expenseguard-/blob/master/lib/main.dart"
click node_router "https://github.com/metalha516/expenseguard-/blob/master/lib/core/router/app_router.dart"
click node_shell "https://github.com/metalha516/expenseguard-/blob/master/lib/features/home/presentation/main_shell.dart"
click node_theme "https://github.com/metalha516/expenseguard-/blob/master/lib/core/theme/app_theme.dart"
click node_onboarding "https://github.com/metalha516/expenseguard-/blob/master/lib/features/onboarding/presentation/onboarding_screen.dart"
click node_login "https://github.com/metalha516/expenseguard-/blob/master/lib/features/auth/presentation/login_screen.dart"
click node_home "https://github.com/metalha516/expenseguard-/blob/master/lib/features/home/presentation/home_screen.dart"
click node_home_state "https://github.com/metalha516/expenseguard-/blob/master/lib/features/home/providers/home_provider.dart"
click node_capture "https://github.com/metalha516/expenseguard-/blob/master/lib/features/expenses/presentation/submit_expense_camera_screen.dart"
click node_expense_form "https://github.com/metalha516/expenseguard-/blob/master/lib/features/expenses/presentation/submit_expense_screen.dart"
click node_expense_state "https://github.com/metalha516/expenseguard-/blob/master/lib/features/expenses/providers/expense_form_provider.dart"
click node_policy "https://github.com/metalha516/expenseguard-/blob/master/lib/features/expenses/presentation/policy_check_screen.dart"
click node_expense_review "https://github.com/metalha516/expenseguard-/blob/master/lib/features/expenses/presentation/expense_review_screen.dart"
click node_transactions "https://github.com/metalha516/expenseguard-/blob/master/lib/features/expenses/presentation/transaction_detail_screen.dart"
click node_transaction_state "https://github.com/metalha516/expenseguard-/blob/master/lib/features/expenses/providers/transaction_details_provider.dart"
click node_expense_repo "https://github.com/metalha516/expenseguard-/blob/master/lib/core/repositories/expenses_repository.dart"
click node_approvals "https://github.com/metalha516/expenseguard-/blob/master/lib/features/approvals/presentation/approvals_queue_screen.dart"
click node_approval_state "https://github.com/metalha516/expenseguard-/blob/master/lib/features/approvals/providers/approvals_provider.dart"
click node_cards "https://github.com/metalha516/expenseguard-/blob/master/lib/features/cards/presentation/corporate_cards_screen.dart"
click node_cards_state "https://github.com/metalha516/expenseguard-/blob/master/lib/features/cards/providers/cards_provider.dart"
click node_cards_repo "https://github.com/metalha516/expenseguard-/blob/master/lib/core/repositories/cards_repository.dart"
click node_insights "https://github.com/metalha516/expenseguard-/blob/master/lib/features/insights/presentation/spend_insights_screen.dart"
click node_insights_state "https://github.com/metalha516/expenseguard-/blob/master/lib/features/insights/providers/insights_provider.dart"
click node_notifications "https://github.com/metalha516/expenseguard-/blob/master/lib/features/notifications/presentation/notifications_center_screen.dart"
click node_notifications_state "https://github.com/metalha516/expenseguard-/blob/master/lib/features/notifications/providers/notifications_provider.dart"
click node_notifications_repo "https://github.com/metalha516/expenseguard-/blob/master/lib/core/repositories/notifications_repository.dart"
click node_profile "https://github.com/metalha516/expenseguard-/blob/master/lib/features/profile/presentation/profile_settings_screen.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_router,node_shell,node_theme,node_home,node_home_state toneBlue
class node_capture,node_expense_form,node_expense_state,node_policy,node_expense_review,node_transactions,node_transaction_state,node_expense_repo toneAmber
class node_approvals,node_approval_state toneMint
class node_cards,node_cards_state,node_cards_repo,node_insights,node_insights_state toneRose
class node_onboarding,node_login,node_notifications,node_notifications_state,node_notifications_repo,node_profile,node_user toneIndigo
```

## Components

### App Shell

- [App Entry](https://github.com/metalha516/expenseguard-/blob/master/lib/main.dart): `lib/main.dart`
- [App Router](https://github.com/metalha516/expenseguard-/blob/master/lib/core/router/app_router.dart): `lib/core/router/app_router.dart`
- [Navigation Shell](https://github.com/metalha516/expenseguard-/blob/master/lib/features/home/presentation/main_shell.dart): `lib/features/home/presentation/main_shell.dart`
- [Theme System](https://github.com/metalha516/expenseguard-/blob/master/lib/core/theme/app_theme.dart): `lib/core/theme/app_theme.dart`
- [Home Dashboard](https://github.com/metalha516/expenseguard-/blob/master/lib/features/home/presentation/home_screen.dart): `lib/features/home/presentation/home_screen.dart`
- [Dashboard State](https://github.com/metalha516/expenseguard-/blob/master/lib/features/home/providers/home_provider.dart): `lib/features/home/providers/home_provider.dart`

### Expense Workflow

- [Receipt Capture](https://github.com/metalha516/expenseguard-/blob/master/lib/features/expenses/presentation/submit_expense_camera_screen.dart): `lib/features/expenses/presentation/submit_expense_camera_screen.dart`
- [Expense Form](https://github.com/metalha516/expenseguard-/blob/master/lib/features/expenses/presentation/submit_expense_screen.dart): `lib/features/expenses/presentation/submit_expense_screen.dart`
- [Expense Form State](https://github.com/metalha516/expenseguard-/blob/master/lib/features/expenses/providers/expense_form_provider.dart): `lib/features/expenses/providers/expense_form_provider.dart`
- [Policy Review](https://github.com/metalha516/expenseguard-/blob/master/lib/features/expenses/presentation/policy_check_screen.dart): `lib/features/expenses/presentation/policy_check_screen.dart`
- [Expense Review](https://github.com/metalha516/expenseguard-/blob/master/lib/features/expenses/presentation/expense_review_screen.dart): `lib/features/expenses/presentation/expense_review_screen.dart`
- [Transaction Details](https://github.com/metalha516/expenseguard-/blob/master/lib/features/expenses/presentation/transaction_detail_screen.dart): `lib/features/expenses/presentation/transaction_detail_screen.dart`
- [Transaction State](https://github.com/metalha516/expenseguard-/blob/master/lib/features/expenses/providers/transaction_details_provider.dart): `lib/features/expenses/providers/transaction_details_provider.dart`
- [Expense Repository](https://github.com/metalha516/expenseguard-/blob/master/lib/core/repositories/expenses_repository.dart): `lib/core/repositories/expenses_repository.dart`

### Review and Approvals

- [Approvals Queue](https://github.com/metalha516/expenseguard-/blob/master/lib/features/approvals/presentation/approvals_queue_screen.dart): `lib/features/approvals/presentation/approvals_queue_screen.dart`
- [Approval State](https://github.com/metalha516/expenseguard-/blob/master/lib/features/approvals/providers/approvals_provider.dart): `lib/features/approvals/providers/approvals_provider.dart`

### Spending Tools

- [Corporate Cards](https://github.com/metalha516/expenseguard-/blob/master/lib/features/cards/presentation/corporate_cards_screen.dart): `lib/features/cards/presentation/corporate_cards_screen.dart`
- [Cards State](https://github.com/metalha516/expenseguard-/blob/master/lib/features/cards/providers/cards_provider.dart): `lib/features/cards/providers/cards_provider.dart`
- [Cards Repository](https://github.com/metalha516/expenseguard-/blob/master/lib/core/repositories/cards_repository.dart): `lib/core/repositories/cards_repository.dart`
- [Spend Insights](https://github.com/metalha516/expenseguard-/blob/master/lib/features/insights/presentation/spend_insights_screen.dart): `lib/features/insights/presentation/spend_insights_screen.dart`
- [Insights State](https://github.com/metalha516/expenseguard-/blob/master/lib/features/insights/providers/insights_provider.dart): `lib/features/insights/providers/insights_provider.dart`

### Account and Updates

- [Onboarding](https://github.com/metalha516/expenseguard-/blob/master/lib/features/onboarding/presentation/onboarding_screen.dart): `lib/features/onboarding/presentation/onboarding_screen.dart`
- [Login](https://github.com/metalha516/expenseguard-/blob/master/lib/features/auth/presentation/login_screen.dart): `lib/features/auth/presentation/login_screen.dart`
- [Notifications Center](https://github.com/metalha516/expenseguard-/blob/master/lib/features/notifications/presentation/notifications_center_screen.dart): `lib/features/notifications/presentation/notifications_center_screen.dart`
- [Notifications State](https://github.com/metalha516/expenseguard-/blob/master/lib/features/notifications/providers/notifications_provider.dart): `lib/features/notifications/providers/notifications_provider.dart`
- [Notifications Repository](https://github.com/metalha516/expenseguard-/blob/master/lib/core/repositories/notifications_repository.dart): `lib/core/repositories/notifications_repository.dart`
- [Profile Settings](https://github.com/metalha516/expenseguard-/blob/master/lib/features/profile/presentation/profile_settings_screen.dart): `lib/features/profile/presentation/profile_settings_screen.dart`

### Other components

- **Employee or Manager**

## Connections

- Employee or Manager → App Entry: opens (evidence: `README.md`)
- App Entry → App Router: starts navigation (evidence: `README.md`)
- App Router → Navigation Shell: routes to (evidence: `README.md`)
- Navigation Shell → Home Dashboard: shows (evidence: `README.md`)
- Navigation Shell → Approvals Queue: routes to (evidence: `README.md`)
- Navigation Shell → Receipt Capture: opens camera (evidence: `README.md`)
- Navigation Shell → Corporate Cards: routes to (evidence: `README.md`)
- Navigation Shell → Spend Insights: routes to (evidence: `README.md`)
- Navigation Shell → Profile Settings: routes to (evidence: `README.md`)
- Employee or Manager → Onboarding: starts setup (evidence: `README.md`)
- Employee or Manager → Login: signs in (evidence: `README.md`)
- Receipt Capture → Expense Form: captures receipt (evidence: `README.md`)
- Expense Form → Policy Review: previews policy (evidence: `README.md`)
- Expense Form → Expense Review: submits for review (evidence: `README.md`)
- Expense Review → Approvals Queue: enters queue (evidence: `README.md`)
- Approvals Queue → Transaction Details: opens details (evidence: `README.md`)
- Notifications Center → Transaction Details: deep-links to (evidence: `README.md`)
- Home Dashboard → Dashboard State: uses state
- Expense Form → Expense Form State: uses state
- Expense Form → Expense Repository: persists expense
- Approvals Queue → Approval State: uses state
- Corporate Cards → Cards State: uses state
- Corporate Cards → Cards Repository: accesses card data
- Spend Insights → Insights State: uses state
- Transaction Details → Transaction State: uses state
- Notifications Center → Notifications State: uses state
- Notifications Center → Notifications Repository: accesses updates
- App Entry → Theme System: configures appearance
