# rehyanyadav/gear_stock architecture

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

- Interactive diagram: https://gitdiagram.com/rehyanyadav/gear_stock
- Repository: https://github.com/rehyanyadav/gear_stock

## Overview

GearStock is a Flutter inventory app for bicycle-parts shops. Shop staff sign in, manage catalog and suppliers, record stock movements or scan barcodes, then review dashboard and report views. The app stores inventory locally and synchronizes it with Supabase. The graph preserves the README’s documented capabilities and uses paths from the repository tree; Dart implementation details were not sampled, so feature-to-feature calls are omitted. Native desktop and plugin-host nodes reflect the sampled platform entry-point code, not the inventory workflow.

Main entry points: [`lib/database/app_database.dart`](https://github.com/rehyanyadav/gear_stock/blob/main/lib/database/app_database.dart) (Local inventory), [`lib/features/products/data/products_notifier.dart`](https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/products/data/products_notifier.dart) (Products), [`windows/runner/win32_window.cpp`](https://github.com/rehyanyadav/gear_stock/blob/main/windows/runner/win32_window.cpp) (Win32 window), [`windows/runner/main.cpp`](https://github.com/rehyanyadav/gear_stock/blob/main/windows/runner/main.cpp) (Windows entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inventory["Inventory workflows"]
  node_auth["Authentication"]
  node_products["Products"]
  node_categories["Categories"]
  node_suppliers["Suppliers"]
  node_stock["Stock movements"]
  node_barcode["Barcode scanning"]
  node_dashboard["Dashboard"]
  node_reports["Inventory reports"]
  node_pdf["PDF export"]
end

subgraph group_data["Data and sync"]
  node_image_sync["Product image sync"]
  node_sync["Synchronization<br/>[sync_runner.dart]"]
  node_queue["Sync queue"]
  node_local_db[("Local inventory<br/>[app_database.dart]")]
  node_supabase[("Supabase")]
end

subgraph group_experience["App experience"]
  node_localization["Localization<br/>[app_en.arb]"]
  node_theme["Theme settings"]
end

subgraph group_platform["Platform hosts"]
  node_windows_entry["Windows entry<br/>[main.cpp]"]
  node_flutter_window["Flutter window<br/>[flutter_window.h]"]
  node_win32_window["Win32 window<br/>[win32_window.cpp]"]
  node_windows_header["Window interface<br/>[win32_window.h]"]
  node_linux_entry["Linux entry<br/>[main.cc]"]
  node_linux_app["Linux application<br/>[my_application.h]"]
  node_linux_plugins["Linux plugins"]
  node_linux_plugin_api["Linux plugin API"]
  node_windows_plugins["Windows plugins"]
  node_windows_plugin_api["Windows plugin API"]
  node_macos_plugins["macOS plugins"]
end

node_staff(("Shop staff"))

node_staff -->|"signs in"| node_auth
node_staff -->|"manages products"| node_products
node_staff -->|"manages categories"| node_categories
node_staff -->|"manages suppliers"| node_suppliers
node_staff -->|"records movements"| node_stock
node_staff -->|"scans barcodes"| node_barcode
node_staff -->|"views dashboard"| node_dashboard
node_staff -->|"reviews reports"| node_reports
node_reports -.->|"exports PDF"| node_pdf
node_products -->|"stores inventory"| node_local_db
node_stock -->|"stores inventory"| node_local_db
node_suppliers -->|"stores inventory"| node_local_db
node_local_db -->|"synchronizes data"| node_sync
node_sync -->|"syncs with"| node_supabase
node_auth -->|"authenticates with"| node_supabase
node_products -.->|"manages images"| node_image_sync
node_staff -->|"uses language"| node_localization
node_staff -->|"selects theme"| node_theme
node_windows_entry -->|"creates window"| node_flutter_window
node_flutter_window -->|"extends window"| node_win32_window
node_windows_entry -->|"creates window"| node_win32_window
node_win32_window -->|"implements interface"| node_windows_header
node_linux_entry -->|"creates application"| node_linux_app
node_linux_plugins -->|"declares registration"| node_linux_plugin_api
node_windows_plugins -->|"declares registration"| node_windows_plugin_api

click node_auth "https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/auth/data/supabase_auth_repo.dart"
click node_products "https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/products/data/products_notifier.dart"
click node_categories "https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/categories/data/categories_notifier.dart"
click node_suppliers "https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/suppliers/data/suppliers_notifier.dart"
click node_stock "https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/stock/data/stock_notifier.dart"
click node_barcode "https://github.com/rehyanyadav/gear_stock/blob/main/lib/screens/barcode_scanner_screen.dart"
click node_dashboard "https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/dashboard/presentation/dashboard_screen.dart"
click node_reports "https://github.com/rehyanyadav/gear_stock/blob/main/lib/screens/reports_screen.dart"
click node_pdf "https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/reports/data/inventory_pdf_exporter.dart"
click node_image_sync "https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/products/data/product_image_sync_service.dart"
click node_sync "https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/sync/data/sync_runner.dart"
click node_queue "https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/sync/data/sync_queue_repository.dart"
click node_local_db "https://github.com/rehyanyadav/gear_stock/blob/main/lib/database/app_database.dart"
click node_localization "https://github.com/rehyanyadav/gear_stock/blob/main/lib/l10n/app_en.arb"
click node_theme "https://github.com/rehyanyadav/gear_stock/blob/main/lib/theme/theme_mode_provider.dart"
click node_windows_entry "https://github.com/rehyanyadav/gear_stock/blob/main/windows/runner/main.cpp"
click node_flutter_window "https://github.com/rehyanyadav/gear_stock/blob/main/windows/runner/flutter_window.h"
click node_win32_window "https://github.com/rehyanyadav/gear_stock/blob/main/windows/runner/win32_window.cpp"
click node_windows_header "https://github.com/rehyanyadav/gear_stock/blob/main/windows/runner/win32_window.h"
click node_linux_entry "https://github.com/rehyanyadav/gear_stock/blob/main/linux/runner/main.cc"
click node_linux_app "https://github.com/rehyanyadav/gear_stock/blob/main/linux/runner/my_application.h"
click node_linux_plugins "https://github.com/rehyanyadav/gear_stock/blob/main/linux/flutter/generated_plugin_registrant.cc"
click node_linux_plugin_api "https://github.com/rehyanyadav/gear_stock/blob/main/linux/flutter/generated_plugin_registrant.h"
click node_windows_plugins "https://github.com/rehyanyadav/gear_stock/blob/main/windows/flutter/generated_plugin_registrant.cc"
click node_windows_plugin_api "https://github.com/rehyanyadav/gear_stock/blob/main/windows/flutter/generated_plugin_registrant.h"
click node_macos_plugins "https://github.com/rehyanyadav/gear_stock/blob/main/macos/Flutter/GeneratedPluginRegistrant.swift"

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_auth,node_products,node_categories,node_suppliers,node_stock,node_barcode,node_dashboard,node_reports,node_pdf toneBlue
class node_image_sync,node_sync,node_queue,node_local_db,node_supabase toneAmber
class node_localization,node_theme toneMint
class node_windows_entry,node_flutter_window,node_win32_window,node_windows_header,node_linux_entry,node_linux_app,node_linux_plugins,node_linux_plugin_api,node_windows_plugins,node_windows_plugin_api,node_macos_plugins toneRose
class node_staff toneIndigo
```

## Components

### Inventory workflows

- [Authentication](https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/auth/data/supabase_auth_repo.dart): `lib/features/auth/data/supabase_auth_repo.dart`
- [Products](https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/products/data/products_notifier.dart): `lib/features/products/data/products_notifier.dart`
- [Categories](https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/categories/data/categories_notifier.dart): `lib/features/categories/data/categories_notifier.dart`
- [Suppliers](https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/suppliers/data/suppliers_notifier.dart): `lib/features/suppliers/data/suppliers_notifier.dart`
- [Stock movements](https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/stock/data/stock_notifier.dart): `lib/features/stock/data/stock_notifier.dart`
- [Barcode scanning](https://github.com/rehyanyadav/gear_stock/blob/main/lib/screens/barcode_scanner_screen.dart): `lib/screens/barcode_scanner_screen.dart`
- [Dashboard](https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/dashboard/presentation/dashboard_screen.dart): `lib/features/dashboard/presentation/dashboard_screen.dart`
- [Inventory reports](https://github.com/rehyanyadav/gear_stock/blob/main/lib/screens/reports_screen.dart): `lib/screens/reports_screen.dart`
- [PDF export](https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/reports/data/inventory_pdf_exporter.dart): `lib/features/reports/data/inventory_pdf_exporter.dart`

### Data and sync

- [Product image sync](https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/products/data/product_image_sync_service.dart): `lib/features/products/data/product_image_sync_service.dart`
- [Synchronization](https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/sync/data/sync_runner.dart): `lib/features/sync/data/sync_runner.dart`
- [Sync queue](https://github.com/rehyanyadav/gear_stock/blob/main/lib/features/sync/data/sync_queue_repository.dart): `lib/features/sync/data/sync_queue_repository.dart`
- [Local inventory](https://github.com/rehyanyadav/gear_stock/blob/main/lib/database/app_database.dart): `lib/database/app_database.dart`
- **Supabase**

### App experience

- [Localization](https://github.com/rehyanyadav/gear_stock/blob/main/lib/l10n/app_en.arb): `lib/l10n/app_en.arb`
- [Theme settings](https://github.com/rehyanyadav/gear_stock/blob/main/lib/theme/theme_mode_provider.dart): `lib/theme/theme_mode_provider.dart`

### Platform hosts

- [Windows entry](https://github.com/rehyanyadav/gear_stock/blob/main/windows/runner/main.cpp): `windows/runner/main.cpp`
- [Flutter window](https://github.com/rehyanyadav/gear_stock/blob/main/windows/runner/flutter_window.h): `windows/runner/flutter_window.h`
- [Win32 window](https://github.com/rehyanyadav/gear_stock/blob/main/windows/runner/win32_window.cpp): `windows/runner/win32_window.cpp`
- [Window interface](https://github.com/rehyanyadav/gear_stock/blob/main/windows/runner/win32_window.h): `windows/runner/win32_window.h`
- [Linux entry](https://github.com/rehyanyadav/gear_stock/blob/main/linux/runner/main.cc): `linux/runner/main.cc`
- [Linux application](https://github.com/rehyanyadav/gear_stock/blob/main/linux/runner/my_application.h): `linux/runner/my_application.h`
- [Linux plugins](https://github.com/rehyanyadav/gear_stock/blob/main/linux/flutter/generated_plugin_registrant.cc): `linux/flutter/generated_plugin_registrant.cc`
- [Linux plugin API](https://github.com/rehyanyadav/gear_stock/blob/main/linux/flutter/generated_plugin_registrant.h): `linux/flutter/generated_plugin_registrant.h`
- [Windows plugins](https://github.com/rehyanyadav/gear_stock/blob/main/windows/flutter/generated_plugin_registrant.cc): `windows/flutter/generated_plugin_registrant.cc`
- [Windows plugin API](https://github.com/rehyanyadav/gear_stock/blob/main/windows/flutter/generated_plugin_registrant.h): `windows/flutter/generated_plugin_registrant.h`
- [macOS plugins](https://github.com/rehyanyadav/gear_stock/blob/main/macos/Flutter/GeneratedPluginRegistrant.swift): `macos/Flutter/GeneratedPluginRegistrant.swift`

### Other components

- **Shop staff**

## Connections

- Shop staff → Authentication: signs in (evidence: `README.md`)
- Shop staff → Products: manages products (evidence: `README.md`)
- Shop staff → Categories: manages categories (evidence: `README.md`)
- Shop staff → Suppliers: manages suppliers (evidence: `README.md`)
- Shop staff → Stock movements: records movements (evidence: `README.md`)
- Shop staff → Barcode scanning: scans barcodes (evidence: `README.md`)
- Shop staff → Dashboard: views dashboard (evidence: `README.md`)
- Shop staff → Inventory reports: reviews reports (evidence: `README.md`)
- Inventory reports → PDF export: exports PDF
- Products → Local inventory: stores inventory (evidence: `README.md`)
- Stock movements → Local inventory: stores inventory (evidence: `README.md`)
- Suppliers → Local inventory: stores inventory (evidence: `README.md`)
- Local inventory → Synchronization: synchronizes data (evidence: `README.md`)
- Synchronization → Supabase: syncs with (evidence: `README.md`)
- Authentication → Supabase: authenticates with (evidence: `README.md`)
- Products → Product image sync: manages images
- Shop staff → Localization: uses language (evidence: `README.md`)
- Shop staff → Theme settings: selects theme (evidence: `README.md`)
- Windows entry → Flutter window: creates window (evidence: `windows/runner/main.cpp`)
- Flutter window → Win32 window: extends window (evidence: `windows/runner/flutter_window.h`)
- Windows entry → Win32 window: creates window (evidence: `windows/runner/main.cpp`)
- Win32 window → Window interface: implements interface (evidence: `windows/runner/win32_window.h`)
- Linux entry → Linux application: creates application (evidence: `linux/runner/main.cc`)
- Linux plugins → Linux plugin API: declares registration (evidence: `linux/flutter/generated_plugin_registrant.cc`)
- Windows plugins → Windows plugin API: declares registration (evidence: `windows/flutter/generated_plugin_registrant.cc`)
