Skip to content

Tổng quan dự án

TÓM TẮT NHANH

BoxMe Forecast v10 là hệ thống dự báo nhu cầu đơn hàng + lập kế hoạch nhân sự cho các kho fulfillment thương mại điện tử tại Việt Nam. Hệ thống dự đoán volume đơn hàng hàng ngày ở cả cấp order-level lẫn SKU-level, sau đó chuyển đổi thành kế hoạch staffing tuân thủ Bộ luật Lao động 2019.

Vấn đề cần giải quyết

Các kho fulfillment e-commerce tại Việt Nam đối diện với:

  1. Biến động nhu cầu cao — Double-day sales (2.2, 3.3, ..., 12.12) có thể tăng volume 5-10x
  2. Quản lý ca làm phức tạp — 2-4 ca/ngày tùy loại ngày, tuân thủ luật lao động
  3. SKU đa dạng — 13,000+ mã sản phẩm với complexity levels khác nhau
  4. Nhiều kênh bán — Shopee, TikTokShop, Lazada, và các kênh khác co các calendar event riêng

Năng lực chính

Năng lựcMô tả
Two-Level ForecastingOrder-level (per user/warehouse/product) + SKU-level (aggregated across channels)
Segmented ML ModelLightGBM classifier + segment-specific regressors với quantile predictions
E-commerce CalendarLịch nghỉ lễ VN, ngày lương (15/25), double-day (2.2–12.12), mega sales
5-Layer Workforce PlannerForecast → Work Hours → Shifts → Staff Allocation → Capacity/Backlog/Cost
AutoML Self-ImprovementLLM-driven hyperparameter tuning với auto-backtest + rollback tự động
Walk-Forward BacktestingConfigurable train/test windows, breakdown theo SKU type, event tier, DOW
Multi-languageTiếng Việt, Tiếng Anh, Tiếng Thái

Technology Stack

Frontend:  React 19 + TypeScript + Vite 6 + Recharts + TanStack Query
           Deploy: Cloudflare Pages

Backend:   Python 3.11 + FastAPI + LightGBM + scikit-learn + pandas + NumPy
           Deploy: Railway (FastAPI) + GitHub Actions (cron)

Database:  Supabase PostgreSQL (hosted)
           12+ ML-specific tables + RLS security

CI/CD:     GitHub Actions → Cloudflare Pages (frontend)
           GitHub Actions → Railway (backend)

Cấu trúc dự án (Top-Level)

workforce_planner/
├── src/                        # Frontend React (TypeScript)
│   ├── pages/                  # 33 trang UI
│   ├── components/             # UI Components + ShiftPlan
│   ├── services/modules/       # 5 module nhóm: forecast, workforce, data, config, analytics
│   ├── contexts/               # AuthContext + WarehouseContext
│   ├── hooks/                  # useQueries, useFormAutoSave, useNavigationGuard
│   ├── lib/                    # supabase client + queryClient
│   ├── locales/                # en.ts, vi.ts, th.ts
│   └── types.ts                # 300 dòng type definitions

├── forecast_engine/            # Backend Python ML
│   ├── main.py                 # FastAPI entry point (13 routers)
│   └── src/
│       ├── api/                # 15 route files RESTful
│       ├── core/               # 29 module core (model, features, pipeline, backtester...)
│       ├── automl/             # AutoML: orchestrator, self_improver, llm_provider, tuner
│       ├── data/               # repository, schemas, supabase_client
│       └── utils/              # Utilities

├── scripts/                    # Data import, seed, evaluate, verify
├── __tests__/                  # Frontend tests (14 categories, 509+ tests)
├── tests/                      # Python backend tests
├── docs/                       # Technical docs (9 chapters)
├── .github/workflows/          # CI/CD workflows
└── docs-site/                  # VitePress documentation (BẠN ĐANG ĐỌC)

Thống kê codebase

MetricGiá trị
Frontend (TS/TSX)~249 files
Backend (Python)~258 files
Tổng source files~507+ files
33 trang UIDashboard, Forecast, Workforce, Analytics, BSIN, Customer...
Frontend tests509+ tests, 14 categories
i18n locales3 ngôn ngữ (EN, VI, TH)
Database tables12+ bảng ML pipeline
API routes13 routers, 50+ endpoints

Tài liệu liên quan

BoxMe Forecast — Tài liệu kỹ thuật nội bộ