# ritesh5585/onyx architecture

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

- Interactive diagram: https://gitdiagram.com/ritesh5585/onyx
- Repository: https://github.com/ritesh5585/onyx

## Overview

ONYX is a buyer-and-seller fashion commerce platform. Buyers browse products, choose variants, manage a wishlist and cart, provide shipping details, and proceed toward payment and order history; sellers manage listings and inventory. The graph preserves these domain areas and the Express route/controller/data layers. Some client and server modules are indexed but not excerpted, so their links are limited to documented capabilities or indexed references; dashed links indicate optional or incompletely verified integrations.

Main entry points: [`client/src/app/app.router.jsx`](https://github.com/ritesh5585/onyx/blob/main/client/src/app/app.router.jsx) (Route dispatch), [`server/src/app.js`](https://github.com/ritesh5585/onyx/blob/main/server/src/app.js) (Express API), [`server/src/controller/payment.controller.js`](https://github.com/ritesh5585/onyx/blob/main/server/src/controller/payment.controller.js) (Payment operations), [`client/src/features/Products/service/product.api.js`](https://github.com/ritesh5585/onyx/blob/main/client/src/features/Products/service/product.api.js) (Product API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client application"]
  node_client_app["React application<br/>[App.jsx]"]
  node_client_router["Route dispatch<br/>[app.router.jsx]"]
  node_client_store["Redux store<br/>[app.store.js]"]
  node_auth_ui["Authentication<br/>[useAuth.js]"]
end

subgraph group_catalog["Catalog and seller portal"]
  node_catalog_home["Storefront<br/>[Home.jsx]"]
  node_product_details["Product details<br/>[ProductDetails.jsx]"]
  node_seller_portal["Seller listings<br/>[Dashboard.jsx]"]
  node_product_creation["Product creation<br/>[CreatProduct.jsx]"]
  node_seller_detail["Variant management"]
  node_product_api["Product API<br/>[product.api.js]"]
end

subgraph group_buyer["Buyer commerce"]
  node_wishlist["Wishlist<br/>[getYourList.jsx]"]
  node_cart["Cart and checkout<br/>[Cart.jsx]"]
  node_addresses["Address book<br/>[useAddress.js]"]
  node_payment_ui["Payment initiation<br/>[RazorPay.jsx]"]
  node_orders_ui["Order history<br/>[MyOrders.jsx]"]
end

subgraph group_server["Server and persistence"]
  node_api_server["Express API<br/>[app.js]"]
  node_auth_routes["Auth routes<br/>[auth.router.js]"]
  node_product_routes["Product routes<br/>[product.routes.js]"]
  node_product_controller["Product operations"]
  node_cart_controller["Cart operations<br/>[cart.controller.js]"]
  node_cart_dao["Cart aggregation<br/>[cart.dao.js]"]
  node_address_controller["Address operations"]
  node_payment_controller["Payment operations"]
  node_order_controller["Order operations"]
  node_auth_controller["Identity operations<br/>[auth.controller.js]"]
  node_auth_middleware["JWT authorization<br/>[auth.middleware.js]"]
  node_product_model[("Product records<br/>[product.js]")]
  node_cart_model[("Cart records<br/>[cart.js]")]
  node_address_model[("Address records<br/>[address.js]")]
  node_user_model[("User records<br/>[user.js]")]
  node_order_model[("Order records<br/>[order.js]")]
  node_payment_service["Payment gateway adapter<br/>[payment.service.js]"]
end

subgraph group_integrations["External services"]
end

node_buyer_actor(("Buyer"))
node_seller_actor(("Seller"))

node_buyer_actor -->|"browses"| node_client_router
node_seller_actor -->|"opens portal"| node_client_router
node_client_app -->|"hosts routes"| node_client_router
node_client_app -->|"checks session"| node_auth_ui
node_client_router -->|"routes to"| node_catalog_home
node_client_router -->|"routes to"| node_product_details
node_client_router -->|"routes to"| node_seller_portal
node_client_router -->|"routes to"| node_product_creation
node_client_router -->|"routes to"| node_seller_detail
node_client_router -->|"routes to"| node_wishlist
node_client_router -->|"routes to"| node_cart
node_client_router -->|"routes to"| node_orders_ui
node_client_store -.->|"provides state"| node_client_app
node_auth_ui -->|"updates auth state"| node_client_store
node_catalog_home -->|"loads catalog"| node_product_api
node_seller_portal -.->|"manages listings"| node_product_api
node_product_creation -.->|"submits listing"| node_product_api
node_seller_detail -.->|"manages variants"| node_product_api
node_wishlist -.->|"updates wishlist state"| node_client_store
node_cart -.->|"selects address"| node_addresses
node_cart -.->|"initiates payment"| node_payment_ui
node_client_router -.->|"sends REST requests"| node_api_server
node_api_server -->|"mounts"| node_auth_routes
node_api_server -->|"mounts"| node_product_routes
node_api_server -->|"mounts cart routes"| node_cart_controller
node_api_server -->|"mounts address routes"| node_address_controller
node_api_server -->|"mounts payment routes"| node_payment_controller
node_api_server -->|"mounts order routes"| node_order_controller
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_routes -->|"protects profile"| node_auth_middleware
node_product_routes -->|"dispatches"| node_product_controller
node_product_routes -->|"guards seller routes"| node_auth_middleware
node_product_controller -->|"reads and writes"| node_product_model
node_product_controller -->|"uploads assets"| node_payment_service
node_cart_controller -->|"loads cart totals"| node_cart_dao
node_cart_controller -->|"updates cart"| node_cart_model
node_cart_dao -->|"aggregates"| node_cart_model
node_address_controller -->|"reads and writes"| node_address_model
node_auth_controller -->|"reads and writes"| node_user_model
node_auth_middleware -->|"resolves identity"| node_user_model
node_payment_controller -->|"creates gateway order"| node_payment_service
node_payment_controller -->|"reads cart"| node_cart_dao
node_payment_controller -->|"loads shipping address"| node_address_model
node_order_controller -->|"reads and writes"| node_order_model

click node_client_app "https://github.com/ritesh5585/onyx/blob/main/client/src/app/App.jsx"
click node_client_router "https://github.com/ritesh5585/onyx/blob/main/client/src/app/app.router.jsx"
click node_client_store "https://github.com/ritesh5585/onyx/blob/main/client/src/app/app.store.js"
click node_auth_ui "https://github.com/ritesh5585/onyx/blob/main/client/src/features/auth/hook/useAuth.js"
click node_catalog_home "https://github.com/ritesh5585/onyx/blob/main/client/src/features/Products/pages/Home.jsx"
click node_product_details "https://github.com/ritesh5585/onyx/blob/main/client/src/features/Products/pages/ProductDetails.jsx"
click node_seller_portal "https://github.com/ritesh5585/onyx/blob/main/client/src/features/Products/pages/Dashboard.jsx"
click node_product_creation "https://github.com/ritesh5585/onyx/blob/main/client/src/features/Products/pages/CreatProduct.jsx"
click node_seller_detail "https://github.com/ritesh5585/onyx/blob/main/client/src/features/Products/pages/SellerProductdetail.jsx"
click node_product_api "https://github.com/ritesh5585/onyx/blob/main/client/src/features/Products/service/product.api.js"
click node_wishlist "https://github.com/ritesh5585/onyx/blob/main/client/src/features/Wishlists/pages/getYourList.jsx"
click node_cart "https://github.com/ritesh5585/onyx/blob/main/client/src/features/cart/pages/Cart.jsx"
click node_addresses "https://github.com/ritesh5585/onyx/blob/main/client/src/features/cart/hooks/useAddress.js"
click node_payment_ui "https://github.com/ritesh5585/onyx/blob/main/client/src/features/cart/components/RazorPay.jsx"
click node_orders_ui "https://github.com/ritesh5585/onyx/blob/main/client/src/features/orders/pages/MyOrders.jsx"
click node_api_server "https://github.com/ritesh5585/onyx/blob/main/server/src/app.js"
click node_auth_routes "https://github.com/ritesh5585/onyx/blob/main/server/src/routes/auth.router.js"
click node_product_routes "https://github.com/ritesh5585/onyx/blob/main/server/src/routes/product.routes.js"
click node_product_controller "https://github.com/ritesh5585/onyx/blob/main/server/src/controller/product.controller.js"
click node_cart_controller "https://github.com/ritesh5585/onyx/blob/main/server/src/controller/cart.controller.js"
click node_cart_dao "https://github.com/ritesh5585/onyx/blob/main/server/src/dao/cart.dao.js"
click node_address_controller "https://github.com/ritesh5585/onyx/blob/main/server/src/controller/address.controller.js"
click node_payment_controller "https://github.com/ritesh5585/onyx/blob/main/server/src/controller/payment.controller.js"
click node_order_controller "https://github.com/ritesh5585/onyx/blob/main/server/src/controller/order.controller.js"
click node_auth_controller "https://github.com/ritesh5585/onyx/blob/main/server/src/controller/auth.controller.js"
click node_auth_middleware "https://github.com/ritesh5585/onyx/blob/main/server/src/middleware/auth.middleware.js"
click node_product_model "https://github.com/ritesh5585/onyx/blob/main/server/src/models/product.js"
click node_cart_model "https://github.com/ritesh5585/onyx/blob/main/server/src/models/cart.js"
click node_address_model "https://github.com/ritesh5585/onyx/blob/main/server/src/models/address.js"
click node_user_model "https://github.com/ritesh5585/onyx/blob/main/server/src/models/user.js"
click node_order_model "https://github.com/ritesh5585/onyx/blob/main/server/src/models/order.js"
click node_payment_service "https://github.com/ritesh5585/onyx/blob/main/server/src/services/payment.service.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_client_app,node_client_router,node_client_store,node_auth_ui toneBlue
class node_catalog_home,node_product_details,node_seller_portal,node_product_creation,node_seller_detail,node_product_api toneAmber
class node_wishlist,node_cart,node_addresses,node_payment_ui,node_orders_ui toneMint
class node_api_server,node_auth_routes,node_product_routes,node_product_controller,node_cart_controller,node_cart_dao,node_address_controller,node_payment_controller,node_order_controller,node_auth_controller,node_auth_middleware,node_product_model,node_cart_model,node_address_model,node_user_model,node_order_model,node_payment_service toneRose
class node_buyer_actor,node_seller_actor toneIndigo
```

## Components

### Client application

- [React application](https://github.com/ritesh5585/onyx/blob/main/client/src/app/App.jsx): `client/src/app/App.jsx`
- [Route dispatch](https://github.com/ritesh5585/onyx/blob/main/client/src/app/app.router.jsx): `client/src/app/app.router.jsx`
- [Redux store](https://github.com/ritesh5585/onyx/blob/main/client/src/app/app.store.js): `client/src/app/app.store.js`
- [Authentication](https://github.com/ritesh5585/onyx/blob/main/client/src/features/auth/hook/useAuth.js): `client/src/features/auth/hook/useAuth.js`

### Catalog and seller portal

- [Storefront](https://github.com/ritesh5585/onyx/blob/main/client/src/features/Products/pages/Home.jsx): `client/src/features/Products/pages/Home.jsx`
- [Product details](https://github.com/ritesh5585/onyx/blob/main/client/src/features/Products/pages/ProductDetails.jsx): `client/src/features/Products/pages/ProductDetails.jsx`
- [Seller listings](https://github.com/ritesh5585/onyx/blob/main/client/src/features/Products/pages/Dashboard.jsx): `client/src/features/Products/pages/Dashboard.jsx`
- [Product creation](https://github.com/ritesh5585/onyx/blob/main/client/src/features/Products/pages/CreatProduct.jsx): `client/src/features/Products/pages/CreatProduct.jsx`
- [Variant management](https://github.com/ritesh5585/onyx/blob/main/client/src/features/Products/pages/SellerProductdetail.jsx): `client/src/features/Products/pages/SellerProductdetail.jsx`
- [Product API](https://github.com/ritesh5585/onyx/blob/main/client/src/features/Products/service/product.api.js): `client/src/features/Products/service/product.api.js`

### Buyer commerce

- [Wishlist](https://github.com/ritesh5585/onyx/blob/main/client/src/features/Wishlists/pages/getYourList.jsx): `client/src/features/Wishlists/pages/getYourList.jsx`
- [Cart and checkout](https://github.com/ritesh5585/onyx/blob/main/client/src/features/cart/pages/Cart.jsx): `client/src/features/cart/pages/Cart.jsx`
- [Address book](https://github.com/ritesh5585/onyx/blob/main/client/src/features/cart/hooks/useAddress.js): `client/src/features/cart/hooks/useAddress.js`
- [Payment initiation](https://github.com/ritesh5585/onyx/blob/main/client/src/features/cart/components/RazorPay.jsx): `client/src/features/cart/components/RazorPay.jsx`
- [Order history](https://github.com/ritesh5585/onyx/blob/main/client/src/features/orders/pages/MyOrders.jsx): `client/src/features/orders/pages/MyOrders.jsx`

### Server and persistence

- [Express API](https://github.com/ritesh5585/onyx/blob/main/server/src/app.js): `server/src/app.js`
- [Auth routes](https://github.com/ritesh5585/onyx/blob/main/server/src/routes/auth.router.js): `server/src/routes/auth.router.js`
- [Product routes](https://github.com/ritesh5585/onyx/blob/main/server/src/routes/product.routes.js): `server/src/routes/product.routes.js`
- [Product operations](https://github.com/ritesh5585/onyx/blob/main/server/src/controller/product.controller.js): `server/src/controller/product.controller.js`
- [Cart operations](https://github.com/ritesh5585/onyx/blob/main/server/src/controller/cart.controller.js): `server/src/controller/cart.controller.js`
- [Cart aggregation](https://github.com/ritesh5585/onyx/blob/main/server/src/dao/cart.dao.js): `server/src/dao/cart.dao.js`
- [Address operations](https://github.com/ritesh5585/onyx/blob/main/server/src/controller/address.controller.js): `server/src/controller/address.controller.js`
- [Payment operations](https://github.com/ritesh5585/onyx/blob/main/server/src/controller/payment.controller.js): `server/src/controller/payment.controller.js`
- [Order operations](https://github.com/ritesh5585/onyx/blob/main/server/src/controller/order.controller.js): `server/src/controller/order.controller.js`
- [Identity operations](https://github.com/ritesh5585/onyx/blob/main/server/src/controller/auth.controller.js): `server/src/controller/auth.controller.js`
- [JWT authorization](https://github.com/ritesh5585/onyx/blob/main/server/src/middleware/auth.middleware.js): `server/src/middleware/auth.middleware.js`
- [Product records](https://github.com/ritesh5585/onyx/blob/main/server/src/models/product.js): `server/src/models/product.js`
- [Cart records](https://github.com/ritesh5585/onyx/blob/main/server/src/models/cart.js): `server/src/models/cart.js`
- [Address records](https://github.com/ritesh5585/onyx/blob/main/server/src/models/address.js): `server/src/models/address.js`
- [User records](https://github.com/ritesh5585/onyx/blob/main/server/src/models/user.js): `server/src/models/user.js`
- [Order records](https://github.com/ritesh5585/onyx/blob/main/server/src/models/order.js): `server/src/models/order.js`
- [Payment gateway adapter](https://github.com/ritesh5585/onyx/blob/main/server/src/services/payment.service.js): `server/src/services/payment.service.js`

### Other components

- **Buyer**
- **Seller**

## Connections

- Buyer → Route dispatch: browses (evidence: `client/src/app/app.router.jsx`)
- Seller → Route dispatch: opens portal (evidence: `client/src/app/app.router.jsx`)
- React application → Route dispatch: hosts routes (evidence: `client/src/app/App.jsx`)
- React application → Authentication: checks session (evidence: `client/src/app/App.jsx`)
- Route dispatch → Storefront: routes to (evidence: `client/src/app/app.router.jsx`)
- Route dispatch → Product details: routes to (evidence: `client/src/app/app.router.jsx`)
- Route dispatch → Seller listings: routes to (evidence: `client/src/app/app.router.jsx`)
- Route dispatch → Product creation: routes to (evidence: `client/src/app/app.router.jsx`)
- Route dispatch → Variant management: routes to (evidence: `client/src/app/app.router.jsx`)
- Route dispatch → Wishlist: routes to (evidence: `client/src/app/app.router.jsx`)
- Route dispatch → Cart and checkout: routes to (evidence: `client/src/app/app.router.jsx`)
- Route dispatch → Order history: routes to (evidence: `client/src/app/app.router.jsx`)
- Redux store → React application: provides state
- Authentication → Redux store: updates auth state (evidence: `client/src/features/auth/hook/useAuth.js`)
- Storefront → Product API: loads catalog (evidence: `client/src/features/Products/pages/Home.jsx`)
- Seller listings → Product API: manages listings (evidence: `README.md`)
- Product creation → Product API: submits listing (evidence: `README.md`)
- Variant management → Product API: manages variants (evidence: `README.md`)
- Wishlist → Redux store: updates wishlist state
- Cart and checkout → Address book: selects address (evidence: `README.md`)
- Cart and checkout → Payment initiation: initiates payment (evidence: `README.md`)
- Route dispatch → Express API: sends REST requests (evidence: `README.md`)
- Express API → Auth routes: mounts (evidence: `server/src/app.js`)
- Express API → Product routes: mounts (evidence: `server/src/app.js`)
- Express API → Cart operations: mounts cart routes (evidence: `server/src/app.js`)
- Express API → Address operations: mounts address routes (evidence: `server/src/app.js`)
- Express API → Payment operations: mounts payment routes (evidence: `server/src/app.js`)
- Express API → Order operations: mounts order routes (evidence: `server/src/app.js`)
- Auth routes → Identity operations: dispatches (evidence: `server/src/routes/auth.router.js`)
- Auth routes → JWT authorization: protects profile (evidence: `server/src/routes/auth.router.js`)
- Product routes → Product operations: dispatches (evidence: `server/src/routes/product.routes.js`)
- Product routes → JWT authorization: guards seller routes (evidence: `server/src/routes/product.routes.js`)
- Product operations → Product records: reads and writes (evidence: `server/src/controller/product.controller.js`)
- Product operations → Payment gateway adapter: uploads assets (evidence: `server/src/controller/product.controller.js`)
- Cart operations → Cart aggregation: loads cart totals (evidence: `server/src/controller/cart.controller.js`)
- Cart operations → Cart records: updates cart (evidence: `server/src/controller/cart.controller.js`)
- Cart aggregation → Cart records: aggregates (evidence: `server/src/dao/cart.dao.js`)
- Address operations → Address records: reads and writes (evidence: `server/src/controller/address.controller.js`)
- Identity operations → User records: reads and writes (evidence: `server/src/controller/auth.controller.js`)
- JWT authorization → User records: resolves identity (evidence: `server/src/middleware/auth.middleware.js`)
- Payment operations → Payment gateway adapter: creates gateway order (evidence: `server/src/controller/payment.controller.js`)
- Payment operations → Cart aggregation: reads cart (evidence: `server/src/controller/payment.controller.js`)
- Payment operations → Address records: loads shipping address (evidence: `server/src/controller/payment.controller.js`)
- Order operations → Order records: reads and writes (evidence: `server/src/controller/order.controller.js`)
