# shanmukht9/nike-ecommerce architecture

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

- Interactive diagram: https://gitdiagram.com/shanmukht9/nike-ecommerce
- Repository: https://github.com/shanmukht9/nike-ecommerce

## Overview

#### Purpose and Entry Points
This is a Flutter client for a Nike-style ecommerce flow: introductory landing, product browsing, cart management, and bottom-tab navigation. The Dart application starts at `lib/main.dart`; platform launchers embed the Flutter runtime on Android, iOS, desktop, and web.

#### Application Composition
`lib/main.dart` establishes the widget tree and application-level state wiring. Screen-level flow is separated into:
- Intro/landing: `lib/pages/intro_page.dart`
- Main shell/home navigation: `lib/pages/home_page.dart`
- Product catalog: `lib/pages/shop_page.dart`
- Cart view: `lib/pages/cart_page.dart`

The likely primary transition is intro → home shell, then tab-driven switching between shop and cart.

#### Domain State Boundary
The cart is the central mutable domain model in `lib/models/cart.dart`; products are represented by `lib/models/shoe.dart`. Product data and cart mutations should remain behind this model boundary rather than be duplicated in page widgets. UI consumes shoe records, adds/removes them through cart state, and renders the resulting collection.

#### Presentation Components
Reusable widgets isolate repeated ecommerce UI from page orchestration:
- Catalog/product card: `lib/components/shoe_tile.dart`
- Cart line item: `lib/components/cart_item.dart`
- Application navigation: `lib/components/bottom_nav_bar.dart`

Pages compose these components around model data. This creates a clear boundary between route/tab ownership, reusable rendering, and domain state.

#### Primary Data and Control Flow
1. `lib/main.dart` launches Flutter and supplies the app/root state.
2. `lib/pages/intro_page.dart` initiates entry into the shopping experience.
3. `lib/pages/home_page.dart` owns selected navigation state and chooses the active content page.
4. `lib/pages/shop_page.dart` reads available `Shoe` data and requests cart additions.
5. `lib/models/cart.dart` updates cart contents and notifies dependent UI through the project’s Flutter state-management mechanism.
6. `lib/pages/cart_page.dart` renders cart state with `lib/components/cart_item.dart`; navigation remains controlled by the home shell and `lib/components/bottom_nav_bar.dart`.

#### Runtime and Platform Infrastructure
Flutter/Dart is the application runtime, declared through `pubspec.yaml`. Native host projects package the same Dart UI for Android (`android/app/src/main/kotlin/com/example/nike_ecommerce/MainActivity.kt`), iOS (`ios/Runner/AppDelegate.swift`), macOS, Linux, Windows, and web (`web/index.html`). The tree contains no evidence of a backend, payment processor, authentication provider, remote API, or persistence service; catalog and cart behavior appear client-local.

#### Assets and Delivery Boundaries
Application image assets are expected under `lib/images`, while platform-specific icons, splash/launch configuration, signing/build behavior, and host lifecycle remain in native project directories. Android Gradle configuration begins at `android/app/build.gradle.kts`; iOS packaging is represented by `ios/Runner.xcodeproj`. These hosts should not contain business or presentation logic except platform integration requirements.

