# yukith1411/yuki-store architecture

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

- Interactive diagram: https://gitdiagram.com/yukith1411/yuki-store
- Repository: https://github.com/yukith1411/yuki-store

## Overview

Grand Bazaar is a department-store e-commerce application: shoppers browse departments and products, manage accounts, carts and wishlists, then place and track orders; administrators manage catalog content, customers, reviews and fulfillment. The React SPA uses shared contexts and an Axios service alongside an Express API backed by MongoDB, with Cloudinary for product imagery. The graph preserves documented storefront and admin capabilities, but several page, route and controller implementations were not sampled, so their internal call relationships are omitted or marked unverified.

Main entry points: [`backend/server.js`](https://github.com/yukith1411/yuki-store/blob/main/backend/server.js) (Express API), [`frontend/src/services/api.js`](https://github.com/yukith1411/yuki-store/blob/main/frontend/src/services/api.js) (API client), [`backend/controllers/orderController.js`](https://github.com/yukith1411/yuki-store/blob/main/backend/controllers/orderController.js) (Orders and stock), [`backend/controllers/productController.js`](https://github.com/yukith1411/yuki-store/blob/main/backend/controllers/productController.js) (Product catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_spa["React application<br/>[App.jsx]"]
  node_shop_pages["Shopping pages"]
  node_store_ui["Storefront components"]
  node_auth_context["Authentication state<br/>[AuthContext.jsx]"]
  node_cart_context["Cart state<br/>[CartContext.jsx]"]
  node_wishlist_context["Wishlist state"]
end

subgraph group_admin["Administration"]
  node_admin_pages["Admin pages"]
  node_admin_ui["Admin layout and tools"]
end

subgraph group_api["API and workflows"]
  node_api_client["API client<br/>[api.js]"]
  node_api_server["Express API<br/>[server.js]"]
  node_auth["Accounts and access<br/>[authController.js]"]
  node_catalog["Product catalog"]
  node_cart_wishlist["Cart and wishlist<br/>[cartController.js]"]
  node_orders["Orders and stock<br/>[orderController.js]"]
  node_coupons["Discount coupons"]
  node_reviews["Product reviews"]
  node_content_admin["Store content management"]
end

subgraph group_data["Persistence and media"]
  node_mongo[("MongoDB<br/>[db.js]")]
  node_cloudinary[("Cloudinary image hosting<br/>[cloudinary.js]")]
  node_product_model["Product records<br/>[Product.js]"]
  node_user_model["User records<br/>[User.js]"]
  node_order_model["Order records<br/>[Order.js]"]
  node_review_model["Review records<br/>[Review.js]"]
  node_coupon_model["Coupon records<br/>[Coupon.js]"]
end

node_shopper(("Shopper"))
node_adminuser(("Administrator"))

node_shopper -.->|"browses and shops"| node_shop_pages
node_shop_pages -.->|"uses"| node_spa
node_spa -.->|"requests data"| node_api_client
node_auth_context -->|"calls"| node_api_client
node_cart_context -->|"reads identity"| node_auth_context
node_cart_context -->|"calls"| node_api_client
node_api_client -.->|"sends API requests"| node_api_server
node_adminuser -.->|"manages store"| node_admin_pages
node_admin_pages -.->|"requests data"| node_api_client
node_api_server -->|"mounts routes"| node_auth
node_api_server -->|"mounts routes"| node_catalog
node_api_server -->|"mounts routes"| node_orders
node_api_server -->|"mounts routes"| node_reviews
node_api_server -->|"mounts routes"| node_cart_wishlist
node_api_server -->|"mounts routes"| node_coupons
node_api_server -->|"mounts routes"| node_content_admin
node_auth -->|"reads and updates"| node_user_model
node_catalog -->|"queries and updates"| node_product_model
node_catalog -.->|"uploads images"| node_cloudinary
node_orders -->|"creates and updates"| node_order_model
node_orders -->|"checks and adjusts stock"| node_product_model
node_orders -->|"clears cart"| node_user_model
node_reviews -->|"creates and queries"| node_review_model
node_reviews -->|"updates ratings"| node_product_model
node_coupons -->|"queries"| node_coupon_model
node_cart_wishlist -->|"updates cart"| node_user_model
node_api_server -->|"connects"| node_mongo

click node_spa "https://github.com/yukith1411/yuki-store/blob/main/frontend/src/App.jsx"
click node_shop_pages "https://github.com/yukith1411/yuki-store/tree/main/frontend/src/pages/user"
click node_store_ui "https://github.com/yukith1411/yuki-store/tree/main/frontend/src/components"
click node_auth_context "https://github.com/yukith1411/yuki-store/blob/main/frontend/src/context/AuthContext.jsx"
click node_cart_context "https://github.com/yukith1411/yuki-store/blob/main/frontend/src/context/CartContext.jsx"
click node_wishlist_context "https://github.com/yukith1411/yuki-store/blob/main/frontend/src/context/WishlistContext.jsx"
click node_admin_pages "https://github.com/yukith1411/yuki-store/tree/main/frontend/src/pages/admin"
click node_admin_ui "https://github.com/yukith1411/yuki-store/tree/main/frontend/src/components/admin"
click node_api_client "https://github.com/yukith1411/yuki-store/blob/main/frontend/src/services/api.js"
click node_api_server "https://github.com/yukith1411/yuki-store/blob/main/backend/server.js"
click node_auth "https://github.com/yukith1411/yuki-store/blob/main/backend/controllers/authController.js"
click node_catalog "https://github.com/yukith1411/yuki-store/blob/main/backend/controllers/productController.js"
click node_cart_wishlist "https://github.com/yukith1411/yuki-store/blob/main/backend/controllers/cartController.js"
click node_orders "https://github.com/yukith1411/yuki-store/blob/main/backend/controllers/orderController.js"
click node_coupons "https://github.com/yukith1411/yuki-store/blob/main/backend/controllers/couponController.js"
click node_reviews "https://github.com/yukith1411/yuki-store/blob/main/backend/controllers/reviewController.js"
click node_content_admin "https://github.com/yukith1411/yuki-store/blob/main/backend/controllers/bannerController.js"
click node_mongo "https://github.com/yukith1411/yuki-store/blob/main/backend/config/db.js"
click node_cloudinary "https://github.com/yukith1411/yuki-store/blob/main/backend/config/cloudinary.js"
click node_product_model "https://github.com/yukith1411/yuki-store/blob/main/backend/models/Product.js"
click node_user_model "https://github.com/yukith1411/yuki-store/blob/main/backend/models/User.js"
click node_order_model "https://github.com/yukith1411/yuki-store/blob/main/backend/models/Order.js"
click node_review_model "https://github.com/yukith1411/yuki-store/blob/main/backend/models/Review.js"
click node_coupon_model "https://github.com/yukith1411/yuki-store/blob/main/backend/models/Coupon.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_spa,node_shop_pages,node_store_ui,node_auth_context,node_cart_context,node_wishlist_context toneBlue
class node_admin_pages,node_admin_ui toneAmber
class node_api_client,node_api_server,node_auth,node_catalog,node_cart_wishlist,node_orders,node_coupons,node_reviews,node_content_admin toneMint
class node_mongo,node_cloudinary,node_product_model,node_user_model,node_order_model,node_review_model,node_coupon_model toneRose
class node_shopper,node_adminuser toneIndigo
```

## Components

### Storefront

- [React application](https://github.com/yukith1411/yuki-store/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Shopping pages](https://github.com/yukith1411/yuki-store/tree/main/frontend/src/pages/user): `frontend/src/pages/user`
- [Storefront components](https://github.com/yukith1411/yuki-store/tree/main/frontend/src/components): `frontend/src/components`
- [Authentication state](https://github.com/yukith1411/yuki-store/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Cart state](https://github.com/yukith1411/yuki-store/blob/main/frontend/src/context/CartContext.jsx): `frontend/src/context/CartContext.jsx`
- [Wishlist state](https://github.com/yukith1411/yuki-store/blob/main/frontend/src/context/WishlistContext.jsx): `frontend/src/context/WishlistContext.jsx`

### Administration

- [Admin pages](https://github.com/yukith1411/yuki-store/tree/main/frontend/src/pages/admin): `frontend/src/pages/admin`
- [Admin layout and tools](https://github.com/yukith1411/yuki-store/tree/main/frontend/src/components/admin): `frontend/src/components/admin`

### API and workflows

- [API client](https://github.com/yukith1411/yuki-store/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Express API](https://github.com/yukith1411/yuki-store/blob/main/backend/server.js): `backend/server.js`
- [Accounts and access](https://github.com/yukith1411/yuki-store/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [Product catalog](https://github.com/yukith1411/yuki-store/blob/main/backend/controllers/productController.js): `backend/controllers/productController.js`
- [Cart and wishlist](https://github.com/yukith1411/yuki-store/blob/main/backend/controllers/cartController.js): `backend/controllers/cartController.js`
- [Orders and stock](https://github.com/yukith1411/yuki-store/blob/main/backend/controllers/orderController.js): `backend/controllers/orderController.js`
- [Discount coupons](https://github.com/yukith1411/yuki-store/blob/main/backend/controllers/couponController.js): `backend/controllers/couponController.js`
- [Product reviews](https://github.com/yukith1411/yuki-store/blob/main/backend/controllers/reviewController.js): `backend/controllers/reviewController.js`
- [Store content management](https://github.com/yukith1411/yuki-store/blob/main/backend/controllers/bannerController.js): `backend/controllers/bannerController.js`

### Persistence and media

- [MongoDB](https://github.com/yukith1411/yuki-store/blob/main/backend/config/db.js): `backend/config/db.js`
- [Cloudinary image hosting](https://github.com/yukith1411/yuki-store/blob/main/backend/config/cloudinary.js): `backend/config/cloudinary.js`
- [Product records](https://github.com/yukith1411/yuki-store/blob/main/backend/models/Product.js): `backend/models/Product.js`
- [User records](https://github.com/yukith1411/yuki-store/blob/main/backend/models/User.js): `backend/models/User.js`
- [Order records](https://github.com/yukith1411/yuki-store/blob/main/backend/models/Order.js): `backend/models/Order.js`
- [Review records](https://github.com/yukith1411/yuki-store/blob/main/backend/models/Review.js): `backend/models/Review.js`
- [Coupon records](https://github.com/yukith1411/yuki-store/blob/main/backend/models/Coupon.js): `backend/models/Coupon.js`

### Other components

- **Shopper**
- **Administrator**

## Connections

- Shopper → Shopping pages: browses and shops
- Shopping pages → React application: uses
- React application → API client: requests data
- Authentication state → API client: calls (evidence: `frontend/src/context/AuthContext.jsx`)
- Cart state → Authentication state: reads identity (evidence: `frontend/src/context/CartContext.jsx`)
- Cart state → API client: calls (evidence: `frontend/src/context/CartContext.jsx`)
- API client → Express API: sends API requests
- Administrator → Admin pages: manages store
- Admin pages → API client: requests data
- Express API → Accounts and access: mounts routes (evidence: `backend/server.js`)
- Express API → Product catalog: mounts routes (evidence: `backend/server.js`)
- Express API → Orders and stock: mounts routes (evidence: `backend/server.js`)
- Express API → Product reviews: mounts routes (evidence: `backend/server.js`)
- Express API → Cart and wishlist: mounts routes (evidence: `backend/server.js`)
- Express API → Discount coupons: mounts routes (evidence: `backend/server.js`)
- Express API → Store content management: mounts routes (evidence: `backend/server.js`)
- Accounts and access → User records: reads and updates (evidence: `backend/controllers/authController.js`)
- Product catalog → Product records: queries and updates (evidence: `backend/controllers/productController.js`)
- Product catalog → Cloudinary image hosting: uploads images
- Orders and stock → Order records: creates and updates (evidence: `backend/controllers/orderController.js`)
- Orders and stock → Product records: checks and adjusts stock (evidence: `backend/controllers/orderController.js`)
- Orders and stock → User records: clears cart (evidence: `backend/controllers/orderController.js`)
- Product reviews → Review records: creates and queries (evidence: `backend/controllers/reviewController.js`)
- Product reviews → Product records: updates ratings (evidence: `backend/controllers/reviewController.js`)
- Discount coupons → Coupon records: queries (evidence: `backend/controllers/couponController.js`)
- Cart and wishlist → User records: updates cart (evidence: `backend/controllers/cartController.js`)
- Express API → MongoDB: connects (evidence: `backend/server.js`)
