# orange-pos/orangeone architecture

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

- Interactive diagram: https://gitdiagram.com/orange-pos/orangeone
- Repository: https://github.com/orange-pos/orangeone

## Overview

OrangeONE is a Flutter inventory app for Android and iOS, using Riverpod, GoRouter, and Odoo JSON-RPC. The documented user flow is QR-based sign-in, then barcode lookup: known products open details and unknown barcodes prefill product creation. Product workflows also include price updates and editing product name and tax. The graph reflects README-documented architecture and capabilities; Dart implementation excerpts were not provided, so specific internal call relationships are not asserted.

Main entry points: [`lib/app/view/app.dart`](https://github.com/orange-pos/orangeone/blob/main/lib/app/view/app.dart) (App composition), [`lib/features/home/domain/use_cases/lookup_product.dart`](https://github.com/orange-pos/orangeone/blob/main/lib/features/home/domain/use_cases/lookup_product.dart) (Product lookup), [`lib/features/authentication/data/repositories/odoo_auth_repository.dart`](https://github.com/orange-pos/orangeone/blob/main/lib/features/authentication/data/repositories/odoo_auth_repository.dart) (Odoo auth repository), [`lib/features/authentication/data/data_sources/auth_remote_data_source.dart`](https://github.com/orange-pos/orangeone/blob/main/lib/features/authentication/data/data_sources/auth_remote_data_source.dart) (Auth remote source)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_app["App composition<br/>[app.dart]"]
  node_router["Navigation<br/>[app_router.dart]"]
  node_init["Initialization"]
end

subgraph group_auth["Authentication"]
  node_authui["QR sign-in<br/>[qr_login_page.dart]"]
  node_authflow["QR authentication"]
  node_authrepo["Odoo auth repository"]
  node_authremote["Auth remote source"]
end

subgraph group_inventory["Inventory lookup"]
  node_home["Inventory home<br/>[home_page.dart]"]
  node_scanner["Barcode scanner"]
  node_lookup["Product lookup"]
  node_productrepo["Product repository"]
  node_productremote["Product remote source"]
end

subgraph group_products["Product management"]
  node_details["Product details"]
  node_create["Product creation"]
  node_createcase["Create product operation"]
  node_edit["Product editing"]
  node_price["Price update"]
end

subgraph group_platform["Shared infrastructure"]
  node_session["Secure session store<br/>[secret_store.dart]"]
  node_config["Environment configuration"]
  node_rpc["JSON-RPC transport"]
end

node_user(("Mobile user"))
node_odoo{{"Odoo"}}

node_user -->|"opens"| node_app
node_app -->|"initializes"| node_init
node_app -->|"navigates"| node_router
node_user -->|"signs in"| node_authui
node_authui -->|"authenticates"| node_authflow
node_authflow -->|"uses"| node_authrepo
node_authrepo -->|"accesses"| node_authremote
node_authremote -->|"uses JSON-RPC"| node_odoo
node_authrepo -->|"stores session"| node_session
node_user -->|"continues to"| node_home
node_home -->|"starts lookup"| node_scanner
node_scanner -->|"submits barcode"| node_lookup
node_lookup -->|"requests product"| node_productrepo
node_productrepo -->|"uses"| node_productremote
node_productremote -->|"looks up product"| node_odoo
node_lookup -->|"opens match"| node_details
node_lookup -->|"prefills unknown"| node_create
node_create -->|"creates product"| node_createcase
node_user -->|"edits product"| node_edit
node_user -->|"updates price"| node_price
node_app -->|"loads settings"| node_config
node_productremote -->|"transports requests"| node_rpc
node_authremote -->|"transports requests"| node_rpc

click node_app "https://github.com/orange-pos/orangeone/blob/main/lib/app/view/app.dart"
click node_router "https://github.com/orange-pos/orangeone/blob/main/lib/app/router/app_router.dart"
click node_init "https://github.com/orange-pos/orangeone/blob/main/lib/features/initialization/presentation/pages/initialization_page.dart"
click node_authui "https://github.com/orange-pos/orangeone/blob/main/lib/features/authentication/presentation/pages/qr_login_page.dart"
click node_authflow "https://github.com/orange-pos/orangeone/blob/main/lib/features/authentication/domain/use_cases/authenticate_with_qr.dart"
click node_authrepo "https://github.com/orange-pos/orangeone/blob/main/lib/features/authentication/data/repositories/odoo_auth_repository.dart"
click node_authremote "https://github.com/orange-pos/orangeone/blob/main/lib/features/authentication/data/data_sources/auth_remote_data_source.dart"
click node_session "https://github.com/orange-pos/orangeone/blob/main/lib/core/storage/secret_store.dart"
click node_home "https://github.com/orange-pos/orangeone/blob/main/lib/features/home/presentation/pages/home_page.dart"
click node_scanner "https://github.com/orange-pos/orangeone/blob/main/lib/features/home/presentation/pages/product_scanner_page.dart"
click node_lookup "https://github.com/orange-pos/orangeone/blob/main/lib/features/home/domain/use_cases/lookup_product.dart"
click node_productrepo "https://github.com/orange-pos/orangeone/blob/main/lib/features/home/data/repositories/odoo_product_repository.dart"
click node_productremote "https://github.com/orange-pos/orangeone/blob/main/lib/features/home/data/data_sources/product_remote_data_source.dart"
click node_details "https://github.com/orange-pos/orangeone/blob/main/lib/features/products/presentation/pages/product_details_page.dart"
click node_create "https://github.com/orange-pos/orangeone/blob/main/lib/features/products/presentation/pages/product_creation_page.dart"
click node_createcase "https://github.com/orange-pos/orangeone/blob/main/lib/features/products/domain/use_cases/create_product.dart"
click node_edit "https://github.com/orange-pos/orangeone/blob/main/lib/features/products/presentation/pages/product_edit_page.dart"
click node_price "https://github.com/orange-pos/orangeone/blob/main/lib/features/products/presentation/pages/product_price_update_page.dart"
click node_config "https://github.com/orange-pos/orangeone/blob/main/lib/core/config/environment_loader.dart"
click node_rpc "https://github.com/orange-pos/orangeone/blob/main/lib/core/network/json_rpc_client.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_router,node_init,node_user toneBlue
class node_authui,node_authflow,node_authrepo,node_authremote toneAmber
class node_home,node_scanner,node_lookup,node_productrepo,node_productremote toneMint
class node_details,node_create,node_createcase,node_edit,node_price toneRose
class node_session,node_config,node_rpc,node_odoo toneIndigo
```

## Components

### App shell

- [App composition](https://github.com/orange-pos/orangeone/blob/main/lib/app/view/app.dart): `lib/app/view/app.dart`
- [Navigation](https://github.com/orange-pos/orangeone/blob/main/lib/app/router/app_router.dart): `lib/app/router/app_router.dart`
- [Initialization](https://github.com/orange-pos/orangeone/blob/main/lib/features/initialization/presentation/pages/initialization_page.dart): `lib/features/initialization/presentation/pages/initialization_page.dart`

### Authentication

- [QR sign-in](https://github.com/orange-pos/orangeone/blob/main/lib/features/authentication/presentation/pages/qr_login_page.dart): `lib/features/authentication/presentation/pages/qr_login_page.dart`
- [QR authentication](https://github.com/orange-pos/orangeone/blob/main/lib/features/authentication/domain/use_cases/authenticate_with_qr.dart): `lib/features/authentication/domain/use_cases/authenticate_with_qr.dart`
- [Odoo auth repository](https://github.com/orange-pos/orangeone/blob/main/lib/features/authentication/data/repositories/odoo_auth_repository.dart): `lib/features/authentication/data/repositories/odoo_auth_repository.dart`
- [Auth remote source](https://github.com/orange-pos/orangeone/blob/main/lib/features/authentication/data/data_sources/auth_remote_data_source.dart): `lib/features/authentication/data/data_sources/auth_remote_data_source.dart`

### Inventory lookup

- [Inventory home](https://github.com/orange-pos/orangeone/blob/main/lib/features/home/presentation/pages/home_page.dart): `lib/features/home/presentation/pages/home_page.dart`
- [Barcode scanner](https://github.com/orange-pos/orangeone/blob/main/lib/features/home/presentation/pages/product_scanner_page.dart): `lib/features/home/presentation/pages/product_scanner_page.dart`
- [Product lookup](https://github.com/orange-pos/orangeone/blob/main/lib/features/home/domain/use_cases/lookup_product.dart): `lib/features/home/domain/use_cases/lookup_product.dart`
- [Product repository](https://github.com/orange-pos/orangeone/blob/main/lib/features/home/data/repositories/odoo_product_repository.dart): `lib/features/home/data/repositories/odoo_product_repository.dart`
- [Product remote source](https://github.com/orange-pos/orangeone/blob/main/lib/features/home/data/data_sources/product_remote_data_source.dart): `lib/features/home/data/data_sources/product_remote_data_source.dart`

### Product management

- [Product details](https://github.com/orange-pos/orangeone/blob/main/lib/features/products/presentation/pages/product_details_page.dart): `lib/features/products/presentation/pages/product_details_page.dart`
- [Product creation](https://github.com/orange-pos/orangeone/blob/main/lib/features/products/presentation/pages/product_creation_page.dart): `lib/features/products/presentation/pages/product_creation_page.dart`
- [Create product operation](https://github.com/orange-pos/orangeone/blob/main/lib/features/products/domain/use_cases/create_product.dart): `lib/features/products/domain/use_cases/create_product.dart`
- [Product editing](https://github.com/orange-pos/orangeone/blob/main/lib/features/products/presentation/pages/product_edit_page.dart): `lib/features/products/presentation/pages/product_edit_page.dart`
- [Price update](https://github.com/orange-pos/orangeone/blob/main/lib/features/products/presentation/pages/product_price_update_page.dart): `lib/features/products/presentation/pages/product_price_update_page.dart`

### Shared infrastructure

- [Secure session store](https://github.com/orange-pos/orangeone/blob/main/lib/core/storage/secret_store.dart): `lib/core/storage/secret_store.dart`
- [Environment configuration](https://github.com/orange-pos/orangeone/blob/main/lib/core/config/environment_loader.dart): `lib/core/config/environment_loader.dart`
- [JSON-RPC transport](https://github.com/orange-pos/orangeone/blob/main/lib/core/network/json_rpc_client.dart): `lib/core/network/json_rpc_client.dart`

### Other components

- **Mobile user**
- **Odoo**

## Connections

- Mobile user → App composition: opens (evidence: `README.md`)
- App composition → Initialization: initializes (evidence: `README.md`)
- App composition → Navigation: navigates (evidence: `README.md`)
- Mobile user → QR sign-in: signs in (evidence: `README.md`)
- QR sign-in → QR authentication: authenticates (evidence: `README.md`)
- QR authentication → Odoo auth repository: uses (evidence: `README.md`)
- Odoo auth repository → Auth remote source: accesses (evidence: `README.md`)
- Auth remote source → Odoo: uses JSON-RPC (evidence: `README.md`)
- Odoo auth repository → Secure session store: stores session (evidence: `README.md`)
- Mobile user → Inventory home: continues to (evidence: `README.md`)
- Inventory home → Barcode scanner: starts lookup (evidence: `README.md`)
- Barcode scanner → Product lookup: submits barcode (evidence: `README.md`)
- Product lookup → Product repository: requests product (evidence: `README.md`)
- Product repository → Product remote source: uses (evidence: `README.md`)
- Product remote source → Odoo: looks up product (evidence: `README.md`)
- Product lookup → Product details: opens match (evidence: `README.md`)
- Product lookup → Product creation: prefills unknown (evidence: `README.md`)
- Product creation → Create product operation: creates product (evidence: `README.md`)
- Mobile user → Product editing: edits product (evidence: `README.md`)
- Mobile user → Price update: updates price (evidence: `README.md`)
- App composition → Environment configuration: loads settings (evidence: `README.md`)
- Product remote source → JSON-RPC transport: transports requests (evidence: `README.md`)
- Auth remote source → JSON-RPC transport: transports requests (evidence: `README.md`)
