System architecture
Bot Ban Hang uses a multi-service monorepo architecture — services live in the same repo but are deployed and scaled independently.
Overview diagram
Services
api_oms — Order Management Service
Core sales business management:
- Order — Create, update, cancel orders
- Product & Variant — Product and variant management (size, color, ...)
- Inventory — Stock management, auditing
- Shipping — Integration with 8 shipping carriers
- Billing — Invoices, payments
- Loyalty — Points program, promotions
- Vendor — Supplier management
- Integration — Facebook sync, partner webhooks
api_payment — Payment Gateway
Centralized payment gateway with multi-platform integration:
| Platform | Type |
|---|---|
| MoMo | E-wallet |
| ZaloPay | E-wallet |
| VNPay | Payment gateway |
| Stripe | International payments |
| Square | POS |
| MPOS | Mobile POS |
| SePay | Automatic bank transfer |
| Bank transfer | Bank |
| Cash | COD |
web_payment — Payment UI
Next.js payment interface for customers — displays payment forms, QR codes, redirects to payment gateways.
Tech Stack
- Runtime: Node.js 20+
- Backend: NestJS
- Frontend: Next.js · React 18
- ORM: Prisma
- Database: PostgreSQL
- Package Manager: pnpm