# gokulkrishna12/gk-s-fitness-shop-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/gokulkrishna12/gk-s-fitness-shop-frontend
- Repository: https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend

## Overview

GK’s Fitness Shop is a React storefront for browsing fitness products, managing a cart and wishlist, checking out, and tracking orders, with account and admin workflows. The main path runs from the routed app through catalog/product interactions and shared shop state to checkout and order history; admins also manage products and orders. The README additionally describes OTP validation, Razorpay payments, community reviews, and an AI assistant. Some API and page implementations were not sampled, so uncertain connections are omitted; `src_backup` is treated as a legacy copy, not part of the active app.

Main entry points: [`src/App.jsx`](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/App.jsx) (Routed app), [`src/api/axiosClient.js`](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/api/axiosClient.js) (HTTP client), [`src/context/AuthContext.jsx`](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/context/AuthContext.jsx) (Auth state), [`src/context/ShopContext.jsx`](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/context/ShopContext.jsx) (Cart and wishlist state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app["Routed app<br/>[App.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_api["HTTP client<br/>[axiosClient.js]"]
end

subgraph group_commerce["Shopping journey"]
  node_shopstate["Cart and wishlist state<br/>[ShopContext.jsx]"]
  node_home["Home page<br/>[Home.jsx]"]
  node_catalog["Product catalog<br/>[Catalog.jsx]"]
  node_product["Product details<br/>[ProductDetails.jsx]"]
  node_productcard["Product card<br/>[ProductCard.jsx]"]
  node_cart["Cart page<br/>[Cart.jsx]"]
  node_wishlist["Wishlist page<br/>[Wishlist.jsx]"]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
  node_orders["Order history<br/>[Orders.jsx]"]
end

subgraph group_identity["Account and access"]
  node_authstate["Auth state<br/>[AuthContext.jsx]"]
  node_login["Sign in<br/>[Login.jsx]"]
  node_register["Registration<br/>[Register.jsx]"]
  node_authapi["Authentication API<br/>[authApi.js]"]
  node_otpapi["OTP API<br/>[otpApi.js]"]
  node_profile["Profile<br/>[Profile.jsx]"]
end

subgraph group_operations["Store operations"]
  node_admin["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_adminorders["Admin orders<br/>[AdminOrders.jsx]"]
  node_adminproducts["Admin products<br/>[AdminProducts.jsx]"]
end

subgraph group_assistance["Customer assistance"]
  node_chat["Chat assistant<br/>[ChatAssistant.jsx]"]
  node_coach["AI coach<br/>[AiCoachModal.jsx]"]
end

node_customer(("Shopper"))
node_razorpay["Razorpay"]
node_backend[("Shop backend")]

node_customer -->|"opens"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_product
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_orders
node_app -->|"routes to"| node_admin
node_app -->|"provides"| node_authstate
node_app -->|"provides"| node_shopstate
node_app -->|"loads"| node_chat
node_navbar -->|"reads"| node_authstate
node_navbar -->|"reads"| node_shopstate
node_catalog -->|"renders"| node_productcard
node_catalog -->|"requests catalog"| node_api
node_product -->|"requests product data"| node_api
node_product -->|"renders related items"| node_productcard
node_productcard -->|"uses shopping actions"| node_shopstate
node_shopstate -->|"reads login state"| node_authstate
node_shopstate -->|"syncs cart and wishlist"| node_api
node_login -->|"updates session"| node_authstate
node_login -->|"uses"| node_authapi
node_register -->|"updates session"| node_authstate
node_register -->|"uses OTP"| node_otpapi
node_authapi -->|"uses client"| node_api
node_checkout -->|"reads session"| node_authstate
node_checkout -->|"reads cart"| node_shopstate
node_checkout -->|"submits checkout requests"| node_api
node_checkout -.->|"initiates payment"| node_razorpay
node_orders -->|"reads session"| node_authstate
node_orders -->|"requests orders"| node_api
node_admin -->|"reads session"| node_authstate
node_admin -->|"manages products and orders"| node_api
node_product -.->|"supports reviews"| node_backend
node_backend -.->|"serves shop data"| node_api

click node_app "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/App.jsx"
click node_authstate "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/context/AuthContext.jsx"
click node_shopstate "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/context/ShopContext.jsx"
click node_navbar "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/components/Navbar/Navbar.jsx"
click node_home "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Home/Home.jsx"
click node_catalog "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Catalog/Catalog.jsx"
click node_product "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/ProductDetails/ProductDetails.jsx"
click node_productcard "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/components/ProductCard/ProductCard.jsx"
click node_cart "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Cart/Cart.jsx"
click node_wishlist "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Wishlist/Wishlist.jsx"
click node_checkout "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Checkout/Checkout.jsx"
click node_orders "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Orders/Orders.jsx"
click node_api "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/api/axiosClient.js"
click node_login "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Auth/Login.jsx"
click node_register "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Auth/Register.jsx"
click node_authapi "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/api/authApi.js"
click node_otpapi "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/api/otpApi.js"
click node_profile "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Profile/Profile.jsx"
click node_admin "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Admin/AdminDashboard.jsx"
click node_adminorders "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Admin/AdminOrders.jsx"
click node_adminproducts "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Admin/AdminProducts.jsx"
click node_chat "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/components/ChatAssistant/ChatAssistant.jsx"
click node_coach "https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/components/AiCoachModal/AiCoachModal.jsx"

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_navbar,node_api toneBlue
class node_shopstate,node_home,node_catalog,node_product,node_productcard,node_cart,node_wishlist,node_checkout,node_orders,node_backend toneAmber
class node_authstate,node_login,node_register,node_authapi,node_otpapi,node_profile toneMint
class node_admin,node_adminorders,node_adminproducts toneRose
class node_chat,node_coach,node_customer,node_razorpay toneIndigo
```

## Components

### Application shell

- [Routed app](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/App.jsx): `src/App.jsx`
- [Navigation](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/components/Navbar/Navbar.jsx): `src/components/Navbar/Navbar.jsx`
- [HTTP client](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/api/axiosClient.js): `src/api/axiosClient.js`

### Shopping journey

- [Cart and wishlist state](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/context/ShopContext.jsx): `src/context/ShopContext.jsx`
- [Home page](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Home/Home.jsx): `src/pages/Home/Home.jsx`
- [Product catalog](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Catalog/Catalog.jsx): `src/pages/Catalog/Catalog.jsx`
- [Product details](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/ProductDetails/ProductDetails.jsx): `src/pages/ProductDetails/ProductDetails.jsx`
- [Product card](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/components/ProductCard/ProductCard.jsx): `src/components/ProductCard/ProductCard.jsx`
- [Cart page](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Cart/Cart.jsx): `src/pages/Cart/Cart.jsx`
- [Wishlist page](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Wishlist/Wishlist.jsx): `src/pages/Wishlist/Wishlist.jsx`
- [Checkout](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Checkout/Checkout.jsx): `src/pages/Checkout/Checkout.jsx`
- [Order history](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Orders/Orders.jsx): `src/pages/Orders/Orders.jsx`

### Account and access

- [Auth state](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Sign in](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Auth/Login.jsx): `src/pages/Auth/Login.jsx`
- [Registration](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Auth/Register.jsx): `src/pages/Auth/Register.jsx`
- [Authentication API](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/api/authApi.js): `src/api/authApi.js`
- [OTP API](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/api/otpApi.js): `src/api/otpApi.js`
- [Profile](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Profile/Profile.jsx): `src/pages/Profile/Profile.jsx`

### Store operations

- [Admin dashboard](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Admin/AdminDashboard.jsx): `src/pages/Admin/AdminDashboard.jsx`
- [Admin orders](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Admin/AdminOrders.jsx): `src/pages/Admin/AdminOrders.jsx`
- [Admin products](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/pages/Admin/AdminProducts.jsx): `src/pages/Admin/AdminProducts.jsx`

### Customer assistance

- [Chat assistant](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/components/ChatAssistant/ChatAssistant.jsx): `src/components/ChatAssistant/ChatAssistant.jsx`
- [AI coach](https://github.com/gokulkrishna12/gk-s-fitness-shop-frontend/blob/main/src/components/AiCoachModal/AiCoachModal.jsx): `src/components/AiCoachModal/AiCoachModal.jsx`

### Other components

- **Shopper**
- **Razorpay**
- **Shop backend**

## Connections

- Shopper → Routed app: opens
- Routed app → Navigation: renders (evidence: `src/App.jsx`)
- Routed app → Home page: routes to (evidence: `src/App.jsx`)
- Routed app → Product catalog: routes to (evidence: `src/App.jsx`)
- Routed app → Product details: routes to (evidence: `src/App.jsx`)
- Routed app → Sign in: routes to (evidence: `src/App.jsx`)
- Routed app → Registration: routes to (evidence: `src/App.jsx`)
- Routed app → Checkout: routes to (evidence: `src/App.jsx`)
- Routed app → Order history: routes to (evidence: `src/App.jsx`)
- Routed app → Admin dashboard: routes to (evidence: `src/App.jsx`)
- Routed app → Auth state: provides (evidence: `src/App.jsx`)
- Routed app → Cart and wishlist state: provides (evidence: `src/App.jsx`)
- Routed app → Chat assistant: loads (evidence: `src/App.jsx`)
- Navigation → Auth state: reads (evidence: `src/components/Navbar/Navbar.jsx`)
- Navigation → Cart and wishlist state: reads (evidence: `src/components/Navbar/Navbar.jsx`)
- Product catalog → Product card: renders (evidence: `src/pages/Catalog/Catalog.jsx`)
- Product catalog → HTTP client: requests catalog (evidence: `src/pages/Catalog/Catalog.jsx`)
- Product details → HTTP client: requests product data (evidence: `src/pages/ProductDetails/ProductDetails.jsx`)
- Product details → Product card: renders related items (evidence: `src/pages/ProductDetails/ProductDetails.jsx`)
- Product card → Cart and wishlist state: uses shopping actions (evidence: `src/components/ProductCard/ProductCard.jsx`)
- Cart and wishlist state → Auth state: reads login state (evidence: `src/context/ShopContext.jsx`)
- Cart and wishlist state → HTTP client: syncs cart and wishlist (evidence: `src/context/ShopContext.jsx`)
- Sign in → Auth state: updates session (evidence: `src/pages/Auth/Login.jsx`)
- Sign in → Authentication API: uses (evidence: `src/pages/Auth/Login.jsx`)
- Registration → Auth state: updates session (evidence: `src/pages/Auth/Register.jsx`)
- Registration → OTP API: uses OTP (evidence: `src/pages/Auth/Register.jsx`)
- Authentication API → HTTP client: uses client (evidence: `src/api/authApi.js`)
- Checkout → Auth state: reads session (evidence: `src/pages/Checkout/Checkout.jsx`)
- Checkout → Cart and wishlist state: reads cart (evidence: `src/pages/Checkout/Checkout.jsx`)
- Checkout → HTTP client: submits checkout requests (evidence: `src/pages/Checkout/Checkout.jsx`)
- Checkout → Razorpay: initiates payment (evidence: `README.md`)
- Order history → Auth state: reads session (evidence: `src/pages/Orders/Orders.jsx`)
- Order history → HTTP client: requests orders (evidence: `src/pages/Orders/Orders.jsx`)
- Admin dashboard → Auth state: reads session (evidence: `src/pages/Admin/AdminDashboard.jsx`)
- Admin dashboard → HTTP client: manages products and orders (evidence: `src/pages/Admin/AdminDashboard.jsx`)
- Product details → Shop backend: supports reviews (evidence: `README.md`)
- Shop backend → HTTP client: serves shop data
