# xcaim04/tusolution architecture

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

- Interactive diagram: https://gitdiagram.com/xcaim04/tusolution
- Repository: https://github.com/xcaim04/tusolution

## Overview

Tu Solution is an offline Android repair-shop management app. A user works through the Flutter shell into dashboard, order, inventory, or history screens; the presentation layer exposes state through Riverpod ViewModels and providers, while domain contracts and data code implement operations backed by on-device SQLite. The README documents order assignment, status changes, work and parts, derived totals, inventory, and history as core capabilities. Edges below reflect that documented architecture; the sampled source excerpts do not include the Dart runtime, so specific call paths are not independently verified.

Main entry points: [`lib/presentation/screens`](https://github.com/xcaim04/tusolution/tree/main/lib/presentation/screens) (Screen views), [`lib/data/repository_impl.dart`](https://github.com/xcaim04/tusolution/blob/main/lib/data/repository_impl.dart) (Repository implementation), [`lib/app.dart`](https://github.com/xcaim04/tusolution/blob/main/lib/app.dart) (App shell), [`lib/data/database.dart`](https://github.com/xcaim04/tusolution/blob/main/lib/data/database.dart) (SQLite database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Presentation"]
  node_entry["App entry<br/>[main.dart]"]
  node_shell["App shell<br/>[app.dart]"]
  node_providers["Providers<br/>[providers.dart]"]
  node_screens["Screen views"]
  node_dashboard_vm["Dashboard state"]
  node_orders_vm["Order state"]
  node_new_order_vm["New order state"]
  node_history_vm["History state"]
  node_inventory_vm["Inventory state"]
end

subgraph group_domain["Domain"]
  node_domain_contract["Repository contract<br/>[repository.dart]"]
  node_domain_rules["Order rules<br/>[order_status.dart]"]
  node_domain_models["Domain models<br/>[models.dart]"]
end

subgraph group_data["Data"]
  node_repo_impl["Repository implementation"]
  node_dao["Drift queries<br/>[dao.dart]"]
  node_database[("SQLite database<br/>[database.dart]")]
  node_tables["Database tables<br/>[tables.dart]"]
  node_seed["Demo data seed<br/>[seed.dart]"]
end

subgraph group_platform["Platform"]
  node_flutter["Flutter host<br/>[MainActivity.kt]"]
end

node_user(("Workshop user"))

node_user -->|"uses"| node_shell
node_flutter -.->|"hosts"| node_entry
node_entry -->|"starts"| node_shell
node_shell -->|"navigates"| node_screens
node_screens -->|"presents state"| node_dashboard_vm
node_screens -->|"presents state"| node_orders_vm
node_screens -->|"presents state"| node_new_order_vm
node_screens -->|"presents state"| node_history_vm
node_screens -->|"presents state"| node_inventory_vm
node_providers -->|"provides repository"| node_repo_impl
node_providers -->|"runs seed"| node_seed
node_repo_impl -->|"implements"| node_domain_contract
node_repo_impl -->|"uses queries"| node_dao
node_repo_impl -->|"enforces"| node_domain_rules
node_repo_impl -->|"uses models"| node_domain_models
node_dao -->|"queries"| node_database
node_database -->|"stores"| node_tables
node_seed -->|"inserts demo data"| node_database

click node_flutter "https://github.com/xcaim04/tusolution/blob/main/android/app/src/main/kotlin/com/tusolution/tu_solution/MainActivity.kt"
click node_entry "https://github.com/xcaim04/tusolution/blob/main/lib/main.dart"
click node_shell "https://github.com/xcaim04/tusolution/blob/main/lib/app.dart"
click node_providers "https://github.com/xcaim04/tusolution/blob/main/lib/presentation/providers.dart"
click node_screens "https://github.com/xcaim04/tusolution/tree/main/lib/presentation/screens"
click node_dashboard_vm "https://github.com/xcaim04/tusolution/blob/main/lib/presentation/viewmodels/dashboard_viewmodel.dart"
click node_orders_vm "https://github.com/xcaim04/tusolution/blob/main/lib/presentation/viewmodels/orders_viewmodel.dart"
click node_new_order_vm "https://github.com/xcaim04/tusolution/blob/main/lib/presentation/viewmodels/new_order_viewmodel.dart"
click node_history_vm "https://github.com/xcaim04/tusolution/blob/main/lib/presentation/viewmodels/history_viewmodel.dart"
click node_inventory_vm "https://github.com/xcaim04/tusolution/blob/main/lib/presentation/viewmodels/inventory_viewmodel.dart"
click node_domain_contract "https://github.com/xcaim04/tusolution/blob/main/lib/domain/repository.dart"
click node_domain_rules "https://github.com/xcaim04/tusolution/blob/main/lib/domain/order_status.dart"
click node_domain_models "https://github.com/xcaim04/tusolution/blob/main/lib/domain/models.dart"
click node_repo_impl "https://github.com/xcaim04/tusolution/blob/main/lib/data/repository_impl.dart"
click node_dao "https://github.com/xcaim04/tusolution/blob/main/lib/data/dao.dart"
click node_database "https://github.com/xcaim04/tusolution/blob/main/lib/data/database.dart"
click node_tables "https://github.com/xcaim04/tusolution/blob/main/lib/data/tables.dart"
click node_seed "https://github.com/xcaim04/tusolution/blob/main/lib/data/seed.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_shell,node_providers,node_screens,node_dashboard_vm,node_orders_vm,node_new_order_vm,node_history_vm,node_inventory_vm,node_user toneBlue
class node_domain_contract,node_domain_rules,node_domain_models toneAmber
class node_repo_impl,node_dao,node_database,node_tables,node_seed toneMint
class node_flutter toneRose
```

## Components

### Presentation

- [App entry](https://github.com/xcaim04/tusolution/blob/main/lib/main.dart): `lib/main.dart`
- [App shell](https://github.com/xcaim04/tusolution/blob/main/lib/app.dart): `lib/app.dart`
- [Providers](https://github.com/xcaim04/tusolution/blob/main/lib/presentation/providers.dart): `lib/presentation/providers.dart`
- [Screen views](https://github.com/xcaim04/tusolution/tree/main/lib/presentation/screens): `lib/presentation/screens`
- [Dashboard state](https://github.com/xcaim04/tusolution/blob/main/lib/presentation/viewmodels/dashboard_viewmodel.dart): `lib/presentation/viewmodels/dashboard_viewmodel.dart`
- [Order state](https://github.com/xcaim04/tusolution/blob/main/lib/presentation/viewmodels/orders_viewmodel.dart): `lib/presentation/viewmodels/orders_viewmodel.dart`
- [New order state](https://github.com/xcaim04/tusolution/blob/main/lib/presentation/viewmodels/new_order_viewmodel.dart): `lib/presentation/viewmodels/new_order_viewmodel.dart`
- [History state](https://github.com/xcaim04/tusolution/blob/main/lib/presentation/viewmodels/history_viewmodel.dart): `lib/presentation/viewmodels/history_viewmodel.dart`
- [Inventory state](https://github.com/xcaim04/tusolution/blob/main/lib/presentation/viewmodels/inventory_viewmodel.dart): `lib/presentation/viewmodels/inventory_viewmodel.dart`

### Domain

- [Repository contract](https://github.com/xcaim04/tusolution/blob/main/lib/domain/repository.dart): `lib/domain/repository.dart`
- [Order rules](https://github.com/xcaim04/tusolution/blob/main/lib/domain/order_status.dart): `lib/domain/order_status.dart`
- [Domain models](https://github.com/xcaim04/tusolution/blob/main/lib/domain/models.dart): `lib/domain/models.dart`

### Data

- [Repository implementation](https://github.com/xcaim04/tusolution/blob/main/lib/data/repository_impl.dart): `lib/data/repository_impl.dart`
- [Drift queries](https://github.com/xcaim04/tusolution/blob/main/lib/data/dao.dart): `lib/data/dao.dart`
- [SQLite database](https://github.com/xcaim04/tusolution/blob/main/lib/data/database.dart): `lib/data/database.dart`
- [Database tables](https://github.com/xcaim04/tusolution/blob/main/lib/data/tables.dart): `lib/data/tables.dart`
- [Demo data seed](https://github.com/xcaim04/tusolution/blob/main/lib/data/seed.dart): `lib/data/seed.dart`

### Platform

- [Flutter host](https://github.com/xcaim04/tusolution/blob/main/android/app/src/main/kotlin/com/tusolution/tu_solution/MainActivity.kt): `android/app/src/main/kotlin/com/tusolution/tu_solution/MainActivity.kt`

### Other components

- **Workshop user**

## Connections

- Workshop user → App shell: uses (evidence: `README.md`)
- Flutter host → App entry: hosts
- App entry → App shell: starts (evidence: `README.md`)
- App shell → Screen views: navigates (evidence: `README.md`)
- Screen views → Dashboard state: presents state (evidence: `README.md`)
- Screen views → Order state: presents state (evidence: `README.md`)
- Screen views → New order state: presents state (evidence: `README.md`)
- Screen views → History state: presents state (evidence: `README.md`)
- Screen views → Inventory state: presents state (evidence: `README.md`)
- Providers → Repository implementation: provides repository (evidence: `README.md`)
- Providers → Demo data seed: runs seed (evidence: `README.md`)
- Repository implementation → Repository contract: implements (evidence: `README.md`)
- Repository implementation → Drift queries: uses queries (evidence: `README.md`)
- Repository implementation → Order rules: enforces (evidence: `README.md`)
- Repository implementation → Domain models: uses models (evidence: `README.md`)
- Drift queries → SQLite database: queries (evidence: `README.md`)
- SQLite database → Database tables: stores (evidence: `README.md`)
- Demo data seed → SQLite database: inserts demo data (evidence: `README.md`)
