a demo application to show how to build up a chat room using Ruby On Rails and Web Socket with security considered
Ruby CoffeeScript JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
config
db
doc
lib
log
public
script
test
vendor
.gitignore
Gemfile
Gemfile.lock
Procfile
README.rdoc
Rakefile
config.ru
private_pub.ru

README.rdoc

Codeaholics Chatroom

  • This is a demo application (for Codeaholics HK meetup) to show how to build up a chat room with security considered.

  • It is written in Ruby On Rails with Web Socket communication.

  • Web Socket communication channel can be secured by using HTTPS.

Steps to run this application on your machine

  1. get your ruby on rails environment setup. I am using Ruby 1.9.3 and Rails 3.2.

  2. download the project

git clone git@github.com:3dd13/codeaholics_chat_room.git
  1. go into the project folder

cd codeaholics_chat_room
  1. install all the dependencies

bundle install
  1. prepare the MySQL database

cp database.yml.sample database.yml 
update database.yml with your mysql login password
rake db:create
rake db:migate
  1. start the Rails application

rails s
  1. open another terminal, start the Faye service

rackup private_pub.ru -s thin -E production

Dependency projects

Run Faye on heroku

basically it is relying on the Procfile to instruct heroku how to start the faye service. Check out the Procfile usage on heroku documentation if you are interested.

Warning ! Do not just use this one version for production use

there are few things you have to do before deploying to production, in order to make sure it is secure. For example,

  • you have to change the token in private_pub.yml

  • you have to setup HTTPS for the publish and subscribe channel

  • you have to change the rails session store key