# hamed-hasan/shofy-fashion-ecommerce-client architecture

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

- Interactive diagram: https://gitdiagram.com/hamed-hasan/shofy-fashion-ecommerce-client
- Repository: https://github.com/hamed-hasan/shofy-fashion-ecommerce-client

## Overview

Shofy is the customer-facing Next.js storefront for a broader e-commerce system; the supplied tree contains the client, not the separately documented Express/MongoDB admin/backend. A shopper browses or searches products, opens product details, and can review items, manage a cart, and proceed through checkout; authentication and account pages support those actions. Catalog, cart, wishlist, comparison, orders, coupons, and reviews are represented in the client. README capabilities such as Stripe, email verification, and Google sign-in are documented, but their complete runtime wiring is not shown in the excerpts.

Main entry points: [`src/redux/features/auth/authSlice.js`](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/redux/features/auth/authSlice.js) (Authentication state), [`src/redux/api/apiSlice.js`](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/redux/api/apiSlice.js) (API client), [`src/redux/features/productApi.js`](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/redux/features/productApi.js) (Product API), [`src/hooks/use-search-form-submit.js`](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/hooks/use-search-form-submit.js) (Search navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront experience"]
  node_pages["Store pages"]
  node_header["Navigation header<br/>[header-2.jsx]"]
  node_search_hook["Search navigation"]
  node_search_page["Product search<br/>[search.jsx]"]
  node_product_page["Product details"]
  node_blog_pages["Editorial content<br/>[blog.jsx]"]
end

subgraph group_commerce["Shopping workflows"]
  node_cart["Cart and checkout<br/>[cart-area.jsx]"]
  node_wishlist["Wishlist and compare<br/>[wishlist-area.jsx]"]
  node_review_form["Product reviews<br/>[review-form.jsx]"]
  node_coupons["Coupons<br/>[coupon-area.jsx]"]
end

subgraph group_identity["Identity and account"]
  node_account["Account and orders<br/>[profile-area.jsx]"]
  node_auth_pages["Authentication pages<br/>[login.jsx]"]
  node_auth_state["Authentication state<br/>[authSlice.js]"]
end

subgraph group_client_state["Client data and state"]
  node_api["API client<br/>[apiSlice.js]"]
  node_product_api["Product API<br/>[productApi.js]"]
  node_review_api["Review API<br/>[reviewApi.js]"]
  node_cart_state["Cart state<br/>[cartSlice.js]"]
end

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

node_shopper -.->|"browses"| node_pages
node_header -->|"submits search"| node_search_hook
node_search_hook -->|"routes to"| node_search_page
node_search_page -->|"loads products"| node_product_api
node_product_page -->|"loads product"| node_product_api
node_review_form -->|"submits review"| node_review_api
node_review_api -->|"uses client"| node_api
node_product_api -->|"uses client"| node_api
node_api -->|"sends requests"| node_backend
node_cart -.->|"manages cart"| node_cart_state
node_account -.->|"uses identity"| node_auth_state
node_auth_pages -.->|"updates session"| node_auth_state
node_auth_state -.->|"authenticates"| node_backend
node_shopper -.->|"shops"| node_cart
node_shopper -.->|"saves items"| node_wishlist
node_shopper -.->|"reads"| node_blog_pages

click node_pages "https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/tree/main/src/pages"
click node_header "https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/layout/headers/header-2.jsx"
click node_search_hook "https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/hooks/use-search-form-submit.js"
click node_search_page "https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/pages/search.jsx"
click node_product_page "https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/components/product-details/product-details-area.jsx"
click node_blog_pages "https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/pages/blog.jsx"
click node_cart "https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/components/cart-wishlist/cart-area.jsx"
click node_wishlist "https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/components/cart-wishlist/wishlist-area.jsx"
click node_review_form "https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/components/forms/review-form.jsx"
click node_coupons "https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/components/coupon/coupon-area.jsx"
click node_account "https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/components/my-account/profile-area.jsx"
click node_auth_pages "https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/pages/login.jsx"
click node_auth_state "https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/redux/features/auth/authSlice.js"
click node_api "https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/redux/api/apiSlice.js"
click node_product_api "https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/redux/features/productApi.js"
click node_review_api "https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/redux/features/reviewApi.js"
click node_cart_state "https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/redux/features/cartSlice.js"

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_pages,node_header,node_search_hook,node_search_page,node_product_page,node_blog_pages toneBlue
class node_cart,node_wishlist,node_review_form,node_coupons toneAmber
class node_account,node_auth_pages,node_auth_state toneMint
class node_api,node_product_api,node_review_api,node_cart_state toneRose
class node_shopper,node_backend toneIndigo
```

## Components

### Storefront experience

- [Store pages](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/tree/main/src/pages): `src/pages`
- [Navigation header](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/layout/headers/header-2.jsx): `src/layout/headers/header-2.jsx`
- [Search navigation](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/hooks/use-search-form-submit.js): `src/hooks/use-search-form-submit.js`
- [Product search](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/pages/search.jsx): `src/pages/search.jsx`
- [Product details](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/components/product-details/product-details-area.jsx): `src/components/product-details/product-details-area.jsx`
- [Editorial content](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/pages/blog.jsx): `src/pages/blog.jsx`

### Shopping workflows

- [Cart and checkout](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/components/cart-wishlist/cart-area.jsx): `src/components/cart-wishlist/cart-area.jsx`
- [Wishlist and compare](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/components/cart-wishlist/wishlist-area.jsx): `src/components/cart-wishlist/wishlist-area.jsx`
- [Product reviews](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/components/forms/review-form.jsx): `src/components/forms/review-form.jsx`
- [Coupons](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/components/coupon/coupon-area.jsx): `src/components/coupon/coupon-area.jsx`

### Identity and account

- [Account and orders](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/components/my-account/profile-area.jsx): `src/components/my-account/profile-area.jsx`
- [Authentication pages](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/pages/login.jsx): `src/pages/login.jsx`
- [Authentication state](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/redux/features/auth/authSlice.js): `src/redux/features/auth/authSlice.js`

### Client data and state

- [API client](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/redux/api/apiSlice.js): `src/redux/api/apiSlice.js`
- [Product API](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/redux/features/productApi.js): `src/redux/features/productApi.js`
- [Review API](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/redux/features/reviewApi.js): `src/redux/features/reviewApi.js`
- [Cart state](https://github.com/hamed-hasan/shofy-fashion-ecommerce-client/blob/main/src/redux/features/cartSlice.js): `src/redux/features/cartSlice.js`

### Other components

- **Shopper**
- **Shofy backend**

## Connections

- Shopper → Store pages: browses
- Navigation header → Search navigation: submits search (evidence: `src/layout/headers/header-2.jsx`)
- Search navigation → Product search: routes to (evidence: `src/hooks/use-search-form-submit.js`)
- Product search → Product API: loads products (evidence: `src/pages/search.jsx`)
- Product details → Product API: loads product (evidence: `src/pages/product-details/[id].jsx`)
- Product reviews → Review API: submits review (evidence: `src/components/forms/review-form.jsx`)
- Review API → API client: uses client (evidence: `src/redux/features/reviewApi.js`)
- Product API → API client: uses client (evidence: `src/redux/features/productApi.js`)
- API client → Shofy backend: sends requests (evidence: `src/redux/api/apiSlice.js`)
- Cart and checkout → Cart state: manages cart
- Account and orders → Authentication state: uses identity
- Authentication pages → Authentication state: updates session
- Authentication state → Shofy backend: authenticates
- Shopper → Cart and checkout: shops
- Shopper → Wishlist and compare: saves items
- Shopper → Editorial content: reads