Main entry points: [`lib/main.dart`](https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/main.dart) (App entry & state wiring), [`lib/pages/home_page.dart`](https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/pages/home_page.dart) (Home shell), [`lib/models/cart.dart`](https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/models/cart.dart) (Cart state), [`lib/pages/shop_page.dart`](https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/pages/shop_page.dart) (Product catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flutter["Flutter client"]
  node_flutter_runtime{{"Flutter/Dart runtime<br/>[pubspec.yaml]"}}
  node_main["App entry &amp; state wiring<br/>application entry<br/>[main.dart]"]
  node_intro["Intro landing<br/>page<br/>[intro_page.dart]"]
  node_home["Home shell<br/>navigation shell<br/>[home_page.dart]"]
  node_shop["Product catalog<br/>page<br/>[shop_page.dart]"]
  node_cart_page["Cart view<br/>page<br/>[cart_page.dart]"]
  node_bottom_nav["Bottom navigation<br/>reusable widget"]
  node_shoe_tile["Product card<br/>reusable widget<br/>[shoe_tile.dart]"]
  node_cart_item["Cart line item<br/>reusable widget<br/>[cart_item.dart]"]
  node_cart_model[("Cart state<br/>domain model<br/>[cart.dart]")]
  node_shoe["Shoe<br/>domain model<br/>[shoe.dart]"]
  node_images["Product image assets"]
end

subgraph group_platforms["Platform hosts"]
  node_android_host["Android host<br/>native launcher<br/>[MainActivity.kt]"]
  node_ios_host["iOS host<br/>native launcher<br/>[AppDelegate.swift]"]
  node_desktop_hosts["Desktop hosts<br/>native launchers"]
  node_web_host["Web host<br/>web launcher<br/>[index.html]"]
  node_android_build["Android build<br/>build configuration<br/>[build.gradle.kts]"]
  node_ios_project["iOS project<br/>packaging project<br/>[Runner.xcodeproj]"]
end

node_flutter_runtime -->|"runs"| node_main
node_android_host -->|"launches"| node_main
node_ios_host -->|"launches"| node_main
node_desktop_hosts -->|"launches"| node_main
node_web_host -->|"loads"| node_main
node_android_build -.->|"packages"| node_android_host
node_ios_project -.->|"packages"| node_ios_host
node_main -->|"starts at"| node_intro
node_main -->|"provides state"| node_cart_model
node_intro -->|"enters shopping"| node_home
node_home -->|"composes"| node_bottom_nav
node_bottom_nav -->|"selects tab"| node_home
node_home -->|"shows shop tab"| node_shop
node_home -->|"shows cart tab"| node_cart_page
node_shop -->|"renders"| node_shoe_tile
node_shop -->|"reads products; adds items"| node_cart_model
node_cart_model -->|"manages records"| node_shoe
node_shoe_tile -->|"displays"| node_shoe
node_shoe_tile -->|"uses"| node_images
node_cart_page -->|"observes and mutates"| node_cart_model
node_cart_page -->|"renders"| node_cart_item
node_cart_item -->|"displays"| node_shoe

click node_flutter_runtime "https://github.com/shanmukht9/nike-ecommerce/blob/main/pubspec.yaml"
click node_main "https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/main.dart"
click node_intro "https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/pages/intro_page.dart"
click node_home "https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/pages/home_page.dart"
click node_shop "https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/pages/shop_page.dart"
click node_cart_page "https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/pages/cart_page.dart"
click node_bottom_nav "https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/components/bottom_nav_bar.dart"
click node_shoe_tile "https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/components/shoe_tile.dart"
click node_cart_item "https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/components/cart_item.dart"
click node_cart_model "https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/models/cart.dart"
click node_shoe "https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/models/shoe.dart"
click node_images "https://github.com/shanmukht9/nike-ecommerce/tree/main/lib/images"
click node_android_host "https://github.com/shanmukht9/nike-ecommerce/blob/main/android/app/src/main/kotlin/com/example/nike_ecommerce/MainActivity.kt"
click node_ios_host "https://github.com/shanmukht9/nike-ecommerce/blob/main/ios/Runner/AppDelegate.swift"
click node_web_host "https://github.com/shanmukht9/nike-ecommerce/blob/main/web/index.html"
click node_android_build "https://github.com/shanmukht9/nike-ecommerce/blob/main/android/app/build.gradle.kts"
click node_ios_project "https://github.com/shanmukht9/nike-ecommerce/tree/main/ios/Runner.xcodeproj"

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_flutter_runtime,node_main,node_intro,node_home,node_shop,node_cart_page,node_bottom_nav,node_shoe_tile,node_cart_item,node_cart_model,node_shoe,node_images toneBlue
class node_android_host,node_ios_host,node_desktop_hosts,node_web_host,node_android_build,node_ios_project toneAmber
```

## Components

### Flutter client

Client-local ecommerce UI and state.

- [Flutter/Dart runtime](https://github.com/shanmukht9/nike-ecommerce/blob/main/pubspec.yaml): runtime · Declared application runtime and dependencies. · `pubspec.yaml`
- [App entry & state wiring](https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/main.dart): application entry · Launches the widget tree and supplies app-level state. · `lib/main.dart`
- [Intro landing](https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/pages/intro_page.dart): page · Begins entry into shopping. · `lib/pages/intro_page.dart`
- [Home shell](https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/pages/home_page.dart): navigation shell · Owns selected tab and active content. · `lib/pages/home_page.dart`
- [Product catalog](https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/pages/shop_page.dart): page · Displays products and requests cart additions. · `lib/pages/shop_page.dart`
- [Cart view](https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/pages/cart_page.dart): page · Renders current cart contents. · `lib/pages/cart_page.dart`
- [Bottom navigation](https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/components/bottom_nav_bar.dart): reusable widget · Selects content within the home shell. · `lib/components/bottom_nav_bar.dart`
- [Product card](https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/components/shoe_tile.dart): reusable widget · Renders a catalog shoe. · `lib/components/shoe_tile.dart`
- [Cart line item](https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/components/cart_item.dart): reusable widget · Renders one cart entry. · `lib/components/cart_item.dart`
- [Cart state](https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/models/cart.dart): domain model · Owns product data, cart contents, mutations, and UI notifications. · `lib/models/cart.dart`
- [Shoe](https://github.com/shanmukht9/nike-ecommerce/blob/main/lib/models/shoe.dart): domain model · Product record consumed by catalog and cart. · `lib/models/shoe.dart`
- [Product image assets](https://github.com/shanmukht9/nike-ecommerce/tree/main/lib/images): assets · Local application images. · `lib/images`

### Platform hosts

Package and launch the shared Flutter app.

- [Android host](https://github.com/shanmukht9/nike-ecommerce/blob/main/android/app/src/main/kotlin/com/example/nike_ecommerce/MainActivity.kt): native launcher · Embeds and packages the Flutter runtime. · `android/app/src/main/kotlin/com/example/nike_ecommerce/MainActivity.kt`
- [iOS host](https://github.com/shanmukht9/nike-ecommerce/blob/main/ios/Runner/AppDelegate.swift): native launcher · Embeds and packages the Flutter runtime. · `ios/Runner/AppDelegate.swift`
- **Desktop hosts**: native launchers · macOS, Linux, and Windows package the shared UI.
- [Web host](https://github.com/shanmukht9/nike-ecommerce/blob/main/web/index.html): web launcher · Loads the Flutter web application. · `web/index.html`
- [Android build](https://github.com/shanmukht9/nike-ecommerce/blob/main/android/app/build.gradle.kts): build configuration · Defines Android packaging behavior. · `android/app/build.gradle.kts`
- [iOS project](https://github.com/shanmukht9/nike-ecommerce/tree/main/ios/Runner.xcodeproj): packaging project · Defines iOS packaging behavior. · `ios/Runner.xcodeproj`

## Connections

- Flutter/Dart runtime → App entry & state wiring: runs
- Android host → App entry & state wiring: launches
- iOS host → App entry & state wiring: launches
- Desktop hosts → App entry & state wiring: launches
- Web host → App entry & state wiring: loads
- Android build → Android host: packages
- iOS project → iOS host: packages
- App entry & state wiring → Intro landing: starts at
- App entry & state wiring → Cart state: provides state
- Intro landing → Home shell: enters shopping
- Home shell → Bottom navigation: composes
- Bottom navigation → Home shell: selects tab
- Home shell → Product catalog: shows shop tab
- Home shell → Cart view: shows cart tab
- Product catalog → Product card: renders
- Product catalog → Cart state: reads products; adds items
- Cart state → Shoe: manages records
- Product card → Shoe: displays
- Product card → Product image assets: uses
- Cart view → Cart state: observes and mutates
- Cart view → Cart line item: renders
- Cart line item → Shoe: displays
