# dungdinhhaha/ecommerce-skillhub architecture

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

- Interactive diagram: https://gitdiagram.com/dungdinhhaha/ecommerce-skillhub
- Repository: https://github.com/dungdinhhaha/ecommerce-skillhub

## Overview

SkillHub is a marketplace for skill services and digital products. Users browse listings, create or buy gigs, pay, exchange messages, receive deliveries, and manage orders; sellers manage listings and earnings, while administrators moderate marketplace activity. The React client routes users to these workflows and calls the Express API. Sampled source confirms order, review, authentication, and administrative data handling; other listed capabilities are represented at subsystem level where their implementations were not excerpted.

Main entry points: [`server/controllers/admin.controller.js`](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/controllers/admin.controller.js) (Admin operations), [`client/src/utils/routes.utils.jsx`](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/client/src/utils/routes.utils.jsx) (Page routing), [`server/server.js`](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/server.js) (Express API), [`server/controllers/order.controller.js`](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/controllers/order.controller.js) (Order lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Marketplace client"]
  node_app["React application<br/>[App.jsx]"]
  node_routing["Page routing<br/>[routes.utils.jsx]"]
  node_browse["Browse and search<br/>[Gigs.jsx]"]
  node_listing["Gig details<br/>[Gig.jsx]"]
  node_seller["Seller workspace<br/>[Add.jsx]"]
  node_buyer["Buyer orders<br/>[Orders.jsx]"]
  node_conversations["Messaging<br/>[Messages.jsx]"]
  node_clientrequest["API request helper<br/>[request.utils.js]"]
end

subgraph group_api["API and identity"]
  node_server["Express API<br/>[server.js]"]
  node_auth["Authentication<br/>[auth.controller.js]"]
  node_identity[("Identity records<br/>[user.model.js]")]
end

subgraph group_market["Marketplace domain"]
  node_catalog["Gig catalog<br/>[gig.controller.js]"]
  node_gigdata[("Gig records<br/>[gig.model.js]")]
  node_reviews["Reviews"]
end

subgraph group_commerce["Orders and finance"]
  node_orders["Order lifecycle"]
  node_orderdata[("Order records<br/>[order.model.js]")]
  node_refunddata[("Refund records<br/>[refund.model.js]")]
  node_wallet["Wallet and payouts"]
  node_withdrawals[("Withdrawal records")]
end

subgraph group_operations["Administration"]
  node_admin["Admin operations"]
  node_vouchers["Voucher management"]
end

node_visitor(("Marketplace user"))
node_db[("MongoDB")]

node_visitor -->|"uses"| node_app
node_app -->|"loads routes"| node_routing
node_routing -->|"routes to"| node_browse
node_routing -->|"routes to"| node_listing
node_routing -->|"routes to"| node_seller
node_routing -->|"routes to"| node_buyer
node_routing -->|"routes to"| node_conversations
node_browse -.->|"fetches data"| node_clientrequest
node_listing -.->|"fetches data"| node_clientrequest
node_buyer -.->|"calls API"| node_clientrequest
node_clientrequest -.->|"sends requests"| node_server
node_server -->|"routes auth"| node_auth
node_server -->|"routes gigs"| node_catalog
node_server -->|"routes admin"| node_admin
node_auth -->|"reads and writes"| node_identity
node_catalog -->|"reads and writes"| node_gigdata
node_reviews -->|"updates ratings"| node_gigdata
node_reviews -->|"checks completion"| node_orderdata
node_orders -->|"loads listing"| node_gigdata
node_orders -->|"reads and writes"| node_orderdata
node_orders -->|"loads users"| node_identity
node_orders -->|"uses refunds"| node_refunddata
node_wallet -->|"reads orders"| node_orderdata
node_wallet -->|"reads and writes"| node_withdrawals
node_admin -->|"moderates listings"| node_gigdata
node_admin -->|"manages orders"| node_orderdata
node_admin -->|"manages users"| node_identity
node_admin -->|"manages payouts"| node_withdrawals
node_admin -->|"manages refunds"| node_refunddata
node_admin -->|"manages vouchers"| node_vouchers
node_server -->|"connects database"| node_db

click node_app "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/client/src/App.jsx"
click node_routing "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/client/src/utils/routes.utils.jsx"
click node_browse "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/client/src/pages/gigs/Gigs.jsx"
click node_listing "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/client/src/pages/gig/Gig.jsx"
click node_seller "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/client/src/pages/add/Add.jsx"
click node_buyer "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/client/src/pages/orders/Orders.jsx"
click node_conversations "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/client/src/pages/messages/Messages.jsx"
click node_clientrequest "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/client/src/utils/request.utils.js"
click node_server "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/server.js"
click node_auth "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/controllers/auth.controller.js"
click node_identity "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/models/user.model.js"
click node_catalog "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/controllers/gig.controller.js"
click node_gigdata "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/models/gig.model.js"
click node_reviews "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/controllers/review.controller.js"
click node_orders "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/controllers/order.controller.js"
click node_orderdata "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/models/order.model.js"
click node_refunddata "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/models/refund.model.js"
click node_wallet "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/controllers/wallet.controller.js"
click node_withdrawals "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/models/withdrawal.model.js"
click node_admin "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/controllers/admin.controller.js"
click node_vouchers "https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/controllers/voucher.controller.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_app,node_routing,node_browse,node_listing,node_seller,node_buyer,node_conversations,node_clientrequest,node_visitor toneBlue
class node_server,node_auth,node_identity,node_db toneAmber
class node_catalog,node_gigdata,node_reviews toneMint
class node_orders,node_orderdata,node_refunddata,node_wallet,node_withdrawals toneRose
class node_admin,node_vouchers toneIndigo
```

## Components

### Marketplace client

- [React application](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/client/src/App.jsx): `client/src/App.jsx`
- [Page routing](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/client/src/utils/routes.utils.jsx): `client/src/utils/routes.utils.jsx`
- [Browse and search](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/client/src/pages/gigs/Gigs.jsx): `client/src/pages/gigs/Gigs.jsx`
- [Gig details](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/client/src/pages/gig/Gig.jsx): `client/src/pages/gig/Gig.jsx`
- [Seller workspace](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/client/src/pages/add/Add.jsx): `client/src/pages/add/Add.jsx`
- [Buyer orders](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/client/src/pages/orders/Orders.jsx): `client/src/pages/orders/Orders.jsx`
- [Messaging](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/client/src/pages/messages/Messages.jsx): `client/src/pages/messages/Messages.jsx`
- [API request helper](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/client/src/utils/request.utils.js): `client/src/utils/request.utils.js`

### API and identity

- [Express API](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/server.js): `server/server.js`
- [Authentication](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/controllers/auth.controller.js): `server/controllers/auth.controller.js`
- [Identity records](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/models/user.model.js): `server/models/user.model.js`

### Marketplace domain

- [Gig catalog](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/controllers/gig.controller.js): `server/controllers/gig.controller.js`
- [Gig records](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/models/gig.model.js): `server/models/gig.model.js`
- [Reviews](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/controllers/review.controller.js): `server/controllers/review.controller.js`

### Orders and finance

- [Order lifecycle](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/controllers/order.controller.js): `server/controllers/order.controller.js`
- [Order records](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/models/order.model.js): `server/models/order.model.js`
- [Refund records](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/models/refund.model.js): `server/models/refund.model.js`
- [Wallet and payouts](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/controllers/wallet.controller.js): `server/controllers/wallet.controller.js`
- [Withdrawal records](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/models/withdrawal.model.js): `server/models/withdrawal.model.js`

### Administration

- [Admin operations](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/controllers/admin.controller.js): `server/controllers/admin.controller.js`
- [Voucher management](https://github.com/dungdinhhaha/ecommerce-skillhub/blob/master/server/controllers/voucher.controller.js): `server/controllers/voucher.controller.js`

### Other components

- **Marketplace user**
- **MongoDB**

## Connections

- Marketplace user → React application: uses
- React application → Page routing: loads routes (evidence: `client/src/App.jsx`)
- Page routing → Browse and search: routes to (evidence: `client/src/utils/routes.utils.jsx`)
- Page routing → Gig details: routes to (evidence: `client/src/utils/routes.utils.jsx`)
- Page routing → Seller workspace: routes to (evidence: `client/src/utils/routes.utils.jsx`)
- Page routing → Buyer orders: routes to (evidence: `client/src/utils/routes.utils.jsx`)
- Page routing → Messaging: routes to (evidence: `client/src/utils/routes.utils.jsx`)
- Browse and search → API request helper: fetches data
- Gig details → API request helper: fetches data
- Buyer orders → API request helper: calls API
- API request helper → Express API: sends requests
- Express API → Authentication: routes auth (evidence: `server/server.js`)
- Express API → Gig catalog: routes gigs (evidence: `server/server.js`)
- Express API → Admin operations: routes admin (evidence: `server/server.js`)
- Authentication → Identity records: reads and writes (evidence: `server/controllers/auth.controller.js`)
- Gig catalog → Gig records: reads and writes (evidence: `server/controllers/gig.controller.js`)
- Reviews → Gig records: updates ratings (evidence: `server/controllers/review.controller.js`)
- Reviews → Order records: checks completion (evidence: `server/controllers/review.controller.js`)
- Order lifecycle → Gig records: loads listing (evidence: `server/controllers/order.controller.js`)
- Order lifecycle → Order records: reads and writes (evidence: `server/controllers/order.controller.js`)
- Order lifecycle → Identity records: loads users (evidence: `server/controllers/order.controller.js`)
- Order lifecycle → Refund records: uses refunds (evidence: `server/controllers/order.controller.js`)
- Wallet and payouts → Order records: reads orders (evidence: `server/controllers/wallet.controller.js`)
- Wallet and payouts → Withdrawal records: reads and writes (evidence: `server/controllers/wallet.controller.js`)
- Admin operations → Gig records: moderates listings (evidence: `server/controllers/admin.controller.js`)
- Admin operations → Order records: manages orders (evidence: `server/controllers/admin.controller.js`)
- Admin operations → Identity records: manages users (evidence: `server/controllers/admin.controller.js`)
- Admin operations → Withdrawal records: manages payouts (evidence: `server/controllers/admin.controller.js`)
- Admin operations → Refund records: manages refunds (evidence: `server/controllers/admin.controller.js`)
- Admin operations → Voucher management: manages vouchers (evidence: `server/controllers/admin.controller.js`)
- Express API → MongoDB: connects database (evidence: `server/server.js`)
