11
22
3- <div align =" center " >
43
5- <img src =" https://i.loli.net/2020/02/21/rfOGvKlTcHCmM92.png " />
4+ <div align =" center " >
5+
6+ <img src =" https://i.loli.net/2020/02/21/rfOGvKlTcHCmM92.png " />
67<br />
78
89[ ![ codecov] ( https://codecov.io/gh/crossoverJie/cim/graph/badge.svg?token=oW5Gd1oKmf )] ( https://codecov.io/gh/crossoverJie/cim )
910[ ![ Build Status] ( https://img.shields.io/badge/cim-cross--im-brightgreen.svg )] ( https://github.com/crossoverJie/cim )
1011[ ![ ] ( https://badge.juejin.im/entry/5c2c000e6fb9a049f5713e26/likes.svg?style=flat-square )] ( https://juejin.im/post/5c2bffdc51882509181395d7 )
1112
12- 📘[ 介绍 ] ( #介绍 ) |📽[ 视频演示 ] ( #视频演示 ) | 🏖[ TODO LIST] ( #todo-list ) | 🌈[ 系统架构 ] ( #系统架构 ) |💡[ 流程图 ] ( #流程图 ) |🌁[ 快速启动 ] ( #快速启动 ) |👨🏻✈️[ 内置命令 ] ( #客户端内置命令 ) |🎤[ 通信 ] ( #群聊私聊 ) |❓[ QA] ( https://github.com/crossoverJie/cim/blob/master/doc/QA.md ) |💌[ 联系作者 ] ( #联系作者 )
13+ 📘[ Introduction ] ( #introduction ) |📽[ Video Demo ] ( #video-demo ) | 🏖[ TODO LIST] ( #todo-list ) | 🌈[ Architecture ] ( #architecture ) |💡[ Flow Chart ] ( #flow-chart ) |🌁[ Quick Start ] ( #quick-start ) |👨🏻✈️[ Built-in Commands ] ( #built-in-commands ) |🎤[ Chat ] ( #group-chatprivate-chat ) |❓[ QA] ( https://github.com/crossoverJie/cim/blob/master/doc/QA.md ) |💌[ Contact ] ( #contact )
1314
15+ [ 中文文档] ( README-zh.md )
1416
1517</div >
1618<br />
1719
1820# V2.0
19- - [x] Upgrade to JDK17 & springboot3.0
20- - [x] Client SDK
21+ - [x] Upgrade to JDK17 & springboot3.0
22+ - [x] Client SDK
2123- [ ] Client use [ picocli] ( https://picocli.info/ ) instead of springboot.
2224- [x] Support integration testing.
2325- [ ] Integrate OpenTelemetry .
@@ -36,35 +38,35 @@ Using `CIM`, you can achieve the following requirements:
3638- Message push middleware for ` APP ` .
3739- Message middleware for ` IOT ` massive connection scenarios.
3840
39- > If you have any questions during use or development, you can [ contact me ] ( #联系作者 ) .
41+ > If you have any questions during use or development, you can [ contact the author ] ( #contact ) .
4042
41- ## 视频演示
43+ ## Video Demo
4244
43- > 点击下方链接可以查看视频版 Demo。
45+ > Click the links below to watch the video demo.
4446
4547| YouTube | Bilibili|
46- | :------:| :------: |
47- | [ 群聊 ] ( https://youtu.be/_9a4lIkQ5_o ) [ 私聊 ] ( https://youtu.be/kfEfQFPLBTQ ) | [ 群聊 ] ( https://www.bilibili.com/video/av39405501 ) [ 私聊 ] ( https://www.bilibili.com/video/av39405821 ) |
48+ | :------:| :------: |
49+ | [ Group Chat ] ( https://youtu.be/_9a4lIkQ5_o ) [ Private Chat ] ( https://youtu.be/kfEfQFPLBTQ ) | [ Group Chat ] ( https://www.bilibili.com/video/av39405501 ) [ Private Chat ] ( https://www.bilibili.com/video/av39405821 ) |
4850| <img src =" https://i.loli.net//2019//05//08//5cd1d9e788004.jpg " height =" 295px " /> | <img src =" https://i.loli.net//2019//05//08//5cd1da2f943c5.jpg " height =" 295px " />
4951
5052![ demo.gif] ( pic/demo.gif )
5153
5254## TODO LIST
5355
54- * [x] [ 群聊 ] ( #群聊 )
55- * [x] [ 私聊 ] ( #私聊 )
56- * [x] [ 内置命令 ] ( #客户端内置命令 )
57- * [x] [ 聊天记录查询 ] ( #聊天记录查询 ) 。
58- * [x] [ 一键开启价值 2 亿的 ` AI ` 模式 ] ( #ai-模式 )
59- * [x] 使用 ` Google Protocol Buffer ` 高效编解码
60- * [x] 根据实际情况灵活的水平扩容、缩容
61- * [x] 服务端自动剔除离线客户端
62- * [x] 客户端自动重连
63- * [x] [ 延时消息 ] ( #延时消息 )
64- * [x] SDK 开发包
65- * [ ] 分组群聊
66- * [ ] 离线消息
67- * [ ] 消息加密
56+ * [x] [ Group Chat ] ( #group-chat )
57+ * [x] [ Private Chat ] ( #private-chat )
58+ * [x] [ Built-in Commands ] ( #built-in-commands )
59+ * [x] [ Chat History Query ] ( #chat-history-query )
60+ * [x] [ AI Mode ] ( #ai-mode )
61+ * [x] Efficient encoding/decoding with ` Google Protocol Buffer `
62+ * [x] Flexible horizontal scaling based on actual needs
63+ * [x] Server-side automatic removal of offline clients
64+ * [x] Client automatic reconnection
65+ * [x] [ Delayed Messages ] ( #delayed-messages )
66+ * [x] SDK development package
67+ * [ ] Group categorization
68+ * [ ] Offline messages
69+ * [ ] Message encryption
6870
6971
7072
@@ -103,44 +105,44 @@ IM client terminal, a command can be started and initiated to communicate with o
103105- Server push message to Client2
104106
105107
106- ## Quick start
108+ ## Quick Start
107109
108110### Docker
109111
110- ` allin1 ` 镜像内置了 Zookeeper、 Redis、 cim-server、 cim-forward-route 四个服务,使用 [ Supervisor] ( http://supervisord.org/ ) 统一管理,开箱即用。
112+ The ` allin1 ` image comes with Zookeeper, Redis, cim-server, and cim-forward-route pre-installed, all managed by [ Supervisor] ( http://supervisord.org/ ) for an out-of-the-box experience.
111113
112- ** 支持平台: ** linux/amd64, linux/arm64, linux/arm/v7
114+ ** Supported platforms: ** linux/amd64, linux/arm64, linux/arm/v7
113115
114- ** 端口说明: **
116+ ** Port mapping: **
115117
116118| Port | Service | Description |
117119| ------| ---------| -------------|
118- | 2181 | Zookeeper | 服务注册与发现 |
119- | 6379 | Redis | 数据缓存 |
120- | 8083 | Route Server | HTTP API 路由服务 |
120+ | 2181 | Zookeeper | Service registration & discovery |
121+ | 6379 | Redis | Data caching |
122+ | 8083 | Route Server | HTTP API routing service |
121123
122- 拉取镜像并启动:
124+ Pull the image and start the container:
123125
124126``` shell
125127docker pull ghcr.io/crossoverjie/allin1-ubuntu:latest
126128docker run -p 2181:2181 -p 6379:6379 -p 8083:8083 --rm --name cim-allin1 ghcr.io/crossoverjie/allin1-ubuntu:latest
127129```
128130
129- 容器启动后,可参考下方 [ 注册账号 ] ( #注册账号 ) 和 [ 启动客户端 ] ( #启动客户端 ) 章节快速体验完整的 IM 流程。
131+ After the container starts, refer to the [ Register Account ] ( #register-account ) and [ Start Client ] ( #start-client ) sections below to experience the full IM workflow.
130132
131- ### Build Docker image locally
133+ ### Build Docker Image Locally
132134
133- 如果需要从源码构建镜像:
135+ To build the Docker image from source:
134136
135137``` shell
136- # 在项目根目录执行
138+ # Run from the project root directory
137139docker build -t cim-allin1:latest -f docker/allin1-ubuntu.Dockerfile .
138140docker run -p 2181:2181 -p 6379:6379 -p 8083:8083 --rm --name cim-allin1 cim-allin1:latest
139141```
140142
141- ### Build in local
143+ ### Build from Source
142144
143- 首先需要安装 ` Zookeeper、 Redis ` 并保证网络通畅。
145+ First, install ` Zookeeper ` and ` Redis ` and ensure the network is accessible.
144146
145147``` shell
146148docker run --rm --name zookeeper -d -p 2181:2181 zookeeper:3.9.2
@@ -155,57 +157,57 @@ cd cim-server && cim-client && cim-forward-route
155157mvn clean package spring-boot:repackage -DskipTests=true
156158```
157159
158- ### 部署 IM-server(cim-server)
160+ ### Deploy IM-server (cim-server)
159161
160162``` shell
161163cp /cim/cim-server/target/cim-server-1.0.0-SNAPSHOT.jar /xx/work/server0/
162164cd /xx/work/server0/
163- nohup java -jar /root/work/server0/cim-server-1.0.0-SNAPSHOT.jar --cim.server.port=9000 --app.zk.addr=zk地址 > /root/work/server0/log.file 2>&1 &
165+ nohup java -jar /root/work/server0/cim-server-1.0.0-SNAPSHOT.jar --cim.server.port=9000 --app.zk.addr=< zk-address > > /root/work/server0/log.file 2>&1 &
164166```
165167
166- > cim-server 集群部署同理,只要保证 Zookeeper 地址相同即可。
168+ > For cim-server cluster deployment, just ensure all instances point to the same Zookeeper address.
167169
168- ### 部署路由服务器 (cim-forward-route)
170+ ### Deploy Route Server (cim-forward-route)
169171
170172``` shell
171173cp /cim/cim-server/cim-forward-route/target/cim-forward-route-1.0.0-SNAPSHOT.jar /xx/work/route0/
172174cd /xx/work/route0/
173- nohup java -jar /root/work/route0/cim-forward-route-1.0.0-SNAPSHOT.jar --app.zk.addr=zk地址 --spring.redis.host=redis地址 --spring.redis.port=6379 > /root/work/route/log.file 2>&1 &
175+ nohup java -jar /root/work/route0/cim-forward-route-1.0.0-SNAPSHOT.jar --app.zk.addr=< zk-address > --spring.redis.host=< redis-address > --spring.redis.port=6379 > /root/work/route/log.file 2>&1 &
174176```
175177
176- > cim-forward-route 本身就是无状态,可以部署多台;使用 Nginx 代理即可。
178+ > cim-forward-route is stateless and can be deployed on multiple nodes; use Nginx as a reverse proxy.
177179
178180
179- ### 启动客户端
181+ ### Start Client
180182
181183``` shell
182184cp /cim/cim-client/target/cim-client-1.0.0-SNAPSHOT.jar /xx/work/route0/
183185cd /xx/work/route0/
184- java -jar cim-client-1.0.0-SNAPSHOT.jar --server.port=8084 --cim.user.id=唯一客户端ID --cim.user.userName=用户名 --cim.route.url=http://路由服务器 :8083/
186+ java -jar cim-client-1.0.0-SNAPSHOT.jar --server.port=8084 --cim.user.id=< unique-client-id > --cim.user.userName=< username > --cim.route.url=http://< route-server > :8083/
185187```
186188
187189![ ] ( https://ws2.sinaimg.cn/large/006tNbRwly1fylgxjgshfj31vo04m7p9.jpg )
188190![ ] ( https://ws1.sinaimg.cn/large/006tNbRwly1fylgxu0x4uj31hy04q75z.jpg )
189191
190- 如上图,启动两个客户端可以互相通信即可。
192+ As shown above, two clients can communicate with each other.
191193
192- ### 本地启动客户端
194+ ### Local Client Startup
193195
194- #### 注册账号
196+ #### Register Account
195197``` shell
196198curl -X POST --header ' Content-Type: application/json' --header ' Accept: application/json' -d ' {
197199 "reqNo": "1234567890",
198200 "timeStamp": 0,
199201 "userName": "zhangsan"
200- }' ' http://路由服务器 :8083/registerAccount'
202+ }' ' http://<route-server> :8083/registerAccount'
201203```
202204
203- 从返回结果中获取 ` userId `
205+ Get the ` userId ` from the response:
204206
205207``` json
206208{
207209 "code" :" 9000" ,
208- "message" :" 成功 " ,
210+ "message" :" success " ,
209211 "reqNo" :null ,
210212 "dataBody" :{
211213 "userId" :1547028929407 ,
@@ -214,106 +216,106 @@ curl -X POST --header 'Content-Type: application/json' --header 'Accept: applica
214216}
215217```
216218
217- #### 启动本地客户端
219+ #### Start Local Client
218220``` shell
219- # 启动本地客户端
221+ # Start local client
220222cp /cim/cim-client/target/cim-client-1.0.0-SNAPSHOT.jar /xx/work/route0/
221223cd /xx/work/route0/
222- java -jar cim-client-1.0.0-SNAPSHOT.jar --server.port=8084 --cim.user.id=上方返回的userId --cim.user.userName=用户名 --cim.route.url=http://路由服务器 :8083/
224+ java -jar cim-client-1.0.0-SNAPSHOT.jar --server.port=8084 --cim.user.id=< userId-from-above > --cim.user.userName=< username > --cim.route.url=http://< route-server > :8083/
223225```
224226
225- ## 客户端内置命令
226-
227- | 命令 | 描述 |
228- | ------ | ------ |
229- | ` :q! ` | 退出客户端 |
230- | ` :olu ` | 获取所有在线用户信息 |
231- | ` :all ` | 获取所有命令 |
232- | ` :q [option ] ` | 【 : q 关键字】查询聊天记录 |
233- | ` :ai ` | 开启 AI 模式 |
234- | ` :qai ` | 关闭 AI 模式 |
235- | ` :pu ` | 模糊匹配用户 |
236- | ` :info ` | 获取客户端信息 |
237- | ` :emoji [option] ` | 查询表情包 [ option:页码 ] |
238- | ` :delay [msg] [delayTime] ` | 发送延时消息 |
239- | ` : ` | 更多命令正在开发中。。 |
227+ ## Built-in Commands
228+
229+ | Command | Description |
230+ | ------ | ------ |
231+ | ` :q! ` | Quit the client |
232+ | ` :olu ` | List all online users |
233+ | ` :all ` | Show all available commands |
234+ | ` :q [keyword ] ` | Search chat history by keyword |
235+ | ` :ai ` | Enable AI mode |
236+ | ` :qai ` | Disable AI mode |
237+ | ` :pu ` | Fuzzy search users |
238+ | ` :info ` | Show client information |
239+ | ` :emoji [option] ` | Browse emoji list [ option: page number ] |
240+ | ` :delay [msg] [delayTime] ` | Send a delayed message |
241+ | ` : ` | More commands are under development... |
240242
241243![ ] ( https://ws3.sinaimg.cn/large/006tNbRwly1fylh7bdlo6g30go01shdt.gif )
242244
243- ### 聊天记录查询
245+ ### Chat History Query
244246
245247![ ] ( https://i.loli.net/2019/05/08/5cd1c310cb796.jpg )
246248
247- 使用命令 ` :q 关键字 ` 即可查询与个人相关的聊天记录。
249+ Use the command ` :q keyword ` to search chat history related to you.
248250
249- > 客户端聊天记录默认存放在 ` /opt/logs/cim/ ` ,所以需要这个目录的写入权限。也可在启动命令中加入 ` --cim.msg.logger.path = /自定义 ` 参数自定义目录。
251+ > Client chat history is stored in ` /opt/logs/cim/ ` by default, so write permission is required for this directory. You can also customize the directory by adding ` --cim.msg.logger.path=/custom/path ` to the startup command.
250252
251253
252254
253- ### AI 模式
255+ ### AI Mode
254256
255257![ ] ( https://i.loli.net/2019/05/08/5cd1c30e47d95.jpg )
256258
257- 使用命令 ` :ai ` 开启 AI 模式,之后所有的消息都会由 ` AI ` 响应。
259+ Use the command ` :ai ` to enable AI mode. After that, all messages will be responded to by ` AI ` .
258260
259- ` :qai ` 退出 AI 模式。
261+ Use ` :qai ` to exit AI mode.
260262
261- ### 前缀匹配用户名
263+ ### Prefix Match Username
262264
263265![ ] ( https://i.loli.net/2019/05/08/5cd1c32ac3397.jpg )
264266
265- 使用命令 ` :qu prefix ` 可以按照前缀的方式搜索用户信息。
267+ Use the command ` :qu prefix ` to search user information by prefix.
266268
267- > 该功能主要用于在移动端中的输入框中搜索用户。
269+ > This feature is primarily designed for searching users in input fields on mobile clients.
268270
269- ### 群聊/私聊
271+ ### Group Chat/Private Chat
270272
271- #### 群聊
273+ #### Group Chat
272274
273275![ ] ( https://ws1.sinaimg.cn/large/006tNbRwly1fyli54e8e1j31t0056x11.jpg )
274276![ ] ( https://ws3.sinaimg.cn/large/006tNbRwly1fyli5yyspmj31im06atb8.jpg )
275277![ ] ( https://ws3.sinaimg.cn/large/006tNbRwly1fyli6sn3c8j31ss06qmzq.jpg )
276278
277- 群聊只需要在控制台里输入消息回车后即可发送,同时所有在线客户端都可收到消息。
279+ For group chat, simply type a message in the console and press Enter to send. All online clients will receive the message.
278280
279- #### 私聊
281+ #### Private Chat
280282
281- 私聊首先需要知道对方的 ` userID ` 才能进行。
283+ To send a private message, you need to know the recipient's ` userID ` .
282284
283- 输入命令 ` :olu ` 可列出所有在线用户。
285+ Use the command ` :olu ` to list all online users.
284286
285287![ ] ( https://ws4.sinaimg.cn/large/006tNbRwly1fyli98mlf3j31ta06mwhv.jpg )
286288
287- 接着使用 ` userId;;消息内容 ` 的格式即可发送私聊消息。
289+ Then use the format ` userId;;message content ` to send a private message.
288290
289291![ ] ( https://ws4.sinaimg.cn/large/006tNbRwly1fylib08qlnj31sk082zo6.jpg )
290292![ ] ( https://ws1.sinaimg.cn/large/006tNbRwly1fylibc13etj31wa0564lp.jpg )
291293![ ] ( https://ws3.sinaimg.cn/large/006tNbRwly1fylicmjj6cj31wg07c4qp.jpg )
292294![ ] ( https://ws1.sinaimg.cn/large/006tNbRwly1fylicwhe04j31ua03ejsv.jpg )
293295
294- 同时另一个账号收不到消息。
296+ Meanwhile, the other account will not receive the message.
295297![ ] ( https://ws3.sinaimg.cn/large/006tNbRwly1fylie727jaj31t20dq1ky.jpg )
296298
297299
298300
299- ### emoji 表情支持
301+ ### Emoji Support
300302
301- 使用命令 ` :emoji 1 ` 查询出所有表情列表,使用表情别名即可发送表情。
303+ Use the command ` :emoji 1 ` to list all available emojis. Use the emoji alias to send an emoji.
302304
303305![ ] ( https://tva1.sinaimg.cn/large/006y8mN6ly1g6j910cqrzj30dn05qjw9.jpg )
304306![ ] ( https://tva1.sinaimg.cn/large/006y8mN6ly1g6j99hazg6j30ax03hq35.jpg )
305-
306- ### 延时消息
307307
308- 发送 10s 的延时消息:
308+ ### Delayed Messages
309+
310+ Send a message with a 10-second delay:
309311
310312``` shell
311313:delay delayMsg 10
312314```
313315
314316![ ] ( pic/delay.gif )
315317
316- ## 联系作者
318+ ## Contact
317319
318320## Contributing
319321
@@ -343,19 +345,4 @@ mvn checkstyle:check
343345mvn package -Dcheckstyle.skip=true
344346```
345347
346- <div align =" center " >
347-
348- <a href =" https://t.zsxq.com/odQDJ " target =" _blank " ><img src =" https://s2.loli.net/2024/05/17/zRkabDu2SKfChLX.png " alt =" 202405171520366.png " ></a >
349- </div >
350-
351- 最近开通了知识星球,感谢大家对 CIM 的支持,为大家提供 100 份 10 元优惠券,也就是 69-10=59 元,具体福利大家可以扫码参考再决定是否加入。
352-
353- > PS: 后续会在星球开始 V2.0 版本的重构,感兴趣的可以加入星球当面催更(当然代码依然会开源)。
354-
355348- [ crossoverJie@gmail.com ] ( mailto:crossoverJie@gmail.com )
356- - 微信公众号
357-
358- ![ index.jpg] ( https://i.loli.net/2021/10/12/ckQW9LYXSxFogJZ.jpg )
359-
360-
361-
0 commit comments