A modular, AI-native supply chain management platform built for SMEs.
cp .env.example .env # 可按需修改密码/端口
docker compose up -d --build # mysql + backend + frontend 三容器
# 首次启动后初始化种子数据(admin/admin123 与基础资料)
docker compose exec backend node dist/apps/scm/src/seed.js
# Open http://localhost首次启动默认 DB_SYNCHRONIZE=true 自动建表;生产环境建议改为 false
并在容器内执行迁移。日志与附件分别持久化在 backend-logs / backend-uploads 卷。
npm run install:all # 安装 kernel + apps/scm 依赖
npm run build # 编译后端
cd apps/scm && npm run migration:run && npm run seed
npm run start:prod # 或开发模式 npm run start:dev
# 前端:cd web && npm install && npm run dev # http://localhost:8081npm test # 单元测试
npm run test:e2e # 全链路冒烟(需后端运行中)kernel/ Shared core (9 modules: auth/user/role/dict/audit/AI/i18n/SRE/network)
apps/scm/ SCM app (9 modules: product/category/unit/warehouse/inventory/stock-record/purchase/supplier/stock-check)
web/ Frontend (desktop SCM + system admin + mobile PWA)
docs/ Product & architecture docs (6 documents)
| Module | Description |
|---|---|
| Auth | JWT login, token management |
| User/Role | User CRUD, RBAC permissions |
| Dict | Data dictionary |
| Audit | Full operation audit trail |
| AI | Demand prediction, replenish recommendation |
| i18n | zh-CN / en-US runtime swappable |
| Observability | Health check, metrics, structured logging |
| Network | Inter-org connection, viral invites |
| Product | Product CRUD, categories, units, barcodes |
| Inventory | Multi-warehouse, batch tracking, stock records |
| Purchase | PO lifecycle, supplier management |
| Stock Check | Inventory counting, discrepancy handling |
| Entry | URL |
|---|---|
| Web (Docker) | http://localhost |
| Web (dev) | http://localhost:8081 |
| API | http://localhost:3000/api/v1 |
| API Docs | http://localhost:3000/api/docs (Swagger) |
| Health | http://localhost:3000/api/v1/health |
| Category | Count |
|---|---|
| Backend TypeScript | 82 files |
| Business Modules | 18 (9 kernel + 9 SCM) |
| Frontend HTML Pages | 45 files |
| Mobile PWA Pages | 7 files + Service Worker |
| Unit/E2E Tests | 10 files |
| Product Documents | 6 documents |
| Docker Configs | 3 (Dockerfile + compose + nginx) |
| CI Config | 1 (GitHub Actions) |
| Total | ~160 files |
MIT