nickgnd / hanami-chat-example

Basic chat application built with Hanami and LiteCable (compatible with AnyCable)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sample chat application built with Hanami and LiteCable (compatible with AnyCable)

The application is literally the porting of the LiteCable Sinatra example to Hanami (kudos to palkan for its work ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ).

Usage

Install dependencies:

bundle install

Run server

bundle exec puma

Open your browser at localhost:9292, enter your name and a chat room ID (anything you want).

Then open another session (another browser, incognito window) and repeat all steps using the same room ID.

Now you can chat with yourself!

AnyCable usage (for production)

This example also can be used with AnyCable, it requires Redis (see the docs for more details).

Just run Procfile with your favourite tool (hivemind or Foreman):

hivemind

or

foreman start

Notes

  • The application provide a basic example of integration between Hanami and AnyCable/LiteCable, it is a proof of concept and it was never tested in production.
  • There are a few specs (added by Hanami generators), but they are broken :( I didn't fix they for the same reason I wrote above and because the application is a merely porting of the Sinatra example to Hanami.

Contributing

Bug reports and PRs are welcome on GitHub at https://github.com/nickgnd/hanami-chat-example

Credits

About

Basic chat application built with Hanami and LiteCable (compatible with AnyCable)

License:MIT License


Languages

Language:Ruby 40.0%Language:JavaScript 38.8%Language:CSS 14.6%Language:HTML 6.6%