How thanhdai2005/dac-san-ba-mien works
Dac San Ba Mien is a Vietnamese-food ordering platform with customer shopping and order management, a role-governed admin console, publishing, reviews, and real-time AI/human support. The principal customer flow is browsing products, managing a cart, checking out with a payment choice, and tracking an order; delivered orders can be reviewed. The graph combines README capabilities with sampled order, review, authentication, and chat code; unsampled subsystem links are limited to documented responsibilities and their existing directories.
Main entry points: order.controller.js Order processing · index.route.js Client API · chat.handler.js Realtime chat · controllers Catalog and order management
Components 34
Customer experience
- Client app
frontend/src/App.tsx - Product catalog
frontend/src/pages/client/ProductListPage.tsx - Shopping cart
frontend/src/pages/client/CartPage.tsx - Checkout
frontend/src/pages/client/CheckoutPage.tsx - Order tracking
frontend/src/pages/client/OrdersPage.tsx - Product reviews
frontend/src/pages/client/OrderReviewPage.tsx
Commerce services
- Client API
backend/api/v1/client/routes/index.route.js - Order processing
backend/api/v1/client/controllers/order.controller.js - Products
backend/models/product.model.js - Orders
backend/models/order.model.js - Cart
backend/models/cart.model.js - Payment gateways
backend/helpers/momo.js - VNPAY integration
backend/helpers/vnpay.js - Order email
backend/helpers/mailer.js - Review processing
backend/api/v1/client/controllers/review.controller.js - Reviews
backend/models/review.model.js
Administration
- Admin console
frontend/src/routes/adminRoute.tsx - Admin API
backend/api/v1/admin/routes/index.route.js - Catalog and order management
backend/api/v1/admin/controllers - Roles and permissions
backend/models/role.model.js
Customer support
- Chat interfaces
frontend/src/components/client/ChatWidget.tsx - Realtime chat
backend/socket/chat.handler.js - Conversations
backend/models/conversation.model.js - Messages
backend/models/message.model.js - Gemini AI
backend/helpers/gemini.helper.js
Identity and content
- Customer identity
frontend/src/stores/useAuthStore.ts - Authentication API
backend/api/v1/client/controllers/auth.controller.js - User accounts
backend/models/user.model.js - Blogs and categories
backend/api/v1/client/controllers/blog.controller.js
Other components
- Shopper
- Admin staff
- Cloudinary
- MoMo
- VNPAY
Connections 38
- Shopper → Client app: uses
- Client app → Product catalog: navigates
- Product catalog → Client API: requests catalog
- Shopping cart → Client API: manages cart
- Checkout → Client API: places order
- Order tracking → Client API: tracks orders
- Product reviews → Client API: submits review
- Client API → Order processing: dispatches
- Order processing → Products: checks stock
- Order processing → Cart: reads cart
- Order processing → Orders: creates and updates
- Order processing → Payment gateways: creates payment
- Order processing → VNPAY integration: creates and verifies
- Order processing → Order email: sends confirmation
- Client API → Review processing: dispatches
- Review processing → Products: validates and updates rating
- Review processing → Orders: validates delivery
- Review processing → Reviews: creates and queries
- Admin staff → Admin console: manages
- Admin console → Admin API: calls
- Admin API → Catalog and order management: dispatches
- Catalog and order management → Products: manages products
- Catalog and order management → Orders: manages orders
- Catalog and order management → Roles and permissions: checks roles
- Customer identity → Authentication API: authenticates
- Authentication API → User accounts: reads and writes
- Customer identity → Client API: loads user detail
- Client API → Blogs and categories: serves articles
- Shopper → Chat interfaces: requests support
- Chat interfaces → Realtime chat: exchanges messages
- Realtime chat → Conversations: loads and saves
- Realtime chat → Messages: stores messages
- Realtime chat → Gemini AI: requests bot reply
- Realtime chat → Chat interfaces: emits updates
- Admin staff → Realtime chat: handles live chats
- Catalog and order management → Cloudinary: uploads media
- Order processing → MoMo: requests payment
- Order processing → VNPAY: requests payment