Chris Saylor Lead Engineer Stephen Young Senior Engineer @cjsaylor @young_steveo 185 countries 14 million weekly class participants 15 million monthly pageviews ~30 million monthly service requests Zumba Fitness @zumbatech
Why did we build this? We wanted to build something that would be fun for developers to hack on at our booth. We wanted to build a tool that can help teach javascript. We wanted to experiment with real-time applications.
Overview Two servers (Heroku dynos) Client server for hosting game assets and interface Game server for hosting game logic and leaderboard MongoDB - Sessions and Game results Redis - Multi-server socket.io pubsub
Using allows easy scaling, configuration changes, and viewing logs from the command line. Uses for deployments. HTTPS supported for free for the h e r o k u a p p domain. In general, your app configurations should be using environment variables: p r o c e s s . e n v . S O M E V A R Gotcha: Heroku dynamically assigns an internal port via the environment variable: P O R T Uses to run your application, hence the requirement for a P r o c f i l e Provides "addons" which are very convenient services that have SSO and create access configurations automatically. Heroku Toolbelt Git Foreman
Design Goals Simple: easy to grok in 5 minutes. Accessible: beginners should be able to play. Challenging: stay interesting & hard to master. Fun: it's a game where you write code, for crying out loud.
Our Process Started with an idea: a Programming Game! Decided from the start to build it in Node.js Collaborated on game design document in Google Drive. Did a lot of brainstorming. a little too much... Threw away ideas that we deemed too complex. Developed game logic using BDD (jasmine tests) Relied on Github issues to track features and bugs
The Prototype steps to play the game 1. checkout the client repository 2. modify the strategy files 3. set environment variables 4. run the game with n p m s t a r t 5. all feedback in the console 6. "visualize" the battle in your head somewhat involved but it was fun!
So, we built a browser client. Node Template Engine & browser based code editor Canvas framework Bootstrap 3.0 jade Sass Compass RequireJS Ace KineticJS howler.js
What Grunt Did for Us Lint our source files with g r u n t - c o n t r i b - j s h i n t Automate Sass build with g r u n t - c o n t r i b - c o m p a s s Quickly run jasmine tests with j a s m i n e - n o d e All in a matter of milliseconds.