在线多人同步听歌平台 — 创建房间,邀请朋友,一起实时听同一首歌
178
stars
132
commits
TypeScript
primary language
Sep 8, 2026
updated
在线多人同步听歌平台 -- 创建房间,邀请朋友,一起实时听同一首歌。
| 首页 | 搜索 | 播放 | 聊天 |
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |
| 首页 | 搜索 | 播放 | 聊天 |
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |
| 桌面端歌词 | 竖屏默认(封面) | 竖屏歌词模式 |
|---|---|---|
![]() | ![]() | ![]() |
生产部署必须设置至少 32 字符的随机 IDENTITY_SECRET;本地开发可使用默认开发配置。
git clone https://github.com/Yueby/music-together.git
cd music-together
pnpm install
pnpm dev
提交代码前可运行:
pnpm test
pnpm --filter @music-together/client typecheck
pnpm --filter @music-together/client lint
pnpm build
前端: http://localhost:5173 | 后端: http://localhost:3001
Docker 单镜像部署:
docker run -d --name music-together --restart unless-stopped \
-p 3001:3001 \
-e IDENTITY_SECRET='<至少32字符的随机密钥>' \
ghcr.io/yueby/music-together:latest
如果宿主机
3001端口已被占用,修改-p 宿主机端口:容器端口左侧端口即可,例如-p 8080:3001。
默认自动模式下,前端会按当前访问地址自动连接后端;服务端默认开放所有来源访问,并根据当前请求协议自动决定 cookie 是否带 Secure。
需要显式限制来源时,再配置 CLIENT_URL:
docker run -d --name music-together --restart unless-stopped \
-p 3001:3001 \
-e IDENTITY_SECRET='<至少32字符的随机密钥>' \
-e CLIENT_URL=https://music.example.com \
ghcr.io/yueby/music-together:latest
CLIENT_URL现在主要用于显式白名单模式或前后端分离部署;默认自动模式下通常不再需要手动设置。如果你通过 Nginx / Caddy / 1Panel / Lucky 等反向代理暴露 HTTPS,请确保代理正确透传
X-Forwarded-Proto,否则服务端无法自动判断应该下发 Secure cookie。
push 到 main 后 GitHub Actions 自动构建镜像。详见 架构文档。
packages/
client/ -- 前端 React 应用
server/ -- 后端 Node.js 服务
shared/ -- 共享类型、常量与权限定义
| 库 | 说明 |
|---|---|
| Howler.js | Web 音频播放 |
| Apple Music-like Lyrics | 歌词组件 (GPL-3.0) |
| Meting | 多平台音乐 API |
| NeteaseCloudMusicApi Enhanced | 网易云音乐 API |
| CASL | 权限管理 |
| Zustand | 状态管理 |
| shadcn/ui | UI 组件库 |
| Motion | 动画库 |
| qq-music-download | QQ 音乐登录参考 |
TypeScript
97.5%
Shell
1.4%
在线多人同步听歌平台 — 创建房间,邀请朋友,一起实时听同一首歌
178
stars
132
commits
TypeScript
primary language
Sep 8, 2026
updated
在线多人同步听歌平台 -- 创建房间,邀请朋友,一起实时听同一首歌。
| 首页 | 搜索 | 播放 | 聊天 |
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |
| 首页 | 搜索 | 播放 | 聊天 |
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |
| 桌面端歌词 | 竖屏默认(封面) | 竖屏歌词模式 |
|---|---|---|
![]() | ![]() | ![]() |
生产部署必须设置至少 32 字符的随机 IDENTITY_SECRET;本地开发可使用默认开发配置。
git clone https://github.com/Yueby/music-together.git
cd music-together
pnpm install
pnpm dev
提交代码前可运行:
pnpm test
pnpm --filter @music-together/client typecheck
pnpm --filter @music-together/client lint
pnpm build
前端: http://localhost:5173 | 后端: http://localhost:3001
Docker 单镜像部署:
docker run -d --name music-together --restart unless-stopped \
-p 3001:3001 \
-e IDENTITY_SECRET='<至少32字符的随机密钥>' \
ghcr.io/yueby/music-together:latest
如果宿主机
3001端口已被占用,修改-p 宿主机端口:容器端口左侧端口即可,例如-p 8080:3001。
默认自动模式下,前端会按当前访问地址自动连接后端;服务端默认开放所有来源访问,并根据当前请求协议自动决定 cookie 是否带 Secure。
需要显式限制来源时,再配置 CLIENT_URL:
docker run -d --name music-together --restart unless-stopped \
-p 3001:3001 \
-e IDENTITY_SECRET='<至少32字符的随机密钥>' \
-e CLIENT_URL=https://music.example.com \
ghcr.io/yueby/music-together:latest
CLIENT_URL现在主要用于显式白名单模式或前后端分离部署;默认自动模式下通常不再需要手动设置。如果你通过 Nginx / Caddy / 1Panel / Lucky 等反向代理暴露 HTTPS,请确保代理正确透传
X-Forwarded-Proto,否则服务端无法自动判断应该下发 Secure cookie。
push 到 main 后 GitHub Actions 自动构建镜像。详见 架构文档。
packages/
client/ -- 前端 React 应用
server/ -- 后端 Node.js 服务
shared/ -- 共享类型、常量与权限定义
| 库 | 说明 |
|---|---|
| Howler.js | Web 音频播放 |
| Apple Music-like Lyrics | 歌词组件 (GPL-3.0) |
| Meting | 多平台音乐 API |
| NeteaseCloudMusicApi Enhanced | 网易云音乐 API |
| CASL | 权限管理 |
| Zustand | 状态管理 |
| shadcn/ui | UI 组件库 |
| Motion | 动画库 |
| qq-music-download | QQ 音乐登录参考 |
TypeScript
97.5%
Shell
1.4%