Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XiaoHe SCM — Open Source Smart Supply Chain Platform

A modular, AI-native supply chain management platform built for SMEs.

Quick Start

Docker (Recommended)

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 卷。

Manual (Node 18+ / MySQL 8)

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:8081

Verify

npm test                      # 单元测试
npm run test:e2e              # 全链路冒烟(需后端运行中)

Architecture

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)

Features (18 business modules)

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

Access Points

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

Total Project Size

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

License

MIT

About

面向中小企业的模块化智慧供应链平台,AI 原生架构。基于 NestJS + Vue 3 + MySQL,涵盖库存、采购、销售、盘点、需求预测等核心功能。MIT 开源协议。A modular, AI-native supply chain management platform for SMEs. Built with NestJS + Vue 3 + MySQL. Features inventory, purchasing, sales, stock checking, demand prediction and more. MIT License.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages