基于 Web 技术栈的多人在线 UNO,对局实时同步,支持语音、观战、可配置村规,以及让 AI 客户端参与游戏的 MCP 服务端。
- 2-10 人房间,通过 6 位房间码邀请加入
- 完整 UNO 规则:功能牌、+4 质疑、计分、多轮对局
- 34 条可配置村规,内置经典、派对、疯狂三套预设
- Socket.IO 权威服务端,客户端提供即时反馈
- Mumble 语音通话,支持逐人静音和说话状态
- Passkey (WebAuthn) 免密码登录,支持指纹、面容和安全密钥
- 服务器选择、管理后台、观战、色盲模式、音效和动画
- MCP 服务端,AI 客户端可通过工具加入并操作游戏
- 前端:React 19、TypeScript、Vite 8、Tailwind CSS v4、Zustand
- 后端:Fastify、Socket.IO、TypeScript
- 共享逻辑:
packages/shared内的纯 TypeScript 规则引擎 - 存储:SQLite + Kysely;Redis 可选,未配置时使用内存回退
- 语音:Mumble + mumble-web-gateway
- 部署:Docker + Caddy
- 仓库结构:pnpm workspaces
packages/
shared/ # 规则引擎、类型、常量
server/ # Fastify + Socket.IO + SQLite
client/ # 玩家 Web 应用
admin/ # 管理后台
mcp/ # AI 客户端使用的 MCP 服务端
要求:
- Node.js 22+
- pnpm 10+
git clone https://github.com/letsuno/uno-online.git
cd uno-online
corepack enable && corepack prepare pnpm@10.11.0 --activate
pnpm install
cp .env.example .env分别在不同终端启动:
DEV_MODE=true JWT_SECRET=dev-secret pnpm --filter server dev
pnpm --filter client dev
pnpm --filter admin dev- 客户端:
http://localhost:5173 - 管理后台:
http://localhost:5174 - 服务端:
http://localhost:3001
DEV_MODE=true 时会跳过 GitHub OAuth,输入任意用户名即可登录。
pnpm test
pnpm --filter shared test
pnpm --filter shared build
pnpm --filter server exec tsc --noEmit
pnpm --filter client exec tsc --noEmit环境变量以 .env.example 为准。HTTP API 统一挂载在 /api 下;路由和 Socket.IO 事件见通信协议文档。