Files
opendance-web/project.yaml
T
zijunchiang bba5bcf59e feat(web): 端口分离 + VMD 动作支持;契约升至 0.2.0
需求 1:管理端端口与软件 API 端口分离
- 软件 API 端口 PORT(默认 3000)只提供 /api、/health、/static、/contracts,
  不提供管理页面(未命中路径 404);管理端端口 ADMIN_PORT(默认 3001)
  提供管理页面与全部接口;ADMIN_HOST 可单独限制管理端来源
- main.ts 同进程监听两个端口,用 req.socket.localPort 区分端口行为;
  ADMIN_PORT=PORT 为单端口兼容模式(只创建一个 server,无 EADDRINUSE)
- 端口非法在生产环境中止启动;ADMIN_PORT=PORT 只 warn
- 启动日志分别打印两个端口的访问地址

需求 2:动作数据支持 VMD(MikuMikuDance)
- vmd-parser.ts:二进制解析(30 字节头 + Shift-JIS 模型名 + 111 字节/条骨骼
  关键帧 + morph 段)、MMD 贝塞尔插值、GBK 模型名回退、固定 30fps
- mmd-skeleton.ts:标准 MMD 骨架;静止比例从参考 PMX 骨骼段实测得到
  (足首 1.43 / 膝 6.57 / 髋 11.50 / 首 16.21 / 頭 17.16,腿长 10.09)
- mmd-pose.ts:FK + 两骨骼解析腿部 IK(膝盖朝正面,不可达收敛为伸直)
  + 左手系→右手系 Z 镜像(由真实数据对照实验确定:94.1% vs 5.9%)
- retarget.ts:抽出 worldFramesToKeypointFrames(),BVH 与 VMD 共用重定向
- MotionFormat 增 vmd、扩展名映射增 .vmd;管理端上传支持 .vmd
- scripts/inspect-vmd.mjs:上传前自查工具

契约:rest-api / data-models / model-formats → 0.2.0(另两库已同步逐字节一致)

验证:85 项单测通过(VMD 31 项);契约与 29 条路由一致;typecheck/build 通过;
真实样本经 HTTP 端到端:霜雪千年 2901 帧(IK 腿)、恋爱循环 4604 帧(FK 腿)
均 preprocessState=done、0 NaN、0 越界(测试数据已从数据库清理)。
2026-09-15 08:47:37 +08:00

73 lines
2.4 KiB
YAML
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.
project: opendance-web-server
version: 0.1.0
repository: opendance-web
default_branch: main
contracts_version: 0.1.0
# 契约变更流程(文档 §7.2):
# 任何跨端契约变更必须先在本项目修改 contracts/ 并提升版本,
# 再在 opendance-windows / opendance-android 创建适配任务。
database:
# 使用现有实例,本项目不部署、不管理 MySQL
managed_by: external
engine: MySQL 兼容(当前部署为 MariaDB 10.11.19)
name: dpendance
charset: utf8mb4
migrations: TypeORM migration
synchronize: forbidden
tasks:
- id: T-WEB-001
file: tasks/001-scaffold.md
scope: NestJS 骨架 + 连接现有 MySQL
status: done
- id: T-WEB-002
file: tasks/002-db-migration.md
scope: TypeORM 迁移生成 opendance 表结构
status: done
- id: T-WEB-003
file: tasks/003-song-crud.md
scope: /api/songs CRUD
status: done
- id: T-WEB-004
file: tasks/004-motion-upload.md
scope: 动作数据上传(BVH / VMD / FBX / glTF / keypoints)+ 来源字段
status: done
- id: T-WEB-005
file: tasks/005-model-upload.md
scope: 模型上传 + VRM 优先 + 来源字段
status: done
- id: T-WEB-006
file: tasks/006-keypoint-preprocess.md
scope: BVH / VMD / FBX → 关键点序列预处理
status: done
- id: T-WEB-007
file: tasks/007-upload-review.md
scope: 上传审核流程
status: done
- id: T-WEB-008
file: tasks/008-admin-ui-songs.md
scope: 歌曲管理界面
status: done
- id: T-WEB-009
file: tasks/009-admin-ui-models.md
scope: 模型管理界面 + 来源展示
status: done
- id: T-WEB-010
file: tasks/010-deploy.md
scope: 部署脚本(双端口:软件 API 3000 + 管理端 3001,不部署 MySQL)
status: done
deliverable:
artifact: opendance-web-v0.1.0.tar.gz
packaging: Linux 业务服务(系统服务托管,双端口:软件 API + 管理端,不含 MySQL、不含反向代理、不使用 Docker)
includes:
- web-server/ # NestJS 源码 + 构建产物(含 BVH / VMD 内置解析)
- admin/ # React 管理端构建产物
- deploy/ # install.sh / systemd / openrc / initd / ctl.sh / .env.example(PORT、ADMIN_PORT)
- deploy/proxy/ # 反向代理说明(nginx / IIS,仅供参考不部署)
- contracts/ # 当前版本契约快照
- THIRD_PARTY.md # 开源声明
- README.txt # 使用说明