Message Broadcasting
This app uses Grape framework to build microservices-ready APIs. Each part of the API can be easily separated and mounted as a standalone microservice, Rack-compatible. Rails is being used here as an umbrella app with Grape-based APIs mounted in.
more info https://github.com/ruby-grape
Ruby 2.3.3
Redis
PostgreSQL
git clone [email protected]:leafmind/messenger.git
cd messenger
(rvm install ruby-2.3.3) if you haven't installed it already
(optional: check out /doc folder which contains source-code-related docs)
(check settings.yml and settings/development.yml and make changes accordingly)
bundle install
bundle exec rake db:create db:migrate db:seed
bundle exec rspec spec
bundle exec rails s
heroku login
heroku git:remote -a ancient-shelf-98201 (paste your app name)
git push heroku master
heroku run bundle exec rake db:migrate
heroku run bundle exec rake db:seed
heroku addons:add redistogo
heroku config --app your_app_name | grep REDISTOGO_URL
(put this url to config/cable.yml production section)
(Also you should change your app name in config/settings/production.yml)
git push heroku master
deployed on heroku
https://ancient-shelf-98201.herokuapp.com
- Register
- Choose a room
- Type something
- Check out the API LiveDoc: https://ancient-shelf-98201.herokuapp.com/swagger
- Add some messages via LiveDoc and check out the room again
- Add URIs to websites or images to your message
- Be Happy
Goto 1 and connect several users to the 'messages' room to see live broadcasting from REST API(Swagger) in action You can use your own API token in Swagger instead of a debug token(You will find it on the rooms page after registration)
Swagger allows you to easily interact with your app's REST API, providing flexible documentation solution at the same time