Every year, hundreds of teams of talented developers and designers deliberately eschew celebrating athletic feats like (American) football to code for 48 hours straight in the hopes of becoming champions of Node Knockout. NKO is in its 4th year, and just when we think that NodeJS might be jumping the shark, the community comes back and responds with entries that are more polished and robust than ever.

We’re proud to announce the winners of NKO2013 who have toiled to bring you the future of real time technologies on the web to us just a little bit earlier.

Please help us in congratulating these teams, everyone!

And without further ado…. your NKO WINNERS

Overall Team

Rikoru

Realtime multiplayer memory game.

Solo

Imdex

OCR-Indexed image searching engine, making text within images searchable.

Innovation

Tidbit

Embeddable JS that lets you make money mining bitcoins on your clients’ computers.

Design

Zoom the Balloon

Simple addicting game: get to the moon in a balloon.

Utility/Fun

Video Funhouse

Video converter that runs entirely in your browser.

Completeness

Harp Hook

Automatic Harp-based compiler for Github Pages.

Popularity

Hub

GitHub + Chat = :D

It's Alive

Alright, NKO is complete and whether you won or not, you likely have something that is worth building on. We wanted to remind you that you can easily get your NKO idea fully online through our sponsor, POP.co? Here’s what they are giving you:

  • A .CO domain (i.e. www.youridea.co)

  • Google Apps for Business — including immediate setup for your custom email address using above .CO domain (i.e. you@youridea.co)

  • The simplest DNS editor we’ve ever seen, including a one-click activation to link your Joyent account

They are offering a discount to all NKO participants for the equivalent of one month free — and then the service is only $5/mo per GApps user after that. Check it out here, and use the code POPKNOCKOUT5.

If you have questions, hit them up on Twitter @thePOPguys.

With Node Knockout 2013 over now, we wanted to thank all participants that used Auth0. We hope we helped simplify the login process in your apps.

Auth0 takes authentication out of your way. Auth0 allows you to connect with +10 identity providers: Amazon, Google, Facebook, Twitter, LiveID, GitHub, 37Signals, PayPal, LinkedIn, Yandex, Fitbit. It also provides a ready to use username/password store (including signup and forgot password flow). It all works out of the box with just a few lines of code.

Auth0 Login Widget

Quick Start in 3 easy steps:

1. Create a free account in Auth0

2. Add code to your app

Add the following code to your HTML and node app:

BROWSER
SERVER
<button onclick="auth0.show()">Login</button>

<script src="https://d19p4zemcycm7a.cloudfront.net/w2/auth0-widget-1.2.1.min.js"></script>

<script type="text/javascript">
var auth0 = new Auth0Widget({
  domain:       'YOUR_DOMAIN.auth0.com',
  clientID:     'YOUR_CLIENT_ID',
  callbackURL:  'http://localhost:3000/',
  callbackOnLocationHash: true
});

// parse the response and store the token in a cookie (or local storage)
auth0.parseHash(window.location.hash, function (profile, id_token) {
  $.cookie('profile', profile);
  $.cookie('id_token', id_token);
});
<script>


var jwt = require('express-jwt');

var authenticate = jwt({
  secret: new Buffer('YOUR_CLIENT_SECRET', 'base64')
  audience: 'YOUR_CLIENT_ID'
});

app.configure(function() {
  ...
  // intercept all /api calls and validate the token
  app.use('/api', authenticate);
});

app.post('/api/foo', 
  function(req, res) {
    // req.user will have all the user attributes
    res.send(200);
  });


3. Call your APIs

Once the user is logged in, you can call your APIs sending the token in the Authorization header.

$.ajaxSetup({
  'beforeSend': function(xhr) {
    if ($.cookie('id_token')) {        
      xhr.setRequestHeader('Authorization', 
            'Bearer ' + $.cookie('id_token'));
    }
  }
});

You are done!


Want to use passport.js? We also support passport.js for server side auhtentication. Here is a tutorial docs.auth0.com/nodejs-tutorial.

Don’t want to use the Login Widget? The widget is customizable but if you want to have your own login UI, you can use Auth0’s API instead: github.com/auth0/auth0.js.

