Skip to content

Bắt đầu nhanh

TÓM TẮT

Clone → Install → Cấu hình env → npm run dev. Frontend chạy tại http://localhost:3000.

Yêu cầu hệ thống

Phần mềmPhiên bảnMục đích
Node.js≥ 18.0Frontend React app
Python3.11+Backend ML engine
GitLatestSource control

1. Clone & Install

bash
git clone <repo-url>
cd workforce_planner

# Frontend dependencies
npm install

# Backend dependencies (optional - chỉ cần khi chạy ML engine)
cd forecast_engine
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cd ..

2. Cấu hình Environment

bash
# Copy file env mẫu
cp .env.example .env

# Chỉnh sửa với keys thật
# VITE_SUPABASE_URL=https://your-project.supabase.co
# VITE_SUPABASE_ANON_KEY=your-anon-key

QUAN TRỌNG

KHÔNG commit file .env chứa keys vào git! File .gitignore đã được cấu hình sẵn.

3. Chạy Frontend

bash
npm run dev
# → http://localhost:3000

4. Chạy Backend ML Engine (tùy chọn)

bash
cd forecast_engine
source .venv/bin/activate
python main.py
# → http://localhost:8000/docs (Swagger UI)

5. Chạy Tests

bash
# Frontend tests
npm test                # Chạy một lần
npm run test:watch      # Watch mode
npm run test:coverage   # Coverage report

# Type check
npx tsc --noEmit

# Full gate check
npm run test:gate       # vitest + tsc

Cấu trúc routes frontend

PathTrangMô tả
/DashboardTổng quan metrics
/forecastForecastDự báo nhu cầu theo ngày/tuần
/forecast/ordersOrder ForecastDự báo theo đơn hàng
/forecast/bsinBSIN ForecastDự báo theo mã sản phẩm
/forecast/customersCustomer ForecastDự báo theo khách hàng
/workforceWorkforceKế hoạch nhân sự
/workforce/plan-v2Workforce Plan V2Kế hoạch nhân sự nâng cao
/analyticsAnalyticsPhân tích báo cáo
/analytics/costCost AnalysisPhân tích chi phí
/settingsSettingsCấu hình hệ thống
/eventsSale EventsQuản lý sự kiện sale

Tài liệu liên quan

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