# muruganantam/mblapp architecture

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

- Interactive diagram: https://gitdiagram.com/muruganantam/mblapp
- Repository: https://github.com/muruganantam/mblapp

## Overview

This is a React Native grocery-shopping app. Users enter through authentication and onboarding, browse or search products for a selected store, manage a cart and delivery details, check out, and track orders; account, offers, notifications, and wishlist features broaden that journey. The shown sources establish provider setup, selected screen-to-component calls, and several context-to-service calls. Many screens and services are listed but unsampled, so their connections are left out rather than inferred.

Main entry points: [`App.tsx`](https://github.com/muruganantam/mblapp/blob/main/App.tsx) (App providers), [`src/services/api/productService.ts`](https://github.com/muruganantam/mblapp/blob/main/src/services/api/productService.ts) (Product catalog), [`src/screens/search/SearchScreen.tsx`](https://github.com/muruganantam/mblapp/blob/main/src/screens/search/SearchScreen.tsx) (Product search), [`src/context/CartContext.tsx`](https://github.com/muruganantam/mblapp/blob/main/src/context/CartContext.tsx) (Cart management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["App and navigation"]
  node_app["App providers<br/>[App.tsx]"]
  node_authnav["Authentication flow<br/>[AuthNavigator.tsx]"]
end

subgraph group_discovery["Product discovery"]
  node_home["Home browsing<br/>[HomeScreen.tsx]"]
  node_search["Product search<br/>[SearchScreen.tsx]"]
  node_searchbar["Search input<br/>[SearchBar.tsx]"]
  node_productcard["Product card<br/>[ProductCard.tsx]"]
  node_offers["Offers and coupons<br/>[OffersScreen.tsx]"]
end

subgraph group_commerce["Cart and fulfillment"]
  node_cart["Cart management<br/>[CartContext.tsx]"]
  node_checkout["Checkout<br/>[CheckoutScreen.tsx]"]
  node_orders["Orders and tracking<br/>[orderService.ts]"]
end

subgraph group_account["Customer features"]
  node_login["Login and OTP<br/>[LoginScreen.tsx]"]
  node_onboarding["Customer onboarding"]
  node_addresses["Address management<br/>[AddressContext.tsx]"]
  node_wishlist["Wishlist"]
  node_notifications["Notifications"]
  node_auth["Authentication state<br/>[AuthContext.tsx]"]
end

subgraph group_services["Services and state"]
  node_products["Product catalog<br/>[productService.ts]"]
  node_productdata["Sample products<br/>[products.ts]"]
  node_cartapi["Cart service<br/>[cartService.ts]"]
  node_orderhub["Live order updates<br/>[orderHub.ts]"]
  node_addressapi["Address service<br/>[addressService.ts]"]
  node_authapi["Authentication service<br/>[authService.ts]"]
  node_apiclient["HTTP client<br/>[apiClient.ts]"]
end

node_shopper(("Shopper"))
node_backend{{"Commerce backend"}}

node_shopper -->|"opens app"| node_app
node_app -.->|"hosts navigation"| node_authnav
node_app -->|"provides state"| node_auth
node_app -->|"provides state"| node_addresses
node_app -->|"provides state"| node_cart
node_app -->|"provides state"| node_wishlist
node_app -->|"provides state"| node_notifications
node_authnav -->|"routes to"| node_login
node_authnav -->|"routes to"| node_onboarding
node_shopper -.->|"browses"| node_home
node_shopper -.->|"searches"| node_search
node_search -->|"renders"| node_searchbar
node_search -->|"renders results"| node_productcard
node_productcard -->|"updates cart"| node_cart
node_productcard -->|"updates wishlist"| node_wishlist
node_search -->|"searches catalog"| node_products
node_products -->|"requests data"| node_apiclient
node_products -->|"fetches products"| node_backend
node_products -.->|"falls back to"| node_productdata
node_cart -->|"syncs cart"| node_cartapi
node_cart -->|"loads product data"| node_products
node_cartapi -->|"requests data"| node_apiclient
node_shopper -.->|"checks out"| node_checkout
node_checkout -.->|"submits order"| node_orders
node_orders -->|"requests data"| node_apiclient
node_orders -->|"submits checkout"| node_backend
node_shopper -.->|"manages addresses"| node_addresses
node_addresses -->|"loads and updates"| node_addressapi
node_shopper -.->|"views offers"| node_offers
node_offers -.->|"displays offers"| node_shopper
node_shopper -.->|"checks updates"| node_notifications
node_auth -->|"verifies identity"| node_authapi
node_authapi -->|"requests data"| node_apiclient
node_authapi -.->|"uses realtime hub"| node_orderhub

click node_app "https://github.com/muruganantam/mblapp/blob/main/App.tsx"
click node_authnav "https://github.com/muruganantam/mblapp/blob/main/src/navigation/AuthNavigator.tsx"
click node_login "https://github.com/muruganantam/mblapp/blob/main/src/screens/auth/LoginScreen.tsx"
click node_onboarding "https://github.com/muruganantam/mblapp/blob/main/src/screens/onboarding/PrimaryAddressScreen.tsx"
click node_home "https://github.com/muruganantam/mblapp/blob/main/src/screens/home/HomeScreen.tsx"
click node_search "https://github.com/muruganantam/mblapp/blob/main/src/screens/search/SearchScreen.tsx"
click node_searchbar "https://github.com/muruganantam/mblapp/blob/main/src/components/common/SearchBar.tsx"
click node_productcard "https://github.com/muruganantam/mblapp/blob/main/src/components/product/ProductCard.tsx"
click node_products "https://github.com/muruganantam/mblapp/blob/main/src/services/api/productService.ts"
click node_productdata "https://github.com/muruganantam/mblapp/blob/main/src/data/products.ts"
click node_cart "https://github.com/muruganantam/mblapp/blob/main/src/context/CartContext.tsx"
click node_cartapi "https://github.com/muruganantam/mblapp/blob/main/src/services/api/cartService.ts"
click node_checkout "https://github.com/muruganantam/mblapp/blob/main/src/screens/checkout/CheckoutScreen.tsx"
click node_orders "https://github.com/muruganantam/mblapp/blob/main/src/services/api/orderService.ts"
click node_orderhub "https://github.com/muruganantam/mblapp/blob/main/src/services/realtime/orderHub.ts"
click node_addresses "https://github.com/muruganantam/mblapp/blob/main/src/context/AddressContext.tsx"
click node_addressapi "https://github.com/muruganantam/mblapp/blob/main/src/services/api/addressService.ts"
click node_wishlist "https://github.com/muruganantam/mblapp/blob/main/src/context/WishlistContext.tsx"
click node_offers "https://github.com/muruganantam/mblapp/blob/main/src/screens/offers/OffersScreen.tsx"
click node_notifications "https://github.com/muruganantam/mblapp/blob/main/src/context/NotificationContext.tsx"
click node_auth "https://github.com/muruganantam/mblapp/blob/main/src/context/AuthContext.tsx"
click node_authapi "https://github.com/muruganantam/mblapp/blob/main/src/services/api/authService.ts"
click node_apiclient "https://github.com/muruganantam/mblapp/blob/main/src/services/api/apiClient.ts"

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_authnav toneBlue
class node_home,node_search,node_searchbar,node_productcard,node_offers toneAmber
class node_cart,node_checkout,node_orders toneMint
class node_login,node_onboarding,node_addresses,node_wishlist,node_notifications,node_auth toneRose
class node_products,node_productdata,node_cartapi,node_orderhub,node_addressapi,node_authapi,node_apiclient,node_shopper,node_backend toneIndigo
```

## Components

### App and navigation

- [App providers](https://github.com/muruganantam/mblapp/blob/main/App.tsx): `App.tsx`
- [Authentication flow](https://github.com/muruganantam/mblapp/blob/main/src/navigation/AuthNavigator.tsx): `src/navigation/AuthNavigator.tsx`

### Product discovery

- [Home browsing](https://github.com/muruganantam/mblapp/blob/main/src/screens/home/HomeScreen.tsx): `src/screens/home/HomeScreen.tsx`
- [Product search](https://github.com/muruganantam/mblapp/blob/main/src/screens/search/SearchScreen.tsx): `src/screens/search/SearchScreen.tsx`
- [Search input](https://github.com/muruganantam/mblapp/blob/main/src/components/common/SearchBar.tsx): `src/components/common/SearchBar.tsx`
- [Product card](https://github.com/muruganantam/mblapp/blob/main/src/components/product/ProductCard.tsx): `src/components/product/ProductCard.tsx`
- [Offers and coupons](https://github.com/muruganantam/mblapp/blob/main/src/screens/offers/OffersScreen.tsx): `src/screens/offers/OffersScreen.tsx`

### Cart and fulfillment

- [Cart management](https://github.com/muruganantam/mblapp/blob/main/src/context/CartContext.tsx): `src/context/CartContext.tsx`
- [Checkout](https://github.com/muruganantam/mblapp/blob/main/src/screens/checkout/CheckoutScreen.tsx): `src/screens/checkout/CheckoutScreen.tsx`
- [Orders and tracking](https://github.com/muruganantam/mblapp/blob/main/src/services/api/orderService.ts): `src/services/api/orderService.ts`

### Customer features

- [Login and OTP](https://github.com/muruganantam/mblapp/blob/main/src/screens/auth/LoginScreen.tsx): `src/screens/auth/LoginScreen.tsx`
- [Customer onboarding](https://github.com/muruganantam/mblapp/blob/main/src/screens/onboarding/PrimaryAddressScreen.tsx): `src/screens/onboarding/PrimaryAddressScreen.tsx`
- [Address management](https://github.com/muruganantam/mblapp/blob/main/src/context/AddressContext.tsx): `src/context/AddressContext.tsx`
- [Wishlist](https://github.com/muruganantam/mblapp/blob/main/src/context/WishlistContext.tsx): `src/context/WishlistContext.tsx`
- [Notifications](https://github.com/muruganantam/mblapp/blob/main/src/context/NotificationContext.tsx): `src/context/NotificationContext.tsx`
- [Authentication state](https://github.com/muruganantam/mblapp/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`

### Services and state

- [Product catalog](https://github.com/muruganantam/mblapp/blob/main/src/services/api/productService.ts): `src/services/api/productService.ts`
- [Sample products](https://github.com/muruganantam/mblapp/blob/main/src/data/products.ts): `src/data/products.ts`
- [Cart service](https://github.com/muruganantam/mblapp/blob/main/src/services/api/cartService.ts): `src/services/api/cartService.ts`
- [Live order updates](https://github.com/muruganantam/mblapp/blob/main/src/services/realtime/orderHub.ts): `src/services/realtime/orderHub.ts`
- [Address service](https://github.com/muruganantam/mblapp/blob/main/src/services/api/addressService.ts): `src/services/api/addressService.ts`
- [Authentication service](https://github.com/muruganantam/mblapp/blob/main/src/services/api/authService.ts): `src/services/api/authService.ts`
- [HTTP client](https://github.com/muruganantam/mblapp/blob/main/src/services/api/apiClient.ts): `src/services/api/apiClient.ts`

### Other components

- **Shopper**
- **Commerce backend**

## Connections

- Shopper → App providers: opens app
- App providers → Authentication flow: hosts navigation
- App providers → Authentication state: provides state (evidence: `App.tsx`)
- App providers → Address management: provides state (evidence: `App.tsx`)
- App providers → Cart management: provides state (evidence: `App.tsx`)
- App providers → Wishlist: provides state (evidence: `App.tsx`)
- App providers → Notifications: provides state (evidence: `App.tsx`)
- Authentication flow → Login and OTP: routes to (evidence: `src/navigation/AuthNavigator.tsx`)
- Authentication flow → Customer onboarding: routes to (evidence: `src/navigation/AuthNavigator.tsx`)
- Shopper → Home browsing: browses
- Shopper → Product search: searches
- Product search → Search input: renders (evidence: `src/screens/search/SearchScreen.tsx`)
- Product search → Product card: renders results (evidence: `src/screens/search/SearchScreen.tsx`)
- Product card → Cart management: updates cart (evidence: `src/components/product/ProductCard.tsx`)
- Product card → Wishlist: updates wishlist (evidence: `src/components/product/ProductCard.tsx`)
- Product search → Product catalog: searches catalog (evidence: `src/screens/search/SearchScreen.tsx`)
- Product catalog → HTTP client: requests data (evidence: `src/services/api/productService.ts`)
- Product catalog → Commerce backend: fetches products (evidence: `src/services/api/productService.ts`)
- Product catalog → Sample products: falls back to
- Cart management → Cart service: syncs cart (evidence: `src/context/CartContext.tsx`)
- Cart management → Product catalog: loads product data (evidence: `src/context/CartContext.tsx`)
- Cart service → HTTP client: requests data (evidence: `src/services/api/cartService.ts`)
- Shopper → Checkout: checks out
- Checkout → Orders and tracking: submits order
- Orders and tracking → HTTP client: requests data (evidence: `src/services/api/orderService.ts`)
- Orders and tracking → Commerce backend: submits checkout (evidence: `src/services/api/orderService.ts`)
- Shopper → Address management: manages addresses
- Address management → Address service: loads and updates (evidence: `src/context/AddressContext.tsx`)
- Shopper → Offers and coupons: views offers
- Offers and coupons → Shopper: displays offers
- Shopper → Notifications: checks updates
- Authentication state → Authentication service: verifies identity (evidence: `src/context/AuthContext.tsx`)
- Authentication service → HTTP client: requests data (evidence: `src/services/api/authService.ts`)
- Authentication service → Live order updates: uses realtime hub (evidence: `src/services/api/authService.ts`)
