# niazi876/online-grocery-shopping-app architecture

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

- Interactive diagram: https://gitdiagram.com/niazi876/online-grocery-shopping-app
- Repository: https://github.com/niazi876/online-grocery-shopping-app

## Overview

Online Grocery is a Flutter grocery-shopping UI. Its user journey spans onboarding and authentication, product discovery and detail viewing, cart management and checkout, then profile and favorites. README documents BLoC state management and shared UI foundations, but Dart source excerpts were not provided, so the graph shows only documented relationships; detailed screen-to-state calls and checkout internals remain unverified.

Main entry points: [`lib/main.dart`](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/main.dart) (App entry), [`lib/screens/main_shell.dart`](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/screens/main_shell.dart) (Main navigation), [`lib/router/app_router.dart`](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/router/app_router.dart) (App routes), [`lib/screens/home_screen.dart`](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/screens/home_screen.dart) (Home browsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Shopping experience"]
  node_entry["App entry<br/>[main.dart]"]
  node_routes["App routes<br/>[app_router.dart]"]
  node_onboarding["Onboarding"]
  node_auth["Authentication<br/>[auth_screen.dart]"]
  node_home["Home browsing<br/>[home_screen.dart]"]
  node_explore["Category browsing"]
  node_detail["Product details"]
  node_cart["Cart and checkout<br/>[cart_screen.dart]"]
  node_profile["Profile and favorites"]
  node_shell["Main navigation<br/>[main_shell.dart]"]
end

subgraph group_state["App state and data"]
  node_auth_state["Auth state<br/>[auth_bloc.dart]"]
  node_cart_state["Cart state<br/>[cart_bloc.dart]"]
  node_product_state["Product state<br/>[product_bloc.dart]"]
  node_product_model["Product model<br/>[product_model.dart]"]
end

subgraph group_foundation["Shared UI foundation"]
  node_theme["Design theme<br/>[app_theme.dart]"]
  node_widgets["Reusable widgets"]
end

node_shopper(("Shopper"))

node_shopper -->|"opens app"| node_entry
node_entry -->|"uses routes"| node_routes
node_routes -.->|"routes to"| node_onboarding
node_routes -.->|"routes to"| node_auth
node_routes -.->|"routes to"| node_shell
node_shell -.->|"presents"| node_home
node_shell -.->|"presents"| node_explore
node_home -.->|"opens products"| node_detail
node_explore -.->|"opens products"| node_detail
node_shell -.->|"presents"| node_cart
node_shell -.->|"presents"| node_profile
node_entry -->|"provides state"| node_auth_state
node_entry -->|"provides state"| node_cart_state
node_entry -->|"provides state"| node_product_state
node_product_state -.->|"manages products"| node_product_model
node_entry -.->|"sets theme"| node_theme
node_home -.->|"reuses UI"| node_widgets

click node_entry "https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/main.dart"
click node_routes "https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/router/app_router.dart"
click node_onboarding "https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/screens/onboarding_screen.dart"
click node_auth "https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/screens/auth_screen.dart"
click node_home "https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/screens/home_screen.dart"
click node_explore "https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/screens/explore_screen.dart"
click node_detail "https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/screens/product_detail_screen.dart"
click node_cart "https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/screens/cart_screen.dart"
click node_profile "https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/screens/profile_screen.dart"
click node_shell "https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/screens/main_shell.dart"
click node_auth_state "https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/bloc/auth_bloc.dart"
click node_cart_state "https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/bloc/cart_bloc.dart"
click node_product_state "https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/bloc/product_bloc.dart"
click node_product_model "https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/models/product_model.dart"
click node_theme "https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/theme/app_theme.dart"
click node_widgets "https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/widgets/common_widgets.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_entry,node_routes,node_onboarding,node_auth,node_home,node_explore,node_detail,node_cart,node_profile,node_shell toneBlue
class node_auth_state,node_cart_state,node_product_state,node_product_model toneAmber
class node_theme,node_widgets toneMint
class node_shopper toneIndigo
```

## Components

### Shopping experience

- [App entry](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/main.dart): `lib/main.dart`
- [App routes](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/router/app_router.dart): `lib/router/app_router.dart`
- [Onboarding](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/screens/onboarding_screen.dart): `lib/screens/onboarding_screen.dart`
- [Authentication](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/screens/auth_screen.dart): `lib/screens/auth_screen.dart`
- [Home browsing](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/screens/home_screen.dart): `lib/screens/home_screen.dart`
- [Category browsing](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/screens/explore_screen.dart): `lib/screens/explore_screen.dart`
- [Product details](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/screens/product_detail_screen.dart): `lib/screens/product_detail_screen.dart`
- [Cart and checkout](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/screens/cart_screen.dart): `lib/screens/cart_screen.dart`
- [Profile and favorites](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/screens/profile_screen.dart): `lib/screens/profile_screen.dart`
- [Main navigation](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/screens/main_shell.dart): `lib/screens/main_shell.dart`

### App state and data

- [Auth state](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/bloc/auth_bloc.dart): `lib/bloc/auth_bloc.dart`
- [Cart state](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/bloc/cart_bloc.dart): `lib/bloc/cart_bloc.dart`
- [Product state](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/bloc/product_bloc.dart): `lib/bloc/product_bloc.dart`
- [Product model](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/models/product_model.dart): `lib/models/product_model.dart`

### Shared UI foundation

- [Design theme](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/theme/app_theme.dart): `lib/theme/app_theme.dart`
- [Reusable widgets](https://github.com/niazi876/online-grocery-shopping-app/blob/main/lib/widgets/common_widgets.dart): `lib/widgets/common_widgets.dart`

### Other components

- **Shopper**

## Connections

- Shopper → App entry: opens app (evidence: `README.md`)
- App entry → App routes: uses routes (evidence: `README.md`)
- App routes → Onboarding: routes to
- App routes → Authentication: routes to
- App routes → Main navigation: routes to
- Main navigation → Home browsing: presents
- Main navigation → Category browsing: presents
- Home browsing → Product details: opens products
- Category browsing → Product details: opens products
- Main navigation → Cart and checkout: presents
- Main navigation → Profile and favorites: presents
- App entry → Auth state: provides state (evidence: `README.md`)
- App entry → Cart state: provides state (evidence: `README.md`)
- App entry → Product state: provides state (evidence: `README.md`)
- Product state → Product model: manages products
- App entry → Design theme: sets theme
- Home browsing → Reusable widgets: reuses UI