By using Auth0 you don’t have to worry about about user management, single sign on, flow user attributes across layers of your app, integrate with social providers and enterprises and see who is using your app.

We are available on our chat room http://chat.auth0.com and Twitter (@authzero) to help you out if you have any issue.

Happy Noding!

Judging has begun for NKO! Our contestants worked hard all weekend and we have some really exciting creations this year. Please login and start voting!

For our contestants, here’s what you need to do if you haven’t already:

Be sure to check out your entry info and update any information here. Record a quick pitch video explaining what you created. When everything is ready, don’t forget to select the submit for judging button here. You can tweak if needed after you’ve submitted.

Thanks to everyone who participated in this year’s Node Knockout!

This post is sponsored by Rollbar, a Node Knockout 2013 service sponsor.

Rollbar is an error monitoring and analytics service that has plugins for a wide variety of languages and frameworks including Node.js, client-side Javascript, Rails, Django, PHP, and others. Thousands of developers use Rollbar to find errors in their apps and fix them faster.

Let’s create a simple server with some bugs to get started.

Installation

npm install rollbar
npm install express

Read More

The competition has started. We can’t wait to see what our ~400 teams are able to create this weekend.

We also have an amazing group of volunteers that have offered to help teams during the 48 hours of hackathon!

Give a big cheers to them and make sure you send them some <3.

If you feel that you need some support, don’t hesitate to ask, for that you can send an email to help@nodeknockout.com, or join us at our IRC Channel on Freenode, the #nodeknockout.

You can count on NKO Volunteers to: help you, answer your questions, give you hints about any problems you might be facing while testing your app, give you a tip on which could be the best approach and more.

Tokbox live chat rooms

Wait, there is more! Thanks to Tokbox, besides our IRC channel (#nodeknockout) and support mailing list (help@nodeknockout.com), we have video conferencing chat rooms, so you can discuss face to face with our volunteers your problems, using all the opentok and WebRTC goodness.

You can browse through the currently active video chats anytime at live.nodeknockout.com

This post is sponsored by Joyent, a Node Knockout 2013 Platinum sponsor.

Along with your team’s ubuntu instance, Joyent is also offering up to $130 worth* of access to Manta. If you haven’t heard of Manta yet, it’s Joyent’s object store with built in map/reduce. In other words “upload your data, then crunch on it in-place”.

Some examples of how you can use Manta:

  • Upload your server logs, do some clickstream analysis.
  • Upload photos, resize them “in place”.
  • Upload db dumps, do some data analytics, produce some graphs.

Did I mention that you can run almost anything in compute? All your favorite unix tools are already there (grep, sort, uniq, awk, etc) as well as popular scripting engines (ruby, python, etc.). Oh, and node of course!

This post will help get you started with Manta.

Read More

This post is sponsored by Twilio, a Node Knockout 2013 service sponsor.

The Node Knockout is nigh! As you make last minute preparations for your weekend masterpiece, you may be planning Android, iOS, and browser-based UI for your application. But there’s another client platform that’s even more ubiquitous - that’s the telephone, particularly mobile phones. If you’d like to create experiences for all these devices, Twilio can help you get it done.

In this tutorial, we’ll explore how to use the Twilio module for node.js to make and receive phone calls and text messages. This is slightly adapted from a series of introductory blog posts on the Twilio module, which are worth checking out as well if you’re interested!

Getting Started

In order to use the Twilio API, you will first need to sign up for a free account. If you sign up with the promo code NKO2013, you will receive an additional $30 USD of credit :) Once you sign up for a Twilio account, you’ll need to purchase a phone number before you can start making calls or sending texts. You should have purchased a number in the getting started flow, but if not, you can purchase one in your account portal. Click on one of your phone numbers, and let’s get hacking!

Receiving a Phone Call

When Twilio receives an incoming call or text message to your phone number, we will send your web app an HTTP request to ask how we should respond to the call or message. The way you will tell Twilio how to reply to a text or call is by responding to Twilio’s HTTP request using a set of roughly a dozen XML tags called TwiML.

