Gifs Against Humanity

Everyone's favorite family game, "Cards Against Humanity". But with GIFs!

Hosted:
https://gifsbattlehumanity.herokuapp.com/
Github:
https://github.com/InvasiveLionfish/GAH (Rules can be found in the ReadMe)

Tech: Rails 5, ActionCable, Giphy API, Twitter Bootstrap, Heroku

Team: The brilliant Erin Pettigrew, Gabriel Seidner, Robin Tully & Myself.

  • Implemented websockets in Rails 5 with ActionCable to build real-time game play.
  • Upgraded a Rails 4 app to Rails 5, implemented Postgres database and modeled associations with ActiveRecord.
  • Leveraged jQuery & AJAX for smoother user experience. Implemented Bootstrap theme.
  • Successfully managed deployment with Heroku
  • Successfully wrote RSPEC tests, and refactored using design patterns.
Work Done

Upgrading to Rails5 :
The act of upgrading major versions between apps was worth the trouble. The decision to upgrade from version 4 to 5 was because of ActionCable, and at about the midway point of development.

Action Cable : This deserves to be its own blog post. Setting this up was sheer pain and joy infused. Remember kids, this was way back when Rails 5 was still in the pre phase and there was absolutely no documentation about ActionCable. It was just a cool buzz word which was used to justify the upgrade, but nobody was using it yet in their projects. I went all around the internet and back- and the winner in instructions, came from a blog post by Sophie Benedetto.

Figaro Gem :
Nice to learn different options to hide environment variables. Did not need to finally use figaro, since GIPHFY API keys are public anyway.

Facebook SDK for Login :
Why build out your own authentication when you got JavaScript SDKs? Seriously why. Later, user authentication was implemented. Interesting to learn about different authentication options like bcrypt, devise, oAuth.

Design & Performance :
Implemented Design Patterns like Service objects & Jobs, improved performance via caching. Writing RSPEC tests were also fun.

Challenges & Gotchas

-> Designing the database surprisingly took more time than anticipated. We had to revisit the drawing board at least thrice.

-> Figuring out controller actions and fitting Rails MVC pattern & following RESTful conventions for real-time gameplay was pretty tough for me to wrap my head around. Robin Tully wrote a good piece about it.

-> Deploying to Heroku, interesting conflicts and the deal with reading log errors via 12-factor.

Lessons
  • Working with teams. Good communications is key. Balancing different styles, and different learning stages. When to atomize tasks vs. pair-program. Asking for work and taking work in a non-hierarchical structure. Don't: Go crying into Battery Park bawling at your ineptitude. Do: ASK FOR HELP.

  • The proper pronunciation of the word gif. There is a debate between the mellow good g gif, and the sleazy sounding jiff (which I prefer). Scholars lean on following the personal preference of the creator. Although the full form for the acronym GIF is Graphical Inter-something F. So go figure.

  • Rails MVC style not very intuitive for games, especially ones with realtime interactivity.

  • When dealing with Git workflow. Don't be eager to --force. (Austin powers image of working on master)

Enjoyed:

  • Working on a four person team with different styles under a tight deadline;
  • ActionCable. And getting introduced to web sockets in general;
  • Learning about the cool things you can make with jQuery, and how CoffeeScript can be useful.
  • Writing RSPEC tests at the unit and controller level. I surprisingly enjoyed this.
Future Features
  • Ability to upload your own hand of gifs.
  • Play rounds based on categories (like cats or Simpson gifs exclusively)
  • I'd like to use Travis for cleaner refactoring, coverage tests.