# mohamedosama1907/fresh-cart-e-commerce- architecture

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

- Interactive diagram: https://gitdiagram.com/mohamedosama1907/fresh-cart-e-commerce-
- Repository: https://github.com/mohamedosama1907/fresh-cart-e-commerce-

## Overview

FreshCart is a consumer e-commerce storefront. Shoppers browse and search products, manage a cart and wishlist, authenticate, place cash-on-delivery orders, and manage their account. The graph separates storefront discovery, identity/account, and purchase flows from shared client state and API access. Some page implementations and feature modules were not sampled; where the index or README does not establish a connection, the graph leaves it out.

Main entry points: [`src/services/apiClient.ts`](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/services/apiClient.ts) (API client), [`src/features/search/components/SearchScreen.tsx`](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/features/search/components/SearchScreen.tsx) (Product search), [`src/features/cart/components/CartScreen.tsx`](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/features/cart/components/CartScreen.tsx) (Cart management), [`src/components/layout/Navbar.tsx`](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/components/layout/Navbar.tsx) (Navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront discovery"]
  node_home["Home page<br/>[page.tsx]"]
  node_catalog["Catalog pages"]
  node_search["Product search<br/>[SearchScreen.tsx]"]
  node_product["Product details"]
  node_categories["Categories"]
  node_brands["Brands<br/>[brands.screen.tsx]"]
  node_subcategories["Subcategories"]
end

subgraph group_identity["Identity and account"]
  node_auth["Authentication"]
  node_profile["Profile and addresses"]
  node_support["Customer support"]
end

subgraph group_purchase["Cart and orders"]
  node_cart["Cart management<br/>[CartScreen.tsx]"]
  node_checkout["Checkout<br/>[CheckoutScreen.tsx]"]
  node_order["Order placement"]
  node_orders["Order history"]
  node_wishlist["Wishlist"]
end

subgraph group_shared["Client infrastructure"]
  node_navbar["Navigation<br/>[Navbar.tsx]"]
  node_store["Redux auth state<br/>[store.ts]"]
  node_authslice["Auth reducer<br/>[auth.slice.ts]"]
  node_api["API client<br/>[apiClient.ts]"]
end

node_shopper(("Shopper"))
node_commerceapi{{"Commerce API"}}

node_shopper -->|"visits"| node_home
node_shopper -->|"browses"| node_catalog
node_shopper -->|"searches"| node_search
node_shopper -->|"views"| node_product
node_shopper -->|"manages"| node_cart
node_shopper -->|"checks out"| node_checkout
node_shopper -->|"signs in"| node_auth
node_shopper -->|"manages"| node_wishlist
node_shopper -->|"views"| node_orders
node_shopper -->|"manages"| node_profile
node_shopper -->|"contacts"| node_support
node_search -->|"loads brands"| node_brands
node_search -->|"loads categories"| node_categories
node_search -->|"renders cards"| node_product
node_navbar -->|"deletes token"| node_auth
node_navbar -->|"loads cart"| node_cart
node_navbar -->|"loads wishlist"| node_wishlist
node_store -->|"registers reducer"| node_authslice
node_cart -->|"requests cart actions"| node_api
node_auth -->|"uses API client"| node_api
node_wishlist -->|"updates wishlist"| node_api
node_checkout -->|"reads cart"| node_cart
node_checkout -->|"submits order"| node_order
node_order -->|"creates cash order"| node_api
node_orders -->|"loads order history"| node_api
node_api -->|"sends requests"| node_commerceapi

click node_home "https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/app/page.tsx"
click node_catalog "https://github.com/mohamedosama1907/fresh-cart-e-commerce-/tree/main/src/features/shop"
click node_search "https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/features/search/components/SearchScreen.tsx"
click node_product "https://github.com/mohamedosama1907/fresh-cart-e-commerce-/tree/main/src/features/products/components/ProductDetails"
click node_categories "https://github.com/mohamedosama1907/fresh-cart-e-commerce-/tree/main/src/features/categories"
click node_brands "https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/features/brands/components/brands.screen.tsx"
click node_subcategories "https://github.com/mohamedosama1907/fresh-cart-e-commerce-/tree/main/src/features/subcategories"
click node_auth "https://github.com/mohamedosama1907/fresh-cart-e-commerce-/tree/main/src/features/auth"
click node_profile "https://github.com/mohamedosama1907/fresh-cart-e-commerce-/tree/main/src/features/profile"
click node_cart "https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/features/cart/components/CartScreen.tsx"
click node_checkout "https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/features/checkout/components/CheckoutScreen.tsx"
click node_order "https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/features/checkout/server/checkout.actions.ts"
click node_orders "https://github.com/mohamedosama1907/fresh-cart-e-commerce-/tree/main/src/features/orders"
click node_wishlist "https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/features/wishlist/components/whishlist.screen.tsx"
click node_support "https://github.com/mohamedosama1907/fresh-cart-e-commerce-/tree/main/src/features/support"
click node_navbar "https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/components/layout/Navbar.tsx"
click node_store "https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/store/store.ts"
click node_authslice "https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/features/auth/slices/auth.slice.ts"
click node_api "https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/services/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_home,node_catalog,node_search,node_product,node_categories,node_brands,node_subcategories toneBlue
class node_auth,node_profile,node_support toneAmber
class node_cart,node_checkout,node_order,node_orders,node_wishlist,node_commerceapi toneMint
class node_navbar,node_store,node_authslice,node_api toneRose
class node_shopper toneIndigo
```

## Components

### Storefront discovery

- [Home page](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Catalog pages](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/tree/main/src/features/shop): `src/features/shop`
- [Product search](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/features/search/components/SearchScreen.tsx): `src/features/search/components/SearchScreen.tsx`
- [Product details](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/tree/main/src/features/products/components/ProductDetails): `src/features/products/components/ProductDetails`
- [Categories](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/tree/main/src/features/categories): `src/features/categories`
- [Brands](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/features/brands/components/brands.screen.tsx): `src/features/brands/components/brands.screen.tsx`
- [Subcategories](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/tree/main/src/features/subcategories): `src/features/subcategories`

### Identity and account

- [Authentication](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/tree/main/src/features/auth): `src/features/auth`
- [Profile and addresses](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/tree/main/src/features/profile): `src/features/profile`
- [Customer support](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/tree/main/src/features/support): `src/features/support`

### Cart and orders

- [Cart management](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/features/cart/components/CartScreen.tsx): `src/features/cart/components/CartScreen.tsx`
- [Checkout](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/features/checkout/components/CheckoutScreen.tsx): `src/features/checkout/components/CheckoutScreen.tsx`
- [Order placement](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/features/checkout/server/checkout.actions.ts): `src/features/checkout/server/checkout.actions.ts`
- [Order history](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/tree/main/src/features/orders): `src/features/orders`
- [Wishlist](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/features/wishlist/components/whishlist.screen.tsx): `src/features/wishlist/components/whishlist.screen.tsx`

### Client infrastructure

- [Navigation](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/components/layout/Navbar.tsx): `src/components/layout/Navbar.tsx`
- [Redux auth state](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/store/store.ts): `src/store/store.ts`
- [Auth reducer](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/features/auth/slices/auth.slice.ts): `src/features/auth/slices/auth.slice.ts`
- [API client](https://github.com/mohamedosama1907/fresh-cart-e-commerce-/blob/main/src/services/apiClient.ts): `src/services/apiClient.ts`

### Other components

- **Shopper**
- **Commerce API**

## Connections

- Shopper → Home page: visits
- Shopper → Catalog pages: browses
- Shopper → Product search: searches
- Shopper → Product details: views
- Shopper → Cart management: manages
- Shopper → Checkout: checks out
- Shopper → Authentication: signs in
- Shopper → Wishlist: manages
- Shopper → Order history: views
- Shopper → Profile and addresses: manages
- Shopper → Customer support: contacts
- Product search → Brands: loads brands (evidence: `src/features/search/components/SearchScreen.tsx`)
- Product search → Categories: loads categories (evidence: `src/features/search/components/SearchScreen.tsx`)
- Product search → Product details: renders cards (evidence: `src/features/search/components/SearchScreen.tsx`)
- Navigation → Authentication: deletes token (evidence: `src/components/layout/Navbar.tsx`)
- Navigation → Cart management: loads cart (evidence: `src/components/layout/Navbar.tsx`)
- Navigation → Wishlist: loads wishlist (evidence: `src/components/layout/Navbar.tsx`)
- Redux auth state → Auth reducer: registers reducer (evidence: `src/store/store.ts`)
- Cart management → API client: requests cart actions
- Authentication → API client: uses API client (evidence: `src/features/auth/server/auth.actions.ts`)
- Wishlist → API client: updates wishlist
- Checkout → Cart management: reads cart (evidence: `src/features/checkout/components/CheckoutScreen.tsx`)
- Checkout → Order placement: submits order
- Order placement → API client: creates cash order
- Order history → API client: loads order history (evidence: `src/features/orders/server/orders.actions.ts`)
- API client → Commerce API: sends requests (evidence: `src/services/apiClient.ts`)