Let’s write a little Express app that serves TwiML in response to a POST request to /inbound. Create a file called app.js. Don’t forget to npm install express first! Place the following code in app.js:

var express = require('express');

var app = express();
app.use(express.urlencoded());

app.post('/inbound', function(request, response) {
    response.type('text/xml');
    response.send('<Response><Say>Hello there! Thanks for calling.</Say></Response>');
});

app.listen(3000);

Run node app.js to start your web app on port 3000.

Next, we’ll need to get this app on the internet so Twilio can send a request to it. One quick and easy way to do that is using ngrok. This will forward a local port on your laptop to the public internet. This is super useful for testing local webhooks like this one.

Once you download ngrok, run the command ngrok 3000. This will create a new, public URL for your local machine. Take that url and configure your Twilio number with this URL, with /inbound appended:

phone number config

Now, give your phone number a call! You should hear the Twilio text to speech engine read back a friendly message, as you instructed with the <Say> tag.

Sending a Text Message

Sending an outbound text message or phone call requires that you use the Twilio REST API with your account SID and auth token, which can be found on your account dashboard.

To test sending an outbound message, create a new file called outbound.js. Before editing it, install the Twilio node module with npm install twilio. Now, place the following code in this file, replacing TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN with the values for your account. Alternately, the module will automatically pull in environment variables of the same names and use those to authenticate - but for now, you can just hard code your credentials.

You will also need to replace the to number to be your own mobile phone, and the from number to be your Twilio-controlled phone number:

var client = require('twilio')('TWILIO_ACCOUNT_SID', 'TWILIO_AUTH_TOKEN');

client.sendMessage({
    to:'+16512080532', // the number for the phone in your pocket
    from:'+16518004844', // your Twilio number
    body:'Node Knockout! Woo!' // The body of the text message
}, function(error, message) {
    // This callback is executed when the request completes
    if (error) {
        console.error('Dagnabit.  We couldn\'t send the message');
    } else {
        console.log('Message sent! Message id: '+message.sid);
    }
});

That’s it! Run the code with node outbound.js to send yourself a text message.

More Resources

The Twilio module’s official docs are hosted on GitHub pages. You’ll find extensive documentation there on the features of the module.

If you have any questions or feedback, tweet @kevinwhinnery or send a note to kw at twilio.com. Good luck in the knockout!

This post is sponsored by Concurix, a Node Knockout 2013 service sponsor.

Concurix’s toolset consists of a real time visual profiler that will allow you to take a look at how your application is behaving as well as a debugger. Their snapshot debugger is especially useful. It allows you to debug your program after you’ve run it by taking debuggable snapshots of your code. It’s a nice middle between a core dump and a log file. (More features are on the way too that will help make building applications easier!)

You’re probably ready at this point to get to it.

Check out our documentation section here for the details: http://concurix.com/documentation

If you’re ready to jump in and see what everything looks like, here’s a couple quick tutorial blog posts for setting up Concurix: http://concurix.com/blog/post/61616855194

And for managing projects: http://concurix.com/blog/post/62916900514.

Any other questions or comments? Shoot them an email: support@concurix.com or tweet them: @concurix

This post was written by Chicago Node.js organizer and Groupon Engineer Sean Massa (@endangeredmassa).

Below are my points of advice for anyone participating in Node Knockout. This information comes from mistakes I made in past Node Knockout competitions!

Note that many of these suggestions will apply to new or in-progress projects regardless of hackathons.

Preparation

Know the Rules: These things have rules and it’s very important to know what they are. Read the rules in full. You should also read the instructions about using the Node Knockout repositories and Joyent deployment setup.

Develop Your Idea: We’re getting down to the wire! You should pick your idea as soon as possible and spend time thinking about. You can’t create any digital assets ahead of time, but you should definitely come up with a plan of attack. This can include learning libraries or tools ahead of time.

Know What You Want to Get Out of This: Before Node Knockout even starts, you should know what you hope to get out of it. It could be to win the entire hackathon, win a specific category, to build something just so that it exists, or to have fun. Decide what this is ahead of time and prioritize you efforts towards that goal.

