B2B Auto-Parts Portal
Cổng B2B Phụ tùng Ô tô
Order portal for 320 garages — OEM lookup, real-time stock, e-invoice export.
Problem
The legacy distributor ran on Excel + Zalo + phone calls: garages call → staff checks Excel → quotes → handwrites the order. Wrong codes, sudden stockouts, no purchase history. B2B revenue plateaued.
Architecture
Next.js 15 App Router + RSC → tRPC + Postgres (38k-SKU catalog) → OEM full-text + similarity search (pg_trgm) → VNPT e-invoice + VietQR payment integration → MISA accounting webhook. Real-time stock via SSE from ERP.
Stack & rationale
- Next.js 15 App Router: server components cut bundle ~40%, SSR catalog for SEO.
- pg_trgm over Algolia: catalog isn't huge, local search is good enough and cheaper.
- VietQR: instant B2B payments, T+1 reconciliation.
Results (first 4 months)
| Metric | Before | After |
|---|---|---|
| Active garages | — | 320 |
| B2B online revenue | 1× | 3.4× |
| Avg order time | 18 min | 4 min |
| Wrong-code orders | 6.8% | 0.9% |
Lessons
OEM search must support fuzzy + alias (different makers call the same part by different codes). Cache invalidation for real-time stock via SSE is simpler than WebSocket for one-way data.