# adel-khaled-dev/dhakan architecture

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

- Interactive diagram: https://gitdiagram.com/adel-khaled-dev/dhakan
- Repository: https://github.com/adel-khaled-dev/dhakan

## Overview

This is a Flutter app named “pos”; the README describes it only as a new Flutter project. The Dart tree indicates a point-of-sale workflow alongside inventory management and a dashboard, but the Dart implementations were not sampled, so their connections are shown as unverified rather than asserted. The platform runner files host the Flutter app; sampled native code supports that role, not POS domain behavior.

Main entry points: [`lib/features/inventory/presentation/pages/inventory.dart`](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/inventory/presentation/pages/inventory.dart) (Inventory screen), [`lib/features/pos/presentation/pages/pos.dart`](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/pos/presentation/pages/pos.dart) (POS screen), [`lib/main.dart`](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/main.dart) (App entry), [`lib/features/pos/presentation/pages/payment.dart`](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/pos/presentation/pages/payment.dart) (Payment screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Flutter app"]
  node_entry["App entry<br/>[main.dart]"]
  node_router["App routing<br/>[app_router.dart]"]
end

subgraph group_sales["Point of sale"]
  node_pos["POS screen<br/>[pos.dart]"]
  node_basket["Basket UI"]
  node_checkout["Checkout data<br/>[checkout_data.dart]"]
  node_payment["Payment screen<br/>[payment.dart]"]
  node_invoice["Invoice screen<br/>[invoice.dart]"]
  node_payment_done["Payment result<br/>[payment_ok.dart]"]
end

subgraph group_stock["Inventory"]
  node_inventory["Inventory screen<br/>[inventory.dart]"]
  node_inventory_state["Inventory state"]
  node_product_logic["Product logic<br/>[logic_product.dart]"]
  node_add_product["Add product<br/>[add_product.dart]"]
  node_edit_product["Update product"]
  node_categories["Categories<br/>[categories.dart]"]
end

subgraph group_insights["Dashboard"]
  node_dashboard["Dashboard<br/>[dashboard.dart]"]
  node_operations["Dashboard operations<br/>[operations.dart]"]
  node_low_stock["Low stock logic<br/>[low_stock.dart]"]
  node_alerts[("Inventory alerts")]
end

subgraph group_platform["Platform runners"]
  node_windows_runner["Windows runner<br/>[main.cpp]"]
  node_windows_window["Windows Flutter window<br/>[flutter_window.cpp]"]
  node_win32_window["Win32 window host<br/>[win32_window.cpp]"]
  node_linux_runner["Linux runner<br/>[main.cc]"]
  node_linux_app["Linux application<br/>[my_application.cc]"]
  node_ios_runner["iOS runner<br/>[AppDelegate.swift]"]
end

node_user(("Staff user"))

node_user -.->|"opens app"| node_entry
node_entry -.->|"routes via"| node_router
node_router -.->|"routes to"| node_pos
node_pos -.->|"shows basket"| node_basket
node_pos -.->|"uses checkout"| node_checkout
node_pos -.->|"opens inventory"| node_inventory
node_checkout -.->|"continues to"| node_payment
node_payment -.->|"shows result"| node_payment_done
node_payment -.->|"shows invoice"| node_invoice
node_inventory -.->|"uses state"| node_inventory_state
node_inventory_state -.->|"uses logic"| node_product_logic
node_inventory -.->|"adds products"| node_add_product
node_inventory -.->|"updates products"| node_edit_product
node_inventory -.->|"manages categories"| node_categories
node_entry -.->|"routes to"| node_dashboard
node_dashboard -.->|"uses operations"| node_operations
node_dashboard -.->|"checks stock"| node_low_stock
node_low_stock -.->|"uses alerts"| node_alerts
node_windows_runner -->|"creates window"| node_windows_window
node_windows_window -->|"extends host"| node_win32_window
node_linux_runner -->|"runs application"| node_linux_app

click node_entry "https://github.com/adel-khaled-dev/dhakan/blob/main/lib/main.dart"
click node_router "https://github.com/adel-khaled-dev/dhakan/blob/main/lib/core/router/app_router.dart"
click node_pos "https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/pos/presentation/pages/pos.dart"
click node_basket "https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/pos/presentation/widgets/containar_basket.dart"
click node_checkout "https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/pos/data/model/checkout_data.dart"
click node_payment "https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/pos/presentation/pages/payment.dart"
click node_invoice "https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/pos/presentation/pages/invoice.dart"
click node_payment_done "https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/pos/presentation/pages/payment_ok.dart"
click node_inventory "https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/inventory/presentation/pages/inventory.dart"
click node_inventory_state "https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/inventory/presentation/cubit/inventory_cubit.dart"
click node_product_logic "https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/inventory/domain/logic_product.dart"
click node_add_product "https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/inventory/presentation/pages/add_product.dart"
click node_edit_product "https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/inventory/presentation/pages/update_product.dart"
click node_categories "https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/inventory/presentation/pages/categories.dart"
click node_dashboard "https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/dashboard/presentation/pages/dashboard.dart"
click node_operations "https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/dashboard/data/sources/operation/operations.dart"
click node_low_stock "https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/dashboard/domain/low_stock.dart"
click node_alerts "https://github.com/adel-khaled-dev/dhakan/blob/main/lib/core/database/inventory_alerts.dart"
click node_windows_runner "https://github.com/adel-khaled-dev/dhakan/blob/main/windows/runner/main.cpp"
click node_windows_window "https://github.com/adel-khaled-dev/dhakan/blob/main/windows/runner/flutter_window.cpp"
click node_win32_window "https://github.com/adel-khaled-dev/dhakan/blob/main/windows/runner/win32_window.cpp"
click node_linux_runner "https://github.com/adel-khaled-dev/dhakan/blob/main/linux/runner/main.cc"
click node_linux_app "https://github.com/adel-khaled-dev/dhakan/blob/main/linux/runner/my_application.cc"
click node_ios_runner "https://github.com/adel-khaled-dev/dhakan/blob/main/ios/Runner/AppDelegate.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_entry,node_router,node_user toneBlue
class node_pos,node_basket,node_checkout,node_payment,node_invoice,node_payment_done toneAmber
class node_inventory,node_inventory_state,node_product_logic,node_add_product,node_edit_product,node_categories toneMint
class node_dashboard,node_operations,node_low_stock,node_alerts toneRose
class node_windows_runner,node_windows_window,node_win32_window,node_linux_runner,node_linux_app,node_ios_runner toneIndigo
```

## Components

### Flutter app

- [App entry](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/main.dart): `lib/main.dart`
- [App routing](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/core/router/app_router.dart): `lib/core/router/app_router.dart`

### Point of sale

- [POS screen](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/pos/presentation/pages/pos.dart): `lib/features/pos/presentation/pages/pos.dart`
- [Basket UI](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/pos/presentation/widgets/containar_basket.dart): `lib/features/pos/presentation/widgets/containar_basket.dart`
- [Checkout data](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/pos/data/model/checkout_data.dart): `lib/features/pos/data/model/checkout_data.dart`
- [Payment screen](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/pos/presentation/pages/payment.dart): `lib/features/pos/presentation/pages/payment.dart`
- [Invoice screen](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/pos/presentation/pages/invoice.dart): `lib/features/pos/presentation/pages/invoice.dart`
- [Payment result](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/pos/presentation/pages/payment_ok.dart): `lib/features/pos/presentation/pages/payment_ok.dart`

### Inventory

- [Inventory screen](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/inventory/presentation/pages/inventory.dart): `lib/features/inventory/presentation/pages/inventory.dart`
- [Inventory state](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/inventory/presentation/cubit/inventory_cubit.dart): `lib/features/inventory/presentation/cubit/inventory_cubit.dart`
- [Product logic](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/inventory/domain/logic_product.dart): `lib/features/inventory/domain/logic_product.dart`
- [Add product](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/inventory/presentation/pages/add_product.dart): `lib/features/inventory/presentation/pages/add_product.dart`
- [Update product](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/inventory/presentation/pages/update_product.dart): `lib/features/inventory/presentation/pages/update_product.dart`
- [Categories](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/inventory/presentation/pages/categories.dart): `lib/features/inventory/presentation/pages/categories.dart`

### Dashboard

- [Dashboard](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/dashboard/presentation/pages/dashboard.dart): `lib/features/dashboard/presentation/pages/dashboard.dart`
- [Dashboard operations](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/dashboard/data/sources/operation/operations.dart): `lib/features/dashboard/data/sources/operation/operations.dart`
- [Low stock logic](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/features/dashboard/domain/low_stock.dart): `lib/features/dashboard/domain/low_stock.dart`
- [Inventory alerts](https://github.com/adel-khaled-dev/dhakan/blob/main/lib/core/database/inventory_alerts.dart): `lib/core/database/inventory_alerts.dart`

### Platform runners

- [Windows runner](https://github.com/adel-khaled-dev/dhakan/blob/main/windows/runner/main.cpp): `windows/runner/main.cpp`
- [Windows Flutter window](https://github.com/adel-khaled-dev/dhakan/blob/main/windows/runner/flutter_window.cpp): `windows/runner/flutter_window.cpp`
- [Win32 window host](https://github.com/adel-khaled-dev/dhakan/blob/main/windows/runner/win32_window.cpp): `windows/runner/win32_window.cpp`
- [Linux runner](https://github.com/adel-khaled-dev/dhakan/blob/main/linux/runner/main.cc): `linux/runner/main.cc`
- [Linux application](https://github.com/adel-khaled-dev/dhakan/blob/main/linux/runner/my_application.cc): `linux/runner/my_application.cc`
- [iOS runner](https://github.com/adel-khaled-dev/dhakan/blob/main/ios/Runner/AppDelegate.swift): `ios/Runner/AppDelegate.swift`

### Other components

- **Staff user**

## Connections

- Staff user → App entry: opens app
- App entry → App routing: routes via
- App routing → POS screen: routes to
- POS screen → Basket UI: shows basket
- POS screen → Checkout data: uses checkout
- POS screen → Inventory screen: opens inventory
- Checkout data → Payment screen: continues to
- Payment screen → Payment result: shows result
- Payment screen → Invoice screen: shows invoice
- Inventory screen → Inventory state: uses state
- Inventory state → Product logic: uses logic
- Inventory screen → Add product: adds products
- Inventory screen → Update product: updates products
- Inventory screen → Categories: manages categories
- App entry → Dashboard: routes to
- Dashboard → Dashboard operations: uses operations
- Dashboard → Low stock logic: checks stock
- Low stock logic → Inventory alerts: uses alerts
- Windows runner → Windows Flutter window: creates window (evidence: `windows/runner/main.cpp`)
- Windows Flutter window → Win32 window host: extends host
- Linux runner → Linux application: runs application (evidence: `linux/runner/main.cc`)
