oms/README.md
liufumingren a9485eecc0 新增项目 README 文档
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-18 16:14:37 +08:00

82 lines
2.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# OMS
OMS 项目由 Egg.js 后端、Vue 3 前端和发布工具组成。
## 项目结构
| 目录 | 说明 |
| --- | --- |
| `backend/` | Egg.js + Sequelize 后端服务、数据库迁移和测试 |
| `frontend/` | Vue 3 + Element Plus 前端应用 |
| `tools/` | 前后端开发、部署和回滚工具 |
项目使用 MySQL 存储业务数据,并使用 Redis 提供缓存等服务。建议使用 Node.js 18 或更高版本。
## 本地开发
首次使用时分别安装各目录依赖。
### 后端
```powershell
cd backend
npm install
Copy-Item env.development.example .env
```
根据本机环境编辑 `backend/.env`,配置 MySQL、Redis 等连接信息。`backend/.env` 是本地配置,不应提交到 Git。
启动后端开发服务(默认监听 `6090`):
```powershell
npm run dev
```
### 前端
另开一个终端:
```powershell
cd frontend
npm install
npm run dev
```
前端开发服务器默认运行在 `http://localhost:5173`,并将 `/api` 请求代理到 `http://localhost:6090`。
也可以使用发布工具同时启动前后端开发服务。先按上文准备后端环境,再执行:
```powershell
cd tools
npm install
npm run dev
```
## 常用命令
在 `backend/` 目录运行:
```powershell
npx egg-bin test # 后端测试
npx eslint app # 后端代码检查
npx sequelize-cli db:migrate # 应用数据库迁移
```
数据库迁移会修改数据库,请确认连接配置正确后再运行。
在 `frontend/` 目录运行:
```powershell
npm run build # 类型检查并构建前端
```
## 部署
部署工具的初始化、配置、发布和回滚说明见 [`tools/DEPLOY.md`](tools/DEPLOY.md)。部署前需要按文档准备本地发布配置和服务器环境;真实凭据及环境变量不得提交到仓库。
## 相关文档
- [WMS-OMS 取号对接](WMS-OMS-取号对接.md)
- [店管家取号旧系统提取说明](店管家取号-旧系统提取.md)
- [订单拆分需求文档](订单拆分需求文档.md)