{"id":13672596,"url":"https://github.com/PENGZhaoqing/RailsChat","last_synced_at":"2025-04-27T22:32:35.133Z","repository":{"id":84990086,"uuid":"83521132","full_name":"PENGZhaoqing/RailsChat","owner":"PENGZhaoqing","description":"Real-time Rails-based Webchat for Instant Messaging (实时Web聊天室)","archived":false,"fork":false,"pushed_at":"2017-09-07T03:58:18.000Z","size":6729,"stargazers_count":86,"open_issues_count":2,"forks_count":61,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-05T04:03:42.953Z","etag":null,"topics":["instant-messaging","rails-application","socket","sync","webchat-server"],"latest_commit_sha":null,"homepage":"http://139.129.209.63:44400/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PENGZhaoqing.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}},"created_at":"2017-03-01T06:39:07.000Z","updated_at":"2025-02-06T15:35:49.000Z","dependencies_parsed_at":"2023-03-02T21:00:55.116Z","dependency_job_id":null,"html_url":"https://github.com/PENGZhaoqing/RailsChat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PENGZhaoqing%2FRailsChat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PENGZhaoqing%2FRailsChat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PENGZhaoqing%2FRailsChat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PENGZhaoqing%2FRailsChat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PENGZhaoqing","download_url":"https://codeload.github.com/PENGZhaoqing/RailsChat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251219601,"owners_count":21554444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["instant-messaging","rails-application","socket","sync","webchat-server"],"created_at":"2024-08-02T09:01:40.926Z","updated_at":"2025-04-27T22:32:30.117Z","avatar_url":"https://github.com/PENGZhaoqing.png","language":"Ruby","readme":"# RailsChat \n\nRailsChat是一款由Rails开发的实时Web聊天室，在[Render_sync](https://github.com/chrismccord/render_sync)的基础上完成，有需要即时通讯的应用可以考虑这个Example\n\n## Online Demo\n\n![demo](demo.gif)\n\n请点击[这里](http://139.129.209.63:44400/)访问Demo，测试用户登陆账号格式为：\n\n```\nusername: user\u003cnumber\u003e@test.com\npassword: password\n```\n\n* 其中number为1到20，代表20个用户，例如使用`user1@test.com`和`password`能登陆用户1，以此类推\n\nNote：请用两个浏览器分别登陆不同的用户来测试消息的即使推送，注意这两个用户需要互为好友\n\n## 目前功能\n\n* 聊天室消息即时推送\n* 支持查找，添加，删除好友\n* 创建私人聊天，也支持多人聊天\n* 房主可以拉人，踢人\n* 房主能转移房屋权限\n\n## Todo\n\n1. 现在的即时推送只限于聊天的消息，其他的推送比如未读信息提醒（包括声音）等还未涉及\n2. 添加好友需要对方同意，现在是单方面添加\n3. 用户个人简介还未开发\n4. UI界面修改（类似WeChat）\n5. 管理后台开发\n\n## Usage \n\n### [RailsChat详细教程-传送门](http://blog.csdn.net/ppp8300885/article/details/59109778)\n\n1. Fork项目\n\n  ```\n  git clone https://github.com/your_user_name/RailsChat\n  cd RailsChat\n  bundle install\n  rails server\n  ```\n\n2. 然后再打开另外一个终端，运行以下命令启动另外一个server来监听聊天室的用户并实时推送最新的消息：\n\n  ```\n  rackup sync.ru -E production\n  ```\n\n### Note：如果要部署到云上或者本地局域网内，需要修改`config/sync.yml`文件\n\n以本地局域网为例：\n\n1. 若本机的ip地址为192.168.0.14（使用`ifconfig`查看），那么需要将config/sync.yml中的localhost全改为此ip地址，例如\n \n ```\n  development:\n    server: \"http://192.168.0.14:9292/faye\"\n    adapter_javascript_url: \"http://192.168.0.14:9292/faye/faye.js\"\n    auth_token:  \"97c42058e1466902d5adfac0f83e84c1794b9c3390e3b0824be9db8344eae82b\"\n    adapter: \"Faye\"\n    async: true\n    \n  test:\n    ...\n  production:\n    ...\n  ```\n\n2. 然后运行rake tmp:clear来清除缓存，不然修改不会生效（运行前先将所有相关的运行停止：如rails s,rackup sync.ru等）\n\n3. 再次运行rails服务器和监听程序，并指定监听程序运行的ip地址\n\n  ```\n  rails s\n  bundle exec rackup sync.ru -E production --host 192.168.0.14 \n  ```\n\n### Tips:\n\n1. 在服务器中可以后台运行rack：`bundle exec rackup sync.ru -E production --host 192.168.0.14 -D`\n2. 若要关闭在后台运行的rackup，请使用`ps ax | grep ruby`查找相关ruby端口，然后用`kill －9 \u003cpid\u003e`结束正在运行的rackup，如：\n\n```\n21099 ?        Sl     0:00 /var/www/railschat/RailsChat/vendor/bundle/ruby/2.3.0/bin/rackup                                    \n21105 pts/4    S+     0:00 grep --color=auto ruby\n```\n  \n\n\n\n## Debug\n\n1. 当遇到消息并没有实时推送的情况时，先F12查看浏览器的Js文件加载情况，若faye.js加载成功则一般不会出现问题\n\n2. 以上加载完成但是仍然没有推送的时候，请查看Rails服务器的log文件\n\n3. 需要在两个浏览器中登录不同的账号来检验聊天室功能\n\n\n## 截图\n\n\u003cimg src=\"/lib/Snip20170301_2.png\"\u003e\n\n\u003cimg src=\"/lib/Snip20170301_3.png\"\u003e\n\n\u003cimg src=\"/lib/Snip20170301_4.png\"\u003e\n\n\u003cimg src=\"/lib/Snip20170301_5.png\"\u003e\n\n\n\n**如果觉得好，请给项目点颗星来支持吧～～** \n\n有什么好的建议，请在issue中提出，欢迎contributors！\n\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPENGZhaoqing%2FRailsChat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPENGZhaoqing%2FRailsChat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPENGZhaoqing%2FRailsChat/lists"}