# avatgit/inventory-lite architecture

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

- Interactive diagram: https://gitdiagram.com/avatgit/inventory-lite
- Repository: https://github.com/avatgit/inventory-lite

## Overview

This is a Flutter inventory app. The tree indicates a workflow for viewing a catalog, editing products, scanning barcodes, and recording stock movements, backed by repository implementations and providers. The README is only Flutter starter text, and the available source excerpts cover platform runners rather than Dart runtime code; therefore, relationships among inventory components are shown as unverified, and their exact call flow cannot be confirmed.

Main entry points: [`lib/providers/catalog_providers.dart`](https://github.com/avatgit/inventory-lite/blob/main/lib/providers/catalog_providers.dart) (Catalog providers), [`lib/presentation/screens/catalog_screen.dart`](https://github.com/avatgit/inventory-lite/blob/main/lib/presentation/screens/catalog_screen.dart) (Product catalog), [`lib/data/repositories/product_repository.dart`](https://github.com/avatgit/inventory-lite/blob/main/lib/data/repositories/product_repository.dart) (Product repository contract), [`lib/data/repositories/category_repository.dart`](https://github.com/avatgit/inventory-lite/blob/main/lib/data/repositories/category_repository.dart) (Category repository contract)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Inventory UI"]
  node_app["Flutter app entry<br/>[main.dart]"]
  node_shell["Main navigation<br/>[main_shell.dart]"]
  node_home["Home screen<br/>[home_screen.dart]"]
  node_catalog["Product catalog"]
  node_edit["Product editor"]
  node_movement["Stock movement entry"]
  node_scanner["Barcode scanner"]
  node_card["Product card<br/>[product_card.dart]"]
end

subgraph group_state["App State"]
  node_providers["Catalog providers"]
end

subgraph group_domain["Inventory Data"]
  node_product["Product model<br/>[product.dart]"]
  node_category["Category model<br/>[category.dart]"]
  node_stock["Stock movement model"]
end

subgraph group_storage["Data Sources"]
  node_prepos["Product repository contract"]
  node_crepos["Category repository contract"]
  node_srepos["Movement repository contract"]
  node_firestore["Firestore repositories"]
  node_mock["Mock repositories"]
  node_mockdata["Mock inventory data<br/>[mock_data.dart]"]
end

node_user(("Inventory user"))

node_user -.->|"opens"| node_app
node_app -.->|"starts"| node_shell
node_shell -.->|"navigates"| node_home
node_shell -.->|"navigates"| node_catalog
node_catalog -.->|"edits products"| node_edit
node_catalog -.->|"renders"| node_card
node_catalog -.->|"scans barcodes"| node_scanner
node_home -.->|"records stock"| node_movement
node_catalog -.->|"uses state"| node_providers
node_edit -.->|"uses state"| node_providers
node_movement -.->|"uses state"| node_providers
node_providers -.->|"uses products"| node_prepos
node_providers -.->|"uses categories"| node_crepos
node_providers -.->|"uses movements"| node_srepos
node_prepos -.->|"implemented by"| node_firestore
node_crepos -.->|"implemented by"| node_firestore
node_srepos -.->|"implemented by"| node_firestore
node_prepos -.->|"implemented by"| node_mock
node_crepos -.->|"implemented by"| node_mock
node_mock -.->|"uses sample data"| node_mockdata
node_prepos -.->|"handles"| node_product
node_crepos -.->|"handles"| node_category
node_srepos -.->|"handles"| node_stock

click node_app "https://github.com/avatgit/inventory-lite/blob/main/lib/main.dart"
click node_shell "https://github.com/avatgit/inventory-lite/blob/main/lib/presentation/screens/main_shell.dart"
click node_home "https://github.com/avatgit/inventory-lite/blob/main/lib/presentation/screens/home_screen.dart"
click node_catalog "https://github.com/avatgit/inventory-lite/blob/main/lib/presentation/screens/catalog_screen.dart"
click node_edit "https://github.com/avatgit/inventory-lite/blob/main/lib/presentation/screens/add_edit_product_screen.dart"
click node_movement "https://github.com/avatgit/inventory-lite/blob/main/lib/presentation/screens/add_movement_screen.dart"
click node_scanner "https://github.com/avatgit/inventory-lite/blob/main/lib/presentation/screens/barcode_scanner_screen.dart"
click node_card "https://github.com/avatgit/inventory-lite/blob/main/lib/presentation/widgets/product_card.dart"
click node_providers "https://github.com/avatgit/inventory-lite/blob/main/lib/providers/catalog_providers.dart"
click node_product "https://github.com/avatgit/inventory-lite/blob/main/lib/data/models/product.dart"
click node_category "https://github.com/avatgit/inventory-lite/blob/main/lib/data/models/category.dart"
click node_stock "https://github.com/avatgit/inventory-lite/blob/main/lib/data/models/stock_movement.dart"
click node_prepos "https://github.com/avatgit/inventory-lite/blob/main/lib/data/repositories/product_repository.dart"
click node_crepos "https://github.com/avatgit/inventory-lite/blob/main/lib/data/repositories/category_repository.dart"
click node_srepos "https://github.com/avatgit/inventory-lite/blob/main/lib/data/repositories/stock_movement_repository.dart"
click node_firestore "https://github.com/avatgit/inventory-lite/tree/main/lib/data/repositories"
click node_mock "https://github.com/avatgit/inventory-lite/tree/main/lib/data/repositories"
click node_mockdata "https://github.com/avatgit/inventory-lite/blob/main/lib/data/mock/mock_data.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_app,node_shell,node_home,node_catalog,node_edit,node_movement,node_scanner,node_card,node_user toneBlue
class node_providers toneAmber
class node_product,node_category,node_stock toneMint
class node_prepos,node_crepos,node_srepos,node_firestore,node_mock,node_mockdata toneRose
```

## Components

### Inventory UI

- [Flutter app entry](https://github.com/avatgit/inventory-lite/blob/main/lib/main.dart): `lib/main.dart`
- [Main navigation](https://github.com/avatgit/inventory-lite/blob/main/lib/presentation/screens/main_shell.dart): `lib/presentation/screens/main_shell.dart`
- [Home screen](https://github.com/avatgit/inventory-lite/blob/main/lib/presentation/screens/home_screen.dart): `lib/presentation/screens/home_screen.dart`
- [Product catalog](https://github.com/avatgit/inventory-lite/blob/main/lib/presentation/screens/catalog_screen.dart): `lib/presentation/screens/catalog_screen.dart`
- [Product editor](https://github.com/avatgit/inventory-lite/blob/main/lib/presentation/screens/add_edit_product_screen.dart): `lib/presentation/screens/add_edit_product_screen.dart`
- [Stock movement entry](https://github.com/avatgit/inventory-lite/blob/main/lib/presentation/screens/add_movement_screen.dart): `lib/presentation/screens/add_movement_screen.dart`
- [Barcode scanner](https://github.com/avatgit/inventory-lite/blob/main/lib/presentation/screens/barcode_scanner_screen.dart): `lib/presentation/screens/barcode_scanner_screen.dart`
- [Product card](https://github.com/avatgit/inventory-lite/blob/main/lib/presentation/widgets/product_card.dart): `lib/presentation/widgets/product_card.dart`

### App State

- [Catalog providers](https://github.com/avatgit/inventory-lite/blob/main/lib/providers/catalog_providers.dart): `lib/providers/catalog_providers.dart`

### Inventory Data

- [Product model](https://github.com/avatgit/inventory-lite/blob/main/lib/data/models/product.dart): `lib/data/models/product.dart`
- [Category model](https://github.com/avatgit/inventory-lite/blob/main/lib/data/models/category.dart): `lib/data/models/category.dart`
- [Stock movement model](https://github.com/avatgit/inventory-lite/blob/main/lib/data/models/stock_movement.dart): `lib/data/models/stock_movement.dart`

### Data Sources

- [Product repository contract](https://github.com/avatgit/inventory-lite/blob/main/lib/data/repositories/product_repository.dart): `lib/data/repositories/product_repository.dart`
- [Category repository contract](https://github.com/avatgit/inventory-lite/blob/main/lib/data/repositories/category_repository.dart): `lib/data/repositories/category_repository.dart`
- [Movement repository contract](https://github.com/avatgit/inventory-lite/blob/main/lib/data/repositories/stock_movement_repository.dart): `lib/data/repositories/stock_movement_repository.dart`
- [Firestore repositories](https://github.com/avatgit/inventory-lite/tree/main/lib/data/repositories): `lib/data/repositories`
- [Mock repositories](https://github.com/avatgit/inventory-lite/tree/main/lib/data/repositories): `lib/data/repositories`
- [Mock inventory data](https://github.com/avatgit/inventory-lite/blob/main/lib/data/mock/mock_data.dart): `lib/data/mock/mock_data.dart`

### Other components

- **Inventory user**

## Connections

- Inventory user → Flutter app entry: opens
- Flutter app entry → Main navigation: starts
- Main navigation → Home screen: navigates
- Main navigation → Product catalog: navigates
- Product catalog → Product editor: edits products
- Product catalog → Product card: renders
- Product catalog → Barcode scanner: scans barcodes
- Home screen → Stock movement entry: records stock
- Product catalog → Catalog providers: uses state
- Product editor → Catalog providers: uses state
- Stock movement entry → Catalog providers: uses state
- Catalog providers → Product repository contract: uses products
- Catalog providers → Category repository contract: uses categories
- Catalog providers → Movement repository contract: uses movements
- Product repository contract → Firestore repositories: implemented by
- Category repository contract → Firestore repositories: implemented by
- Movement repository contract → Firestore repositories: implemented by
- Product repository contract → Mock repositories: implemented by
- Category repository contract → Mock repositories: implemented by
- Mock repositories → Mock inventory data: uses sample data
- Product repository contract → Product model: handles
- Category repository contract → Category model: handles
- Movement repository contract → Stock movement model: handles
