Category: Javascript

Juggernaut Rails Chat – part II (design)

Welcome to part II of Juggernaut Rails chat tutorial. Today we will create a design for our project.

First of all: name. "Ruby on Rails Juggernaut Chat" is slightly to long. So I've decided to use first letters of "long name": RoR J Ch and I've came up with some ideas:

  • Chatror - Chat on RoR
  • Hathor - Egyptian goddess of the sky
  • Racer - Ruby on rails ChattER

I've chosen last one - so our chat will be called "Racer".

I have also created a logo - it should be connected with cars/races (racer) and also with Rails :) - 30 minutes with Gimp and here it is:

racer_logo

So, we have name nad logotype but we still need major chat design.

What do we need?

  • Chat ;)
  • Registration form
  • Sign in form
  • Room list
  • Our chat room
  • Users list
  • Message input field

20 more minutes and we have our layout:

racer_layout

Tutorial parts:

  1. Juggernaut Rails Chat – part I (what is and how to install Juggernaut)
  2. Juggernaut Rails Chat – part II (design)
  3. Juggernaut Rails Chat – part III (registration and authentication)
  4. Juggernaut Rails Chat – część IV (zarządzanie pokojami)
  5. Juggernaut Rails Chat – część V (łączenie użytkowników z pokojami)
  6. Juggernaut Rails Chat – część VI (odpalamy Juggernaut i nasz chat)
  7. Juggernaut Rails Chat – część VII (emotikonki i dźwięk)

Juggernaut Rails Chat – part I – What is and how to install Juggernaut

Today we will start creating our own Rails flash socket based chat engine.

What is Juggernaut?

The Juggernaut plugin for Ruby on Rails aims to revolutionize your Rails app by letting the server initiate a connection and push data to the client. In other words your app can have a real time connection to the server with the advantage of instant updates. Although the obvious use of this is for chat, the most exciting prospect is collaborative cms and wikis. Now you won't need to make requests every 1-2 seconds to check for data. Data will be send directly to you!

Lets assume - we have 60 chat users. Each one checks every 0.5 second for new data. They don't write anything - just sit there, but there will always be 120 requests per second even when nothing is happening. And that's the place where Juggernaut magic helps

Installation

This tutorial is for *nix users - never tried to run it on Windows.

What we need?

We need to install some additional gems:

gem install json
gem install eventmachine

And of course Juggernaut:

sudo gem install juggernaut

And that’s all for now. Next time we will start building our small chat.

Tutorial parts:

  1. Juggernaut Rails Chat – part I (what is and how to install Juggernaut)
  2. Juggernaut Rails Chat – part II (design)
  3. Juggernaut Rails Chat – part III (registration and authentication)
  4. Juggernaut Rails Chat – część IV (zarządzanie pokojami)
  5. Juggernaut Rails Chat – część V (łączenie użytkowników z pokojami)
  6. Juggernaut Rails Chat – część VI (odpalamy Juggernaut i nasz chat)
  7. Juggernaut Rails Chat – część VII (emotikonki i dźwięk)

Copyright © 2025 Closer to Code

Theme by Anders NorenUp ↑