# razakhan83/china-unique-store-main architecture

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

- Interactive diagram: https://gitdiagram.com/razakhan83/china-unique-store-main
- Repository: https://github.com/razakhan83/china-unique-store-main

## Overview

This is a Next.js commerce application with a customer storefront, checkout and order pages, plus an administrative back office. The intended shopper journey is product discovery, cart, checkout, and order tracking; the tree identifies those stages, but the excerpts do not establish their runtime wiring. The graph therefore focuses on verified API, persistence, authentication, and review flows. Dashed links indicate plausible UI-to-service connections not confirmed by sampled source; unsampled capabilities are represented by their exact route directories.

Main entry points: [`src/app/api/reviews/route.js`](https://github.com/razakhan83/china-unique-store-main/blob/main/src/app/api/reviews/route.js) (Reviews API), [`src/lib/mongooseConnect.js`](https://github.com/razakhan83/china-unique-store-main/blob/main/src/lib/mongooseConnect.js) (Mongo connection), [`src/app/api/products/route.js`](https://github.com/razakhan83/china-unique-store-main/blob/main/src/app/api/products/route.js) (Product API), [`src/models/Product.js`](https://github.com/razakhan83/china-unique-store-main/blob/main/src/models/Product.js) (Products)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Customer storefront"]
  node_storefront["Storefront pages"]
  node_catalog["Product catalog"]
  node_cart["Cart state<br/>[CartContext.jsx]"]
  node_checkout["Checkout"]
  node_orders["Order pages"]
  node_wishlist["Wishlist"]
  node_reviewform["Review form"]
end

subgraph group_commerce["Commerce services"]
  node_productapi["Product API<br/>[route.js]"]
  node_categoryapi["Category API<br/>[route.js]"]
  node_reviewsapi["Reviews API<br/>[route.js]"]
  node_settingsapi["Store settings API<br/>[route.js]"]
  node_orderfulfillment["Order fulfillment"]
  node_pricing["Pricing helpers<br/>[pricing.js]"]
  node_tracking["Client tracking<br/>[clientTracking.js]"]
end

subgraph group_admin["Store administration"]
  node_admin["Admin console"]
  node_adminreviews["Review management"]
end

subgraph group_platform["Identity and persistence"]
  node_auth["Authentication<br/>[auth.js]"]
  node_mongo["Mongo connection<br/>[mongooseConnect.js]"]
  node_products[("Products<br/>[Product.js]")]
  node_categories[("Categories<br/>[Category.js]")]
  node_settings[("Settings<br/>[Settings.js]")]
  node_reviews[("Reviews<br/>[Review.js]")]
  node_ordersdb[("Orders<br/>[Order.js]")]
  node_users[("Users<br/>[User.js]")]
  node_vendors[("Vendors<br/>[Vendor.js]")]
end

node_shopper(("Shopper"))

node_shopper -.->|"browses"| node_storefront
node_shopper -.->|"discovers products"| node_catalog
node_shopper -.->|"manages cart"| node_cart
node_shopper -.->|"checks out"| node_checkout
node_shopper -.->|"tracks orders"| node_orders
node_shopper -.->|"saves items"| node_wishlist
node_catalog -.->|"loads products"| node_productapi
node_cart -->|"uses pricing"| node_pricing
node_cart -->|"records activity"| node_tracking
node_reviewform -->|"submits review"| node_reviewsapi
node_productapi -->|"connects"| node_mongo
node_productapi -->|"reads and writes"| node_products
node_productapi -->|"uses categories"| node_categories
node_categoryapi -->|"connects"| node_mongo
node_categoryapi -->|"reads and writes"| node_categories
node_categoryapi -->|"counts products"| node_products
node_settingsapi -->|"connects"| node_mongo
node_settingsapi -->|"reads and writes"| node_settings
node_reviewsapi -->|"connects"| node_mongo
node_reviewsapi -->|"reads and writes"| node_reviews
node_reviewsapi -->|"checks product"| node_products
node_reviewsapi -->|"checks purchase"| node_ordersdb
node_reviewsapi -->|"resolves reviewer"| node_users
node_auth -->|"connects"| node_mongo
node_auth -->|"checks accounts"| node_users
node_orderfulfillment -->|"connects"| node_mongo
node_orderfulfillment -->|"updates products"| node_products
node_orderfulfillment -->|"uses vendors"| node_vendors
node_admin -.->|"includes review tools"| node_adminreviews
node_adminreviews -.->|"manages reviews"| node_reviewsapi

click node_storefront "https://github.com/razakhan83/china-unique-store-main/tree/main/src/app/(store)"
click node_catalog "https://github.com/razakhan83/china-unique-store-main/tree/main/src/app/(store)/(shop)/products"
click node_cart "https://github.com/razakhan83/china-unique-store-main/blob/main/src/context/CartContext.jsx"
click node_checkout "https://github.com/razakhan83/china-unique-store-main/tree/main/src/app/(store)/(checkout-shell)/checkout"
click node_orders "https://github.com/razakhan83/china-unique-store-main/tree/main/src/app/(store)/(content)/orders"
click node_wishlist "https://github.com/razakhan83/china-unique-store-main/blob/main/src/context/WishlistContext.jsx"
click node_reviewform "https://github.com/razakhan83/china-unique-store-main/blob/main/src/components/ProductReviewsClient.jsx"
click node_productapi "https://github.com/razakhan83/china-unique-store-main/blob/main/src/app/api/products/route.js"
click node_categoryapi "https://github.com/razakhan83/china-unique-store-main/blob/main/src/app/api/categories/route.js"
click node_reviewsapi "https://github.com/razakhan83/china-unique-store-main/blob/main/src/app/api/reviews/route.js"
click node_settingsapi "https://github.com/razakhan83/china-unique-store-main/blob/main/src/app/api/settings/route.js"
click node_orderfulfillment "https://github.com/razakhan83/china-unique-store-main/blob/main/src/lib/orderFulfillment.js"
click node_admin "https://github.com/razakhan83/china-unique-store-main/tree/main/src/app/admin"
click node_adminreviews "https://github.com/razakhan83/china-unique-store-main/blob/main/src/app/admin/reviews/AdminReviewsClient.jsx"
click node_auth "https://github.com/razakhan83/china-unique-store-main/blob/main/src/lib/auth.js"
click node_mongo "https://github.com/razakhan83/china-unique-store-main/blob/main/src/lib/mongooseConnect.js"
click node_products "https://github.com/razakhan83/china-unique-store-main/blob/main/src/models/Product.js"
click node_categories "https://github.com/razakhan83/china-unique-store-main/blob/main/src/models/Category.js"
click node_settings "https://github.com/razakhan83/china-unique-store-main/blob/main/src/models/Settings.js"
click node_reviews "https://github.com/razakhan83/china-unique-store-main/blob/main/src/models/Review.js"
click node_ordersdb "https://github.com/razakhan83/china-unique-store-main/blob/main/src/models/Order.js"
click node_users "https://github.com/razakhan83/china-unique-store-main/blob/main/src/models/User.js"
click node_vendors "https://github.com/razakhan83/china-unique-store-main/blob/main/src/models/Vendor.js"
click node_pricing "https://github.com/razakhan83/china-unique-store-main/blob/main/src/lib/pricing.js"
click node_tracking "https://github.com/razakhan83/china-unique-store-main/blob/main/src/lib/clientTracking.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_storefront,node_catalog,node_cart,node_checkout,node_orders,node_wishlist,node_reviewform toneBlue
class node_productapi,node_categoryapi,node_reviewsapi,node_settingsapi,node_orderfulfillment,node_pricing,node_tracking toneAmber
class node_admin,node_adminreviews toneMint
class node_auth,node_mongo,node_products,node_categories,node_settings,node_reviews,node_ordersdb,node_users,node_vendors toneRose
class node_shopper toneIndigo
```

## Components

### Customer storefront

- [Storefront pages](https://github.com/razakhan83/china-unique-store-main/tree/main/src/app/(store)): `src/app/(store)`
- [Product catalog](https://github.com/razakhan83/china-unique-store-main/tree/main/src/app/(store)/(shop)/products): `src/app/(store)/(shop)/products`
- [Cart state](https://github.com/razakhan83/china-unique-store-main/blob/main/src/context/CartContext.jsx): `src/context/CartContext.jsx`
- [Checkout](https://github.com/razakhan83/china-unique-store-main/tree/main/src/app/(store)/(checkout-shell)/checkout): `src/app/(store)/(checkout-shell)/checkout`
- [Order pages](https://github.com/razakhan83/china-unique-store-main/tree/main/src/app/(store)/(content)/orders): `src/app/(store)/(content)/orders`
- [Wishlist](https://github.com/razakhan83/china-unique-store-main/blob/main/src/context/WishlistContext.jsx): `src/context/WishlistContext.jsx`
- [Review form](https://github.com/razakhan83/china-unique-store-main/blob/main/src/components/ProductReviewsClient.jsx): `src/components/ProductReviewsClient.jsx`

### Commerce services

- [Product API](https://github.com/razakhan83/china-unique-store-main/blob/main/src/app/api/products/route.js): `src/app/api/products/route.js`
- [Category API](https://github.com/razakhan83/china-unique-store-main/blob/main/src/app/api/categories/route.js): `src/app/api/categories/route.js`
- [Reviews API](https://github.com/razakhan83/china-unique-store-main/blob/main/src/app/api/reviews/route.js): `src/app/api/reviews/route.js`
- [Store settings API](https://github.com/razakhan83/china-unique-store-main/blob/main/src/app/api/settings/route.js): `src/app/api/settings/route.js`
- [Order fulfillment](https://github.com/razakhan83/china-unique-store-main/blob/main/src/lib/orderFulfillment.js): `src/lib/orderFulfillment.js`
- [Pricing helpers](https://github.com/razakhan83/china-unique-store-main/blob/main/src/lib/pricing.js): `src/lib/pricing.js`
- [Client tracking](https://github.com/razakhan83/china-unique-store-main/blob/main/src/lib/clientTracking.js): `src/lib/clientTracking.js`

### Store administration

- [Admin console](https://github.com/razakhan83/china-unique-store-main/tree/main/src/app/admin): `src/app/admin`
- [Review management](https://github.com/razakhan83/china-unique-store-main/blob/main/src/app/admin/reviews/AdminReviewsClient.jsx): `src/app/admin/reviews/AdminReviewsClient.jsx`

### Identity and persistence

- [Authentication](https://github.com/razakhan83/china-unique-store-main/blob/main/src/lib/auth.js): `src/lib/auth.js`
- [Mongo connection](https://github.com/razakhan83/china-unique-store-main/blob/main/src/lib/mongooseConnect.js): `src/lib/mongooseConnect.js`
- [Products](https://github.com/razakhan83/china-unique-store-main/blob/main/src/models/Product.js): `src/models/Product.js`
- [Categories](https://github.com/razakhan83/china-unique-store-main/blob/main/src/models/Category.js): `src/models/Category.js`
- [Settings](https://github.com/razakhan83/china-unique-store-main/blob/main/src/models/Settings.js): `src/models/Settings.js`
- [Reviews](https://github.com/razakhan83/china-unique-store-main/blob/main/src/models/Review.js): `src/models/Review.js`
- [Orders](https://github.com/razakhan83/china-unique-store-main/blob/main/src/models/Order.js): `src/models/Order.js`
- [Users](https://github.com/razakhan83/china-unique-store-main/blob/main/src/models/User.js): `src/models/User.js`
- [Vendors](https://github.com/razakhan83/china-unique-store-main/blob/main/src/models/Vendor.js): `src/models/Vendor.js`

### Other components

- **Shopper**

## Connections

- Shopper → Storefront pages: browses
- Shopper → Product catalog: discovers products
- Shopper → Cart state: manages cart
- Shopper → Checkout: checks out
- Shopper → Order pages: tracks orders
- Shopper → Wishlist: saves items
- Product catalog → Product API: loads products
- Cart state → Pricing helpers: uses pricing (evidence: `src/context/CartContext.jsx`)
- Cart state → Client tracking: records activity (evidence: `src/context/CartContext.jsx`)
- Review form → Reviews API: submits review (evidence: `src/components/ProductReviewsClient.jsx`)
- Product API → Mongo connection: connects (evidence: `src/app/api/products/route.js`)
- Product API → Products: reads and writes (evidence: `src/app/api/products/route.js`)
- Product API → Categories: uses categories (evidence: `src/app/api/products/route.js`)
- Category API → Mongo connection: connects (evidence: `src/app/api/categories/route.js`)
- Category API → Categories: reads and writes (evidence: `src/app/api/categories/route.js`)
- Category API → Products: counts products (evidence: `src/app/api/categories/route.js`)
- Store settings API → Mongo connection: connects (evidence: `src/app/api/settings/route.js`)
- Store settings API → Settings: reads and writes (evidence: `src/app/api/settings/route.js`)
- Reviews API → Mongo connection: connects (evidence: `src/app/api/reviews/route.js`)
- Reviews API → Reviews: reads and writes (evidence: `src/app/api/reviews/route.js`)
- Reviews API → Products: checks product (evidence: `src/app/api/reviews/route.js`)
- Reviews API → Orders: checks purchase (evidence: `src/app/api/reviews/route.js`)
- Reviews API → Users: resolves reviewer (evidence: `src/app/api/reviews/route.js`)
- Authentication → Mongo connection: connects (evidence: `src/lib/auth.js`)
- Authentication → Users: checks accounts (evidence: `src/lib/auth.js`)
- Order fulfillment → Mongo connection: connects (evidence: `src/lib/orderFulfillment.js`)
- Order fulfillment → Products: updates products (evidence: `src/lib/orderFulfillment.js`)
- Order fulfillment → Vendors: uses vendors (evidence: `src/lib/orderFulfillment.js`)
- Admin console → Review management: includes review tools
- Review management → Reviews API: manages reviews
