# doukfama/ecobudget-kmp architecture

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

- Interactive diagram: https://gitdiagram.com/doukfama/ecobudget-kmp
- Repository: https://github.com/doukfama/ecobudget-kmp

## Overview

EcoBudget is an Android budgeting app being migrated toward a Kotlin Multiplatform shared core. The principal workflow is viewing and navigating transactions by month, then entering transactions through the Android UI; shared state and repository logic support that UI. The README documents the shared models, repository, UI state, localized category resources, and platform-specific time/UUID implementations. Source excerpts are limited to build configuration, so detailed runtime wiring between UI components and shared code is not verified.

Main entry points: [`app/src/main/java/com/example/ui/screens/EcoBudgetScreen.kt`](https://github.com/doukfama/ecobudget-kmp/blob/master/app/src/main/java/com/example/ui/screens/EcoBudgetScreen.kt) (Budget screen), [`shared/src/commonMain/kotlin/com/example/data/repository/FakeTransactionRepository.kt`](https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/data/repository/FakeTransactionRepository.kt) (Fake transaction data), [`shared/src/commonMain/kotlin/com/example/viewmodel/EcoBudgetViewModel.kt`](https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/viewmodel/EcoBudgetViewModel.kt) (Budget view model), [`shared/src/commonMain/kotlin/com/example/model/Transaction.kt`](https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/model/Transaction.kt) (Transaction model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_android_ui["Android interface"]
  node_activity["Main activity<br/>[MainActivity.kt]"]
  node_screen["Budget screen<br/>[EcoBudgetScreen.kt]"]
  node_month_nav["Month navigator"]
  node_transaction_card["Transaction card<br/>[TransactionCard.kt]"]
  node_add_dialog["Add transaction"]
  node_theme["UI theme<br/>[Theme.kt]"]
end

subgraph group_shared_domain["Shared domain"]
  node_viewmodel["Budget view model"]
  node_ui_state["Budget UI state"]
  node_transaction["Transaction model<br/>[Transaction.kt]"]
  node_category["Category model<br/>[Category.kt]"]
  node_yearmonth["Month model<br/>[YearMonth.kt]"]
  node_category_resources["Category strings"]
end

subgraph group_shared_data["Shared data"]
  node_repository_contract["Transaction repository"]
  node_fake_repository["Fake transaction data"]
end

subgraph group_platform["Platform services"]
  node_common_uuid["UUID abstraction<br/>[UUID.kt]"]
  node_common_time["Time abstraction<br/>[Time.kt]"]
  node_android_uuid["Android UUID<br/>[UUID.kt]"]
  node_ios_uuid["iOS UUID<br/>[UUID.kt]"]
  node_android_time["Android clock<br/>[Time.kt]"]
  node_ios_time["iOS clock<br/>[Time.kt]"]
end

node_user(("User"))

node_user -->|"opens app"| node_activity
node_activity -->|"hosts screen"| node_screen
node_screen -->|"uses shared state"| node_viewmodel
node_screen -->|"shows navigation"| node_month_nav
node_screen -->|"shows transactions"| node_transaction_card
node_screen -->|"offers entry"| node_add_dialog
node_screen -->|"uses styling"| node_theme
node_viewmodel -->|"updates state"| node_ui_state
node_viewmodel -->|"uses repository"| node_repository_contract
node_fake_repository -->|"implements"| node_repository_contract
node_fake_repository -->|"stores models"| node_transaction
node_transaction -->|"generates ID"| node_common_uuid
node_fake_repository -->|"uses clock"| node_common_time
node_android_uuid -->|"implements"| node_common_uuid
node_ios_uuid -->|"implements"| node_common_uuid
node_android_time -->|"implements"| node_common_time
node_ios_time -->|"implements"| node_common_time
node_yearmonth -->|"supports date grouping"| node_transaction
node_category_resources -->|"maps labels"| node_category

click node_activity "https://github.com/doukfama/ecobudget-kmp/blob/master/app/src/main/java/com/example/MainActivity.kt"
click node_screen "https://github.com/doukfama/ecobudget-kmp/blob/master/app/src/main/java/com/example/ui/screens/EcoBudgetScreen.kt"
click node_month_nav "https://github.com/doukfama/ecobudget-kmp/blob/master/app/src/main/java/com/example/ui/components/MonthNavigatorBar.kt"
click node_transaction_card "https://github.com/doukfama/ecobudget-kmp/blob/master/app/src/main/java/com/example/ui/components/TransactionCard.kt"
click node_add_dialog "https://github.com/doukfama/ecobudget-kmp/blob/master/app/src/main/java/com/example/ui/components/AddTransactionDialog.kt"
click node_theme "https://github.com/doukfama/ecobudget-kmp/blob/master/app/src/main/java/com/example/ui/theme/Theme.kt"
click node_viewmodel "https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/viewmodel/EcoBudgetViewModel.kt"
click node_ui_state "https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/viewmodel/EcoBudgetUiState.kt"
click node_transaction "https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/model/Transaction.kt"
click node_category "https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/model/Category.kt"
click node_yearmonth "https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/model/YearMonth.kt"
click node_category_resources "https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/resources/CategoryResources.kt"
click node_repository_contract "https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/data/repository/TransactionRepository.kt"
click node_fake_repository "https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/data/repository/FakeTransactionRepository.kt"
click node_common_uuid "https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/utils/UUID.kt"
click node_common_time "https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/utils/Time.kt"
click node_android_uuid "https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/androidMain/kotlin/com/example/utils/UUID.kt"
click node_ios_uuid "https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/iosMain/kotlin/com/example/utils/UUID.kt"
click node_android_time "https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/androidMain/kotlin/com/example/utils/Time.kt"
click node_ios_time "https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/iosMain/kotlin/com/example/utils/Time.kt"

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_activity,node_screen,node_month_nav,node_transaction_card,node_add_dialog,node_theme,node_user toneBlue
class node_viewmodel,node_ui_state,node_transaction,node_category,node_yearmonth,node_category_resources toneAmber
class node_repository_contract,node_fake_repository toneMint
class node_common_uuid,node_common_time,node_android_uuid,node_ios_uuid,node_android_time,node_ios_time toneRose
```

## Components

### Android interface

- [Main activity](https://github.com/doukfama/ecobudget-kmp/blob/master/app/src/main/java/com/example/MainActivity.kt): `app/src/main/java/com/example/MainActivity.kt`
- [Budget screen](https://github.com/doukfama/ecobudget-kmp/blob/master/app/src/main/java/com/example/ui/screens/EcoBudgetScreen.kt): `app/src/main/java/com/example/ui/screens/EcoBudgetScreen.kt`
- [Month navigator](https://github.com/doukfama/ecobudget-kmp/blob/master/app/src/main/java/com/example/ui/components/MonthNavigatorBar.kt): `app/src/main/java/com/example/ui/components/MonthNavigatorBar.kt`
- [Transaction card](https://github.com/doukfama/ecobudget-kmp/blob/master/app/src/main/java/com/example/ui/components/TransactionCard.kt): `app/src/main/java/com/example/ui/components/TransactionCard.kt`
- [Add transaction](https://github.com/doukfama/ecobudget-kmp/blob/master/app/src/main/java/com/example/ui/components/AddTransactionDialog.kt): `app/src/main/java/com/example/ui/components/AddTransactionDialog.kt`
- [UI theme](https://github.com/doukfama/ecobudget-kmp/blob/master/app/src/main/java/com/example/ui/theme/Theme.kt): `app/src/main/java/com/example/ui/theme/Theme.kt`

### Shared domain

- [Budget view model](https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/viewmodel/EcoBudgetViewModel.kt): `shared/src/commonMain/kotlin/com/example/viewmodel/EcoBudgetViewModel.kt`
- [Budget UI state](https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/viewmodel/EcoBudgetUiState.kt): `shared/src/commonMain/kotlin/com/example/viewmodel/EcoBudgetUiState.kt`
- [Transaction model](https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/model/Transaction.kt): `shared/src/commonMain/kotlin/com/example/model/Transaction.kt`
- [Category model](https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/model/Category.kt): `shared/src/commonMain/kotlin/com/example/model/Category.kt`
- [Month model](https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/model/YearMonth.kt): `shared/src/commonMain/kotlin/com/example/model/YearMonth.kt`
- [Category strings](https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/resources/CategoryResources.kt): `shared/src/commonMain/kotlin/com/example/resources/CategoryResources.kt`

### Shared data

- [Transaction repository](https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/data/repository/TransactionRepository.kt): `shared/src/commonMain/kotlin/com/example/data/repository/TransactionRepository.kt`
- [Fake transaction data](https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/data/repository/FakeTransactionRepository.kt): `shared/src/commonMain/kotlin/com/example/data/repository/FakeTransactionRepository.kt`

### Platform services

- [UUID abstraction](https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/utils/UUID.kt): `shared/src/commonMain/kotlin/com/example/utils/UUID.kt`
- [Time abstraction](https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/commonMain/kotlin/com/example/utils/Time.kt): `shared/src/commonMain/kotlin/com/example/utils/Time.kt`
- [Android UUID](https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/androidMain/kotlin/com/example/utils/UUID.kt): `shared/src/androidMain/kotlin/com/example/utils/UUID.kt`
- [iOS UUID](https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/iosMain/kotlin/com/example/utils/UUID.kt): `shared/src/iosMain/kotlin/com/example/utils/UUID.kt`
- [Android clock](https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/androidMain/kotlin/com/example/utils/Time.kt): `shared/src/androidMain/kotlin/com/example/utils/Time.kt`
- [iOS clock](https://github.com/doukfama/ecobudget-kmp/blob/master/shared/src/iosMain/kotlin/com/example/utils/Time.kt): `shared/src/iosMain/kotlin/com/example/utils/Time.kt`

### Other components

- **User**

## Connections

- User → Main activity: opens app
- Main activity → Budget screen: hosts screen
- Budget screen → Budget view model: uses shared state
- Budget screen → Month navigator: shows navigation
- Budget screen → Transaction card: shows transactions
- Budget screen → Add transaction: offers entry
- Budget screen → UI theme: uses styling
- Budget view model → Budget UI state: updates state
- Budget view model → Transaction repository: uses repository
- Fake transaction data → Transaction repository: implements
- Fake transaction data → Transaction model: stores models
- Transaction model → UUID abstraction: generates ID
- Fake transaction data → Time abstraction: uses clock
- Android UUID → UUID abstraction: implements
- iOS UUID → UUID abstraction: implements
- Android clock → Time abstraction: implements
- iOS clock → Time abstraction: implements
- Month model → Transaction model: supports date grouping
- Category strings → Category model: maps labels
