Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nickgnd/hanami-chat-example
Basic chat application built with Hanami and LiteCable (compatible with AnyCable)
https://github.com/nickgnd/hanami-chat-example
actioncable anycable hanami hanami-application ruby websockets
Last synced: 26 days ago
JSON representation
Basic chat application built with Hanami and LiteCable (compatible with AnyCable)
- Host: GitHub
- URL: https://github.com/nickgnd/hanami-chat-example
- Owner: nickgnd
- License: mit
- Created: 2017-05-09T22:43:56.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-18T20:31:58.000Z (almost 2 years ago)
- Last Synced: 2024-11-02T03:12:03.924Z (about 1 month ago)
- Topics: actioncable, anycable, hanami, hanami-application, ruby, websockets
- Language: Ruby
- Size: 3.38 MB
- Stars: 9
- Watchers: 3
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-hanami - hanami-chat-example - A basic chat application built with Hanami and [LiteCable](https://github.com/palkan/litecable) (compatible with [AnyCable](http://anycable.io/)) (Hanami Project List / Play/Pet projects)
README
## Sample chat application built with Hanami and LiteCable (compatible with AnyCable)
The application is **literally** the porting of the [LiteCable](https://github.com/palkan/litecable) [Sinatra example](https://github.com/palkan/litecable/tree/master/examples/sinatra) to [Hanami](http://hanamirb.org/) (kudos to [palkan](https://github.com/palkan) for its work :clap: :clap: :clap: ).
### Usage
Install dependencies:
```
bundle install
```Run server
```
bundle exec puma
```Open your browser at [localhost:9292](http://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](http://anycable.io/), it requires [Redis](https://redis.io/) (see the [docs](https://github.com/anycable/anycable) for more details).
Just run `Procfile` with your favourite tool ([hivemind](https://github.com/DarthSim/hivemind) or [Foreman](http://ddollar.github.io/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
- Vladimir Dementyev ([palkan](https://github.com/palkan))