Files
dev-screen-starter/doc/deployment-and-checklist.md
T

105 lines
2.2 KiB
Markdown
Raw 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.
# 部署与上线检查清单
本文档用于客户大屏项目交付前的最后检查。
## 1. 本地构建
```bash
pnpm install
pnpm typecheck
pnpm build
```
单个客户项目构建:
```bash
pnpm --filter @dev-screen-starter/customer-a build
```
## 2. 环境变量
新项目会带 `.env.example`:
```txt
VITE_API_BASE_URL=http://localhost:3000
VITE_WS_URL=ws://localhost:3000/ws/screen
VITE_ENABLE_STAGE_DEBUG=true
```
交付环境建议:
- 开发环境可以打开 `VITE_ENABLE_STAGE_DEBUG=true`。
- 生产环境建议关闭调试浮层。
- API 和 WebSocket 地址不要写死在组件里,统一放到 `dataSources.ts` 或 `.env`。
## 3. Nginx 静态部署
构建完成后,把对应项目的 `dist` 发布到静态服务器。
示例 Nginx 配置在:
```txt
deploy/nginx.conf
```
## 4. Docker 部署
默认构建 demo:
```bash
docker build -t dev-screen-demo .
docker run --rm -p 8080:80 dev-screen-demo
```
构建指定客户项目:
```bash
docker build \
--build-arg APP_FILTER=@dev-screen-starter/customer-a \
--build-arg APP_PATH=apps/customer-a \
-t customer-a-screen .
```
## 5. 屏幕适配验收
至少检查这些尺寸:
- `1366x768`
- `1920x1080`
- `2560x1440`
- `3840x2160`
至少检查这些模式:
- `?scaleMode=fit`
- `?scaleMode=fill`
- `?scaleMode=stretch`
默认建议生产使用 `fit`。
## 6. 数据接入检查
- HTTP 数据源是否配置 `baseUrl`、`timeoutMs`、错误兜底。
- WebSocket 是否配置 `reconnect` 和 `heartbeat`。
- 实时列表是否设置 `maxItems`。
- 图表数据是否在 `transform` 中清洗成组件需要的结构。
- 断网、接口 500、空数据时页面是否仍可读。
## 7. 视觉检查
- 标题、指标、图例、坐标轴在 1080p 和 4K 下都清晰。
- 自动滚动列表没有超出父容器。
- 图表容器没有空白 canvas。
- 关键数字没有挤压、换行或遮挡。
- 客户看屏页面不出现开发调试信息。
## 8. 上线前清单
- `pnpm typecheck` 通过。
- `pnpm build` 通过。
- 客户接口地址已切换为正式地址。
- `.env` 未提交到 git。
- 生产关闭 `VITE_ENABLE_STAGE_DEBUG`。
- 浏览器全屏查看无滚动条、无遮挡。
- 大屏实际设备上验收一次。