# trongnguyendz/tmdt-promax architecture

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

- Interactive diagram: https://gitdiagram.com/trongnguyendz/tmdt-promax
- Repository: https://github.com/trongnguyendz/tmdt-promax

## Overview

This is an e-commerce storefront and operations platform: customers browse products, manage carts and accounts, and place and pay for orders; staff and administrators manage fulfillment and catalog operations. The frontend sits in front of a versioned API gateway and domain services. The graph preserves major capabilities visible in the repository tree, including shipment, reviews, banners, support, and staff scheduling. Source excerpts establish several internal calls; many gateway-to-service and frontend-to-API connections are unverified because their route and client implementations were not sampled.

Main entry points: [`be/api-gateway/routes`](https://github.com/trongnguyendz/tmdt-promax/tree/main/be/api-gateway/routes) (Gateway route handlers), [`be/order-service/controllers/orderController.js`](https://github.com/trongnguyendz/tmdt-promax/blob/main/be/order-service/controllers/orderController.js) (Orders and wishlist), [`fe/src/App.vue`](https://github.com/trongnguyendz/tmdt-promax/blob/main/fe/src/App.vue) (Role-based web app), [`be/api-gateway/server.js`](https://github.com/trongnguyendz/tmdt-promax/blob/main/be/api-gateway/server.js) (API gateway)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_webapp["Role-based web app<br/>[App.vue]"]
  node_shopping["Shopping and checkout"]
  node_adminui["Admin workspace"]
  node_staffui["Staff workspace"]
end

subgraph group_edge["API edge"]
  node_gateway["API gateway<br/>[server.js]"]
  node_gatewayroutes["Gateway route handlers"]
end

subgraph group_commerce["Commerce services"]
  node_users["Accounts and identity<br/>[authController.js]"]
  node_catalog["Catalog and inventory"]
  node_reviews["Product reviews"]
  node_orders["Orders and wishlist<br/>[orderController.js]"]
  node_payments["Payment processing"]
  node_coupons["Coupons"]
  node_orderstore[("Order records<br/>[orderModel.js]")]
  node_paystore[("Payment records<br/>[paymentModel.js]")]
end

subgraph group_operations["Operations services"]
  node_notifications["Notifications and invoices"]
  node_shipping["GHN shipping<br/>[ghnController.js]"]
  node_banners["Banner management"]
  node_staffops["Staff and shifts<br/>[staffController.js]"]
  node_support["Support operations"]
  node_interactions["Category interactions"]
end

node_customer(("Customer"))

node_customer -->|"uses"| node_webapp
node_webapp -->|"renders"| node_shopping
node_webapp -->|"renders"| node_adminui
node_webapp -->|"renders"| node_staffui
node_shopping -.->|"calls APIs"| node_gateway
node_adminui -.->|"calls APIs"| node_gateway
node_staffui -.->|"calls APIs"| node_gateway
node_gateway -->|"mounts routes"| node_gatewayroutes
node_gatewayroutes -.->|"proxies requests"| node_users
node_gatewayroutes -.->|"proxies requests"| node_catalog
node_gatewayroutes -.->|"proxies requests"| node_orders
node_gatewayroutes -.->|"proxies requests"| node_payments
node_gatewayroutes -.->|"proxies requests"| node_notifications
node_orders -->|"reads and writes"| node_orderstore
node_payments -->|"reads and writes"| node_paystore
node_orders -->|"fetches and adjusts stock"| node_catalog
node_orders -->|"sends invoice request"| node_notifications
node_payments -->|"updates order status"| node_orders
node_staffops -->|"creates and updates accounts"| node_users
node_staffops -.->|"uses shipping"| node_shipping

click node_webapp "https://github.com/trongnguyendz/tmdt-promax/blob/main/fe/src/App.vue"
click node_shopping "https://github.com/trongnguyendz/tmdt-promax/tree/main/fe/src/pages/customer"
click node_adminui "https://github.com/trongnguyendz/tmdt-promax/tree/main/fe/src/pages/admin"
click node_staffui "https://github.com/trongnguyendz/tmdt-promax/tree/main/fe/src/pages/Staff"
click node_gateway "https://github.com/trongnguyendz/tmdt-promax/blob/main/be/api-gateway/server.js"
click node_gatewayroutes "https://github.com/trongnguyendz/tmdt-promax/tree/main/be/api-gateway/routes"
click node_users "https://github.com/trongnguyendz/tmdt-promax/blob/main/be/user-service/controllers/authController.js"
click node_catalog "https://github.com/trongnguyendz/tmdt-promax/blob/main/be/product-service/controllers/productController.js"
click node_reviews "https://github.com/trongnguyendz/tmdt-promax/blob/main/be/product-service/controllers/reviewController.js"
click node_orders "https://github.com/trongnguyendz/tmdt-promax/blob/main/be/order-service/controllers/orderController.js"
click node_payments "https://github.com/trongnguyendz/tmdt-promax/blob/main/be/payment-service/controllers/paymentController.js"
click node_coupons "https://github.com/trongnguyendz/tmdt-promax/blob/main/be/payment-service/controllers/couponController.js"
click node_orderstore "https://github.com/trongnguyendz/tmdt-promax/blob/main/be/order-service/models/orderModel.js"
click node_paystore "https://github.com/trongnguyendz/tmdt-promax/blob/main/be/payment-service/models/paymentModel.js"
click node_notifications "https://github.com/trongnguyendz/tmdt-promax/blob/main/be/notification-service/controllers/notificationController.js"
click node_shipping "https://github.com/trongnguyendz/tmdt-promax/blob/main/be-new/ghn-service/controllers/ghnController.js"
click node_banners "https://github.com/trongnguyendz/tmdt-promax/blob/main/be/admin-service/controllers/bannerController.js"
click node_staffops "https://github.com/trongnguyendz/tmdt-promax/blob/main/be-new/staff-service/controllers/staffController.js"
click node_support "https://github.com/trongnguyendz/tmdt-promax/blob/main/be-new/staff-service/controllers/supportController.js"
click node_interactions "https://github.com/trongnguyendz/tmdt-promax/blob/main/be-new/user-service/controllers/userCategoryInteractionController.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_webapp,node_shopping,node_adminui,node_staffui toneBlue
class node_gateway,node_gatewayroutes toneAmber
class node_users,node_catalog,node_reviews,node_orders,node_payments,node_coupons,node_orderstore,node_paystore toneMint
class node_notifications,node_shipping,node_banners,node_staffops,node_support,node_interactions toneRose
class node_customer toneIndigo
```

## Components

### Web experience

- [Role-based web app](https://github.com/trongnguyendz/tmdt-promax/blob/main/fe/src/App.vue): `fe/src/App.vue`
- [Shopping and checkout](https://github.com/trongnguyendz/tmdt-promax/tree/main/fe/src/pages/customer): `fe/src/pages/customer`
- [Admin workspace](https://github.com/trongnguyendz/tmdt-promax/tree/main/fe/src/pages/admin): `fe/src/pages/admin`
- [Staff workspace](https://github.com/trongnguyendz/tmdt-promax/tree/main/fe/src/pages/Staff): `fe/src/pages/Staff`

### API edge

- [API gateway](https://github.com/trongnguyendz/tmdt-promax/blob/main/be/api-gateway/server.js): `be/api-gateway/server.js`
- [Gateway route handlers](https://github.com/trongnguyendz/tmdt-promax/tree/main/be/api-gateway/routes): `be/api-gateway/routes`

### Commerce services

- [Accounts and identity](https://github.com/trongnguyendz/tmdt-promax/blob/main/be/user-service/controllers/authController.js): `be/user-service/controllers/authController.js`
- [Catalog and inventory](https://github.com/trongnguyendz/tmdt-promax/blob/main/be/product-service/controllers/productController.js): `be/product-service/controllers/productController.js`
- [Product reviews](https://github.com/trongnguyendz/tmdt-promax/blob/main/be/product-service/controllers/reviewController.js): `be/product-service/controllers/reviewController.js`
- [Orders and wishlist](https://github.com/trongnguyendz/tmdt-promax/blob/main/be/order-service/controllers/orderController.js): `be/order-service/controllers/orderController.js`
- [Payment processing](https://github.com/trongnguyendz/tmdt-promax/blob/main/be/payment-service/controllers/paymentController.js): `be/payment-service/controllers/paymentController.js`
- [Coupons](https://github.com/trongnguyendz/tmdt-promax/blob/main/be/payment-service/controllers/couponController.js): `be/payment-service/controllers/couponController.js`
- [Order records](https://github.com/trongnguyendz/tmdt-promax/blob/main/be/order-service/models/orderModel.js): `be/order-service/models/orderModel.js`
- [Payment records](https://github.com/trongnguyendz/tmdt-promax/blob/main/be/payment-service/models/paymentModel.js): `be/payment-service/models/paymentModel.js`

### Operations services

- [Notifications and invoices](https://github.com/trongnguyendz/tmdt-promax/blob/main/be/notification-service/controllers/notificationController.js): `be/notification-service/controllers/notificationController.js`
- [GHN shipping](https://github.com/trongnguyendz/tmdt-promax/blob/main/be-new/ghn-service/controllers/ghnController.js): `be-new/ghn-service/controllers/ghnController.js`
- [Banner management](https://github.com/trongnguyendz/tmdt-promax/blob/main/be/admin-service/controllers/bannerController.js): `be/admin-service/controllers/bannerController.js`
- [Staff and shifts](https://github.com/trongnguyendz/tmdt-promax/blob/main/be-new/staff-service/controllers/staffController.js): `be-new/staff-service/controllers/staffController.js`
- [Support operations](https://github.com/trongnguyendz/tmdt-promax/blob/main/be-new/staff-service/controllers/supportController.js): `be-new/staff-service/controllers/supportController.js`
- [Category interactions](https://github.com/trongnguyendz/tmdt-promax/blob/main/be-new/user-service/controllers/userCategoryInteractionController.js): `be-new/user-service/controllers/userCategoryInteractionController.js`

### Other components

- **Customer**

## Connections

- Customer → Role-based web app: uses
- Role-based web app → Shopping and checkout: renders (evidence: `fe/src/App.vue`)
- Role-based web app → Admin workspace: renders (evidence: `fe/src/App.vue`)
- Role-based web app → Staff workspace: renders (evidence: `fe/src/App.vue`)
- Shopping and checkout → API gateway: calls APIs
- Admin workspace → API gateway: calls APIs
- Staff workspace → API gateway: calls APIs
- API gateway → Gateway route handlers: mounts routes (evidence: `be/api-gateway/server.js`)
- Gateway route handlers → Accounts and identity: proxies requests
- Gateway route handlers → Catalog and inventory: proxies requests
- Gateway route handlers → Orders and wishlist: proxies requests
- Gateway route handlers → Payment processing: proxies requests
- Gateway route handlers → Notifications and invoices: proxies requests
- Orders and wishlist → Order records: reads and writes (evidence: `be/order-service/controllers/orderController.js`)
- Payment processing → Payment records: reads and writes (evidence: `be/payment-service/controllers/paymentController.js`)
- Orders and wishlist → Catalog and inventory: fetches and adjusts stock (evidence: `be/order-service/controllers/orderController.js`)
- Orders and wishlist → Notifications and invoices: sends invoice request (evidence: `be/order-service/controllers/orderController.js`)
- Payment processing → Orders and wishlist: updates order status (evidence: `be/payment-service/controllers/paymentController.js`)
- Staff and shifts → Accounts and identity: creates and updates accounts (evidence: `be-new/staff-service/controllers/staffController.js`)
- Staff and shifts → GHN shipping: uses shipping
