# oquendocharles336-gif/melai-nuts-retail architecture

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

- Interactive diagram: https://gitdiagram.com/oquendocharles336-gif/melai-nuts-retail
- Repository: https://github.com/oquendocharles336-gif/melai-nuts-retail

## Overview

Melai Nuts is a Flutter prototype for a multi-role nuts business app. The tree indicates authentication and portals for customers, staff, delivery, inventory, and owners, plus commerce, operational, and reporting screens. Its principal user journey appears to be sign-in, enter a role-specific portal, and use that role’s workflows; the customer screens suggest browsing products through cart and checkout. README calls it a prototype and documents Firebase configuration. Dart implementation excerpts were not provided, so internal calls and data ownership cannot be confirmed; the graph shows product areas without inventing their wiring.

Main entry points: [`lib/app/app.dart`](https://github.com/oquendocharles336-gif/melai-nuts-retail/blob/main/lib/app/app.dart) (App shell), [`lib/main.dart`](https://github.com/oquendocharles336-gif/melai-nuts-retail/blob/main/lib/main.dart) (Flutter entry), [`lib/features/auth/screens`](https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/auth/screens) (Sign-in screens), [`lib/core/services/auth_service.dart`](https://github.com/oquendocharles336-gif/melai-nuts-retail/blob/main/lib/core/services/auth_service.dart) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry"]
  node_main["Flutter entry<br/>[main.dart]"]
  node_app["App shell<br/>[app.dart]"]
  node_routes["Route map<br/>[routes.dart]"]
  node_guard["Route guard<br/>[route_guard.dart]"]
end

subgraph group_identity["Identity"]
  node_authui["Sign-in screens"]
  node_authsvc["Authentication<br/>[auth_service.dart]"]
end

subgraph group_customer["Customer commerce"]
  node_customerui["Customer workflows"]
  node_cart["Cart controller"]
  node_payments["Payment flow"]
  node_refunds["Refund flow"]
end

subgraph group_operations["Business operations"]
  node_products["Product management"]
  node_staff["Staff POS"]
  node_inventory["Inventory screens"]
  node_delivery["Delivery workflows"]
  node_ocr["OCR workflows"]
  node_notifications["Notifications"]
  node_sync["Data synchronization"]
end

subgraph group_insight["Management insight"]
  node_owner["Owner reporting"]
end

node_user(("App user"))
node_firebase{{"Firebase services"}}

node_user -->|"opens"| node_main
node_main -->|"starts"| node_app
node_app -->|"uses routes"| node_routes
node_app -->|"guards navigation"| node_guard
node_user -->|"signs in"| node_authui
node_authui -->|"authenticates"| node_authsvc
node_authsvc -.->|"uses Firebase"| node_firebase
node_user -->|"shops"| node_customerui
node_customerui -->|"manages cart"| node_cart
node_user -->|"pays"| node_payments
node_user -->|"requests refund"| node_refunds
node_user -->|"uses POS"| node_staff
node_user -->|"manages products"| node_products
node_user -->|"manages stock"| node_inventory
node_user -->|"manages deliveries"| node_delivery
node_user -->|"scans records"| node_ocr
node_user -->|"views alerts"| node_notifications
node_user -->|"reviews performance"| node_owner

click node_main "https://github.com/oquendocharles336-gif/melai-nuts-retail/blob/main/lib/main.dart"
click node_app "https://github.com/oquendocharles336-gif/melai-nuts-retail/blob/main/lib/app/app.dart"
click node_routes "https://github.com/oquendocharles336-gif/melai-nuts-retail/blob/main/lib/app/routes.dart"
click node_guard "https://github.com/oquendocharles336-gif/melai-nuts-retail/blob/main/lib/app/route_guard.dart"
click node_authui "https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/auth/screens"
click node_authsvc "https://github.com/oquendocharles336-gif/melai-nuts-retail/blob/main/lib/core/services/auth_service.dart"
click node_customerui "https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/customer/screens"
click node_cart "https://github.com/oquendocharles336-gif/melai-nuts-retail/blob/main/lib/features/customer/cart_controller.dart"
click node_payments "https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/payments/screens"
click node_refunds "https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/refunds/screens"
click node_products "https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/products/screens"
click node_staff "https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/staff/screens"
click node_inventory "https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/inventory/screens"
click node_delivery "https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/delivery/screens"
click node_ocr "https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/ocr/screens"
click node_notifications "https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/notifications/screens"
click node_sync "https://github.com/oquendocharles336-gif/melai-nuts-retail/blob/main/lib/core/services/data_sync_service.dart"
click node_owner "https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/owner/screens"

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_main,node_app,node_routes,node_guard,node_user toneBlue
class node_authui,node_authsvc toneAmber
class node_customerui,node_cart,node_payments,node_refunds toneMint
class node_products,node_staff,node_inventory,node_delivery,node_ocr,node_notifications,node_sync toneRose
class node_owner,node_firebase toneIndigo
```

## Components

### App entry

- [Flutter entry](https://github.com/oquendocharles336-gif/melai-nuts-retail/blob/main/lib/main.dart): `lib/main.dart`
- [App shell](https://github.com/oquendocharles336-gif/melai-nuts-retail/blob/main/lib/app/app.dart): `lib/app/app.dart`
- [Route map](https://github.com/oquendocharles336-gif/melai-nuts-retail/blob/main/lib/app/routes.dart): `lib/app/routes.dart`
- [Route guard](https://github.com/oquendocharles336-gif/melai-nuts-retail/blob/main/lib/app/route_guard.dart): `lib/app/route_guard.dart`

### Identity

- [Sign-in screens](https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/auth/screens): `lib/features/auth/screens`
- [Authentication](https://github.com/oquendocharles336-gif/melai-nuts-retail/blob/main/lib/core/services/auth_service.dart): `lib/core/services/auth_service.dart`

### Customer commerce

- [Customer workflows](https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/customer/screens): `lib/features/customer/screens`
- [Cart controller](https://github.com/oquendocharles336-gif/melai-nuts-retail/blob/main/lib/features/customer/cart_controller.dart): `lib/features/customer/cart_controller.dart`
- [Payment flow](https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/payments/screens): `lib/features/payments/screens`
- [Refund flow](https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/refunds/screens): `lib/features/refunds/screens`

### Business operations

- [Product management](https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/products/screens): `lib/features/products/screens`
- [Staff POS](https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/staff/screens): `lib/features/staff/screens`
- [Inventory screens](https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/inventory/screens): `lib/features/inventory/screens`
- [Delivery workflows](https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/delivery/screens): `lib/features/delivery/screens`
- [OCR workflows](https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/ocr/screens): `lib/features/ocr/screens`
- [Notifications](https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/notifications/screens): `lib/features/notifications/screens`
- [Data synchronization](https://github.com/oquendocharles336-gif/melai-nuts-retail/blob/main/lib/core/services/data_sync_service.dart): `lib/core/services/data_sync_service.dart`

### Management insight

- [Owner reporting](https://github.com/oquendocharles336-gif/melai-nuts-retail/tree/main/lib/features/owner/screens): `lib/features/owner/screens`

### Other components

- **App user**
- **Firebase services**

## Connections

- App user → Flutter entry: opens
- Flutter entry → App shell: starts
- App shell → Route map: uses routes
- App shell → Route guard: guards navigation
- App user → Sign-in screens: signs in
- Sign-in screens → Authentication: authenticates
- Authentication → Firebase services: uses Firebase
- App user → Customer workflows: shops
- Customer workflows → Cart controller: manages cart
- App user → Payment flow: pays
- App user → Refund flow: requests refund
- App user → Staff POS: uses POS
- App user → Product management: manages products
- App user → Inventory screens: manages stock
- App user → Delivery workflows: manages deliveries
- App user → OCR workflows: scans records
- App user → Notifications: views alerts
- App user → Owner reporting: reviews performance