Execution

Use a Project Template: You don’t want to waste time at the start of the event setting up your dev environment. Find a project template that you like, or create your own, and use it! Here are a few starting points: coffeescript-project, expressjs, html5boilerplate.

Deploy First, Then Often: Joyent is providing hosting services for Node Knockout. They will have several people in #nodeknockout on irc.freenode.net, ready to help you! However, you shouldn’t wait until the end of Node Knockout to make sure your deploys work. Sometime shortly after you get your project set up, add a quick response mechanism (like a route for a web server), deploy it, and make sure it can respond properly. If anything goes wrong, hop into that IRC room and provide as much information as possible about your issue!

Git Like Crazy: You must use git for Node Knockout. So, make sure you know how to use it. That means being familiar with commits, branches, merge/rebase, and revert.

Don’t Ignore Architecture: You are never going too fast to skip spending time thinking about the architecture of your features. The short-term focus of hackathons will often lead to many bugs. If you ignore architecture, these issues will be amplified.

Prioritize All Work: For everything that you do, ask yourself if it is the best thing you can do right now to complete your project’s minimum viable product (MVP). Your MVP can shift throughout the event, but each feature you start should be compared against it.

Use Existing Libraries: There are times where you will want to rewrite some functionality because it will be easier “your way”. For hackathons, I urge you to work through whatever trouble you have with the existing solutions and focus on what you should be building.

Don’t Necessarily Ignore TDD: If you normally practice test-driven development (TDD), don’t assume that it has no place in hackathons. Just like normal projects, you should decide where it makes sense for you to TDD and where it doesn’t. The difference here is that the line is in a different place. It’s hard to provide any hard rules here, but you should be mindful of the situation. Make sure your template project has you set up to write tests if you choose to.

Don’t Ignore Meatspace: In hackathons, some people consider skipping meals and sleep, sometimes with the help of caffeine. I am definitely guilty of this in the past. However, it never seems to provide much benefit. You may accomplish some work overnight, but people who do this are often much less capable to help with problems that will arise at the very end of the event. You will know your own body better than me, but you should consider planning for some amount of sleep during the event.

Schedule Distractions: Remove real-time distractions (IM, email, etc.) that can interrupt you during work. You should also take real breaks away from your work to allow your subconscious to continue working on the problem while you take care of some physical need.

Pair Appropriately: Pair programming is incredibly helpful in general. Try to pair often during hackathons. The bug count is already going to be higher than normal. Use that second pair of eyes to help keep it down and keep you focused.

Support Multiple Users: If your app requires multiple users to showcase its core concepts, it can be hard for people to judge it. If you can build even a naive AI or small seed data set, the judges will be able to experience your app properly. You can also schedule times where judges can use your app with the developers (and possibly other users).

Leave Time for Testing: The last couple of hours before the end of a hackathon are always hectic. Schedule at least two hours leading up to the end in order to test, debug, and polish your app. Really, it should be more than two.

App Design

Avoid New Accounts: If you are making an app that requires user accounts in some way, either also allow guest accounts or allow social media account connections. People are lazy. If they have to sign up for an account to look at your app, they might just skip it. Judges are obligated too dig in, but peers and the populace are not.

Ignore Security: Unless it’s a selling point of your app, don’t worry about security concerns. They will likely cost you time without providing demo-able benefit. You can add those features in after the hackathon if you choose to continue your project.

Reflection

Record a Demo: Node Knockout allows you to record a video demo of your app. Do it. Do it immediately after the end of the competition. Make sure that the video shows the best case scenario, skips trivial things like account creation, and is quick, but informative.

Talk About It: Recalling this experience will help you learn from and internalize it. You should do this however you feel comfortable. That can be blogging, discussing the event at a meetup or the IRC room, or just quietly thinking about the experience to yourself.

Core Advice

The tl;dr of it all, inconveniently at the end, is this:

  • take care of your body
  • always have a goal
  • always prioritize work toward that goal

This post was based on a presentation I gave at Chicago Node.js. You can find the original slides here.