nsallis / rabbitbnb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rabbitbnb

a code challenge to show off rabbitmq, docker-compose, and rails.

setup

  • make sure you have docker and docker-compose installed.
  • we need to set up the db for rails: ./setup (from the root application directory)
  • start the main application: ./start
  • inject a "vote" into rabbitmq's default exchange: ./rate BNB_NAME FIRST_NAME LAST_NAME
  • take a look at localhost:3000/ratings to show all existing bnbs, their number of votes and who voted for them.
  • take a look at localhost:3000/ratings/BNB_NAME to see the bnb and its votes

If you check the logs for the main application, you will notice that if you try to vote more than once, you will get an error response.

As an easter-egg, you can run ./rig_the_polls BNB_NAME VOTE_COUNT to rig the polls and give the bnb of your choice VOTE_COUNT votes at once using random names.

To reset the application database, use ./reset

About


Languages

Language:Ruby 79.1%Language:HTML 13.4%Language:JavaScript 2.8%Language:CSS 1.7%Language:Dockerfile 1.5%Language:Shell 1.5%