Skip to content

3dd13/codeaholics_chat_room

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

a demo application to show how to build up a chat room using Ruby On Rails and Web Socket with security considered

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published