{"id":25841245,"url":"https://github.com/poboll/echo-room","last_synced_at":"2026-04-30T19:32:19.895Z","repository":{"id":279755140,"uuid":"939790401","full_name":"poboll/echo-room","owner":"poboll","description":"回声谷即时通讯系统-后端","archived":false,"fork":false,"pushed_at":"2025-03-02T13:29:41.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-05T06:52:16.779Z","etag":null,"topics":["ffmpeg","jwt","mysql-redis","rabbitmq","spring-boot","websocket"],"latest_commit_sha":null,"homepage":"https://echo.caiths.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/poboll.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-27T05:37:34.000Z","updated_at":"2025-03-02T13:29:44.000Z","dependencies_parsed_at":"2025-02-27T10:51:20.126Z","dependency_job_id":"a95de7c4-83d0-437a-b476-7412d049ed88","html_url":"https://github.com/poboll/echo-room","commit_stats":null,"previous_names":["poboll/echo-room"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/poboll/echo-room","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poboll%2Fecho-room","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poboll%2Fecho-room/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poboll%2Fecho-room/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poboll%2Fecho-room/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/poboll","download_url":"https://codeload.github.com/poboll/echo-room/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poboll%2Fecho-room/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32475192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ffmpeg","jwt","mysql-redis","rabbitmq","spring-boot","websocket"],"created_at":"2025-03-01T05:21:27.897Z","updated_at":"2026-04-30T19:32:19.881Z","avatar_url":"https://github.com/poboll.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚡ 回声谷即时通讯系统\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://c-ssl.duitang.com/uploads/blog/202402/17/N5SG04P6iPy7qXw.jpg\" width=\"200\"\u003e\n  \u003ch3 align=\"center\"\u003e基于SpringBoot+Vue3的实时通信解决方案\u003c/h3\u003e\n\u003c/p\u003e\n\n## 🌟 核心特性\n\n```mermaid\ngraph TD\n    A[消息必达] --\u003e B(WebSocket+ACK确认)\n    A --\u003e C(离线消息队列)\n    D[语音消息] --\u003e E(Web Audio API)\n    D --\u003e F(Opus编码压缩)\n    G[消息撤回] --\u003e H(Redis过期控制)\n    G --\u003e I(双端状态同步)\n```\n\n## 🛠 技术栈\n\n### 后端架构\n| 组件                | 选型               | 作用                      |\n|---------------------|-------------------|--------------------------|\n| 核心框架            | Spring Boot 3.1   | 服务端基础架构             |\n| 通信协议            | WebSocket         | 实时双向通信               |\n| 消息队列            | RabbitMQ          | 削峰填谷/离线消息           |\n| 数据存储            | MySQL+Redis       | 结构化存储/实时状态         |\n| 语音处理            | FFmpeg            | 音频转码处理               |\n| 安全认证            | JWT               | 用户身份验证               |\n\n### 前端架构\n| 模块                | 技术方案           | 亮点                      |\n|---------------------|-------------------|--------------------------|\n| 核心框架            | Vue3+TypeScript   | 响应式开发                |\n| 状态管理            | Pinia             | 跨组件状态共享            |\n| UI框架              | Element Plus      | 现代化交互组件            |\n| 语音录制            | Recorder.js       | 浏览器音频采集            |\n| 实时通信            | Socket.IO         | 事件驱动消息传递          |\n| 数据持久化          | IndexedDB         | 本地聊天记录缓存          |\n\n## 🧩 系统设计\n\n### 消息可靠性保障\n```mermaid\nsequenceDiagram\n    participant ClientA\n    participant Server\n    participant ClientB\n    \n    ClientA-\u003e\u003eServer: 发送消息(带唯一ID)\n    Server--\u003e\u003eClientA: 返回ACK确认\n    Server-\u003e\u003eClientB: 推送消息\n    ClientB--\u003e\u003eServer: 返回接收ACK\n    Server-\u003e\u003eClientA: 送达状态更新\n    alt 消息未确认\n        Server-\u003e\u003eServer: 进入重试队列(3次)\n    end\n```\n\n### 语音消息处理流程\n1. 前端采集音频（WebRTC API）\n2. Opus编码压缩（50%体积优化）\n3. 分块上传（断点续传支持）\n4. 服务端转码存储（HLS格式）\n5. CDN加速分发\n\n### 撤回功能实现\n```java\n// 消息撤回逻辑示例\npublic Message recallMessage(String messageId, User operator) {\n    Message msg = messageRepo.findById(messageId);\n    if (msg.getSender().equals(operator) \u0026\u0026 \n        Duration.between(msg.getSendTime(), Instant.now()).toMinutes() \u003c= 2) {\n        msg.setStatus(MessageStatus.RECALLED);\n        // 发布撤回事件\n        eventPublisher.publishRecallEvent(msg);\n        return messageRepo.save(msg);\n    }\n    throw new BusinessException(\"撤回条件不满足\");\n}\n```\n\n## 📦 部署方案\n\n### 基础设施\n```bash\n# 使用Docker Compose部署\nversion: '3'\nservices:\n  redis:\n    image: redis:alpine\n    ports:\n      - \"6379:6379\"\n  \n  mysql:\n    image: mysql:8.0\n    environment:\n      MYSQL_ROOT_PASSWORD: securepass\n  \n  app:\n    build: .\n    ports:\n      - \"8080:8080\"\n    depends_on:\n      - redis\n      - mysql\n\n---\n\n\u003e 📌 项目地址：https://github.com/poboll/echo-room-backend  \n\u003e 📧 联系作者：caiths@icloud.com  \n\u003e 📄 详细文档：[架构设计文档](./docs/ARCHITECTURE.md)\n```\n\n### 设计亮点说明：\n1. **双ACK确认机制** - 发送端与服务端、服务端与接收端双重确认\n2. **音频优化处理** - Opus编码+分片上传节省60%带宽消耗\n3. **撤回事件驱动** - 通过消息队列广播撤回指令\n4. **混合存储策略** - Redis处理在线状态，MySQL持久化消息\n5. **本地缓存兜底** - IndexedDB保障弱网环境下基础体验\n\n### 扩展建议：\n1. 增加消息加密通道（TLS1.3+自定义加密）\n2. 实现分布式会话管理（Consul服务发现）\n3. 引入Sentinel进行流量控制\n4. 添加消息已读状态跟踪\n5. 开发移动端适配PWA版本","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoboll%2Fecho-room","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoboll%2Fecho-room","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoboll%2Fecho-room/lists"}