百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

Rails5-ActionCable-Redux-React-ChatAppExample

> 编程语言
开源

A Rails5, 动作电缆, Redux/ React ChatApp 示例,现在用Webpack/HMR进行快速开发

190 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

A Rails5, 动作电缆, Redux/ React ChatApp 示例,现在用Webpack/HMR进行快速开发

Rails5-ActionCable-Redux-React-ChatAppExample

[Updated Feb 27, 2016] Now with Webpack and Hot Module Replacement (HMR) for rapid development

Rails5 brings the long-awaited ActionCable (integrated websockets) into the game. Combined with the Redux implementation of Flux - and of course React components - there's potential here for an interesting stack if you don't want to create a separate front-end app and use Rails5 as an API server (which it now more easily does out of the box as an option, BTW).

I spent some time over the holiday break pulling examples from:

  • react-rails
  • react_on_rails
  • Kenta Suzuki's react-rails-redux-sample
  • DHH's Rails 5: Action Cable Demo
  • react-redux-universal-hot-example
  • ...and the Redux docs.

..to create a very simple chat app. Live demo here.

If you're curious to learn more, I posted some background/motivation and a code walkthrough on my Medium account here. Another post discussing the webpack/HMR addition is coming soon.

Anyway, diving right into the setup (I'm assuming you are familiar with Rails/JavaScript):

  • Make sure you have Ruby 2.2.4, Rails 5.0.0.beta3 (or higher, if applicable), and recent versions of NPM, PostgreSQL, and Redis installed (for the Rails stuff, here's a quick setup tutorial).
  • Grab the Redux dev tools Chrome exention
  • Copy config/database.yml.example to config/database.yml and setup your username to be whatever super user (PostgreSQL) you have on your local machine.
  • From the Rails root in your console, run bundle install and npm install and rails db:create and rails db:migrate and rails db:seed to add a quick "Hello World" message into the database.
  • Fire up your Rails server via rails s and point your web browser to http://localhost:3000
  • The first time you load the app, browserify-rails will do some caching, so give it a few seconds to load.
  • Try opening two browsers side-by-side and see the web socket (via Action Cable) do its thing as you submit messages.
  • For more rapid development with HMR with your react components, fire up the webpack server via npm start

That's it for now!

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言