E46: Meteor Polling App

Let’s do a practice WOD based on another simple Meteor app, this one from the Your first Meteor.js App tutorial.

Prelude

Go through the same basic steps from the E45: Simple ToDos to set up IntelliJ, GitHub, and Meteor correctly:

Now, step through the Your first Meteor.js App tutorial until you get to the “Notes for Production” section. Do all the editing in IntelliJ. Take your time and try to understand the code: don’t just copy-and-paste without thinking!

Once you have finished the tutorial up to “Notes for Production”, you are ready for the practice WOD!

The WOD

Ready? Let’s begin:

  1. Start your timer.

  2. Create a branch called “security-1”.

  3. The Notes for Production section starts by saying that production apps should not make all data public, and to prevent this, you should remove the “insecure” package. Go ahead and do that now.

  4. Verify that the app no longer works. Define the Meteor methods and invoke them in order to restore your app to working order. You may want to consult the Meteor tutorial: Security with methods for example code.

  5. Now remove the “autopublish” package from your app.

  6. Verify that the app no longer works. Use the Meteor.publish() and Meteor.subscribe() methods to restore your app to working order. You may want to consult the Meteor tutorial: Filtering data with publish and subscribe for example code.

  7. Commit your branch to GitHub.

Rx: < 15 min Av: 15-18 min Sd: 18-20 min DNF: 20+ min

Demonstration

Once you’ve finished trying the WOD for the first time, watch me do it:

Standard WOD Caveats

You’ll learn significantly less from watching me solve the WOD if you haven’t attempted the WOD yourself first.

While it’s an achievement to finish the WOD no matter how long it takes, you might experience “diminishing returns” if you work longer than the DNF time. Thus, it is usually strategic to stop working at the DNF time and watch my solution.

After watching my solution, I recommend that you repeat the WOD if you have not achieved at least Av performance. If so, be sure to:

Feel free to keep trying until you make Rx if that’s of interest to you.

Submission instructions

To be completed by the time and date indicated on the Schedule page.