Tuesday, April 17, 2012

StartupWeekend with jQuery Mobile, Node.js and MongoDB

I recently participated in the Triangle Startup Weekend, one of many happening around the globe on April 13th -15th as part of the overall StartupWeekend.org.   An organization whose goal is to spark entrepreneurship and what follows is my personal experience.  Bottom line: everybody with passion & energy should give this a try.   It was a great (and exhausting) experience.

This is an insane event where a team of strangers has to meet on Friday, where someone has the spark of an idea, organizes instantly and attempts to build a business plan, a go to market strategy and an initial MVP - minimum viable product by Sunday before lunch.  The majority of the initial ideas involve some form of web or mobile product and that is what interested a technologist like myself.  There were hundreds of people at the event, over 50 "founders" with initial ideas who had 60 seconds to pitch to the overall crowd.  The audience voted on those ideas - narrowing them down to a top 20.  Those idea generating founders were then told, form your team, get to work - final presentations are due on Sunday by noon - the chaos begins!

There is not even time to learn your teammates last names and you end up remembering folks as "marketing guy", "design girl" or "kid coder".

I have always been a big believer in that you need to be moving to be learning. And when your time to market as been reduced to a few hours then getting up to pace is critical - get your product to market instantly.

We formed "Team Truxie" on Friday night, with the initial team meeting around 10pm when we had made grabbed space in a NCSU classroom.  The team founders (guys with the idea) attracted a great team - a group that covered business leadership, marketing talent, design and development.   We had about 10 minutes to discuss the business problem that we were trying to solve and about 20 minutes to figure out who had what skills.

That was when one of our founders (Ed) dropped the bomb on us - we needed our product to be in production by 6pm on Saturday, forget noon on Sunday, we had less than 16 hours to build a working mobile application that we would put in front of all the other competitors.  And this was one of the secrets to our success - MVP - that minimum viable product - where you can get a very clear understanding of who your potential customers are and what those customers are willing to pay for.    Luckily for me, I had spent many hours in the book just a few months ago and it still sits beside my bed - The Lean Startup by Eric Ries.  If you are a professional software developer with an interest in business, this book will appeal to you.   My interpretation of the Lean Startup is that the most important goal is learning, product & business model experimentation that drives learning and that you need to iterate rapidly.

A great example from Lean Startup, did you know that you needed DropBox before you saw it?  Well, how do you put your product in front of people who must SEE it to GET it?  The demonstration is the best explanation - that creates the best feedback.

On Saturday evening at 6pm, we had the opportunity to turn all of our competitors into potential customers - the (Ed & Rob) business idea was to automate food trucks - basically mobile restaurants.   And one was arriving at the Triangle Startup Weekend event to feed the contestants that Saturday.

To that end, our founders also saw this as a learning opportunity and other members of the newly founded team understood that Startup Weekend is a competition.  The team immediately coalesced around that basic truth - Startup Weekend is a competition, it has rules that are described in a book that defines MVPs, pivots and validation (validated learning), everything most be honed for the 5 minute final presentation.

With this understanding, the team split into two groups - the business folks focused on the business plan, who are the customers, what are their major pain points, pricing models, marketing strategy, scalability, defensibility etc.  This is a critical element of Startup Weekend - can your team identify potential customers and put your idea and your product in front of them?

Ed (founder numero uno), as a programmer himself, had the idea that we should learn some new technology - he had initially started prototyping with JQuery Mobile (+Phonegap) with a Node.js + Express + MongoDB backend before the event and he already had worked out a contract with Rackspace for hosting our application.  Now this was the real trick, the developers joined up because that sounded like cool tech to work with - but no one on the team had used jQuery Mobile nor Node.js in production before - it would be fun, right?  :-) At best, a couple of us had worked through a tutorial or two.  For myself, I had just built a simple demo application using JQuery Mobile to talk to a JAX-RS endpoint hosted on JBoss the week before.  That demo application became the proof-point that illustrated something could be done quickly.  Besides, I had been preaching HTML5 style application development for some time now and it was an opportunity to put my thoughts to the test.

The pressure cooker - we had to build an app, deploy it and put it in front of...our fellow Startup Weekend participants in a few hours.   It is hard to describe how challenging it is to meet your fellow developers for the very first time, understand the business problem, identify the key priorities, consider the architecture, setup people's workstations for sharing files, split up tasks, etc.   And every possible corner than can get cut does - because the goal is the MVP - the barest minimum that impresses your audience, establishes the vision of the product and for the features it implements, it just works.  We could have attempted this with "paper prototypes" or simple mock-ups but for one of the key elements of the overall competition - how fast and how well can the team "gel".   And in our case, the core development team (Chris, Corey, Andrew and myself) came together fast.  I have never met any of those guys before that Friday night.  And by mid-afternoon Saturday, I can honestly say that that team could build most any web-based (or mobile web-focused) application needed by most businesses.   A startup's dream - an engineering team that can learn new technology and can crank out value immediately.

Granted, many of you reading this blog may have more than a couple of hours of experience with JQuery Mobile & Node.js - but our team did not have that level of experience - two of us were Java EE guys, another a Objective-C/C++ desktop developer and another having worked on Java applications that integrated with Google Earth.

jQuery and jQuery Mobile are incredibly simple to learn if you have a basic understanding of HTML and JavaScript.  Moving JSON back and forth between a RESTful endpoint is very easy.   This makes prototyping the front-end go incredibly fast.  There are plenty of gotchas or "aha" moments associated with having multiple pages in a single HTML file and dynamically rendered elements that also have their own event listeners that caused some initial bewilderment - especially by a Java EE guy like me, who has mostly lived on "the server side".

In addition, we were working in the same room as the business strategy folks who were filling up the walls with notes, conducting online surveys, debating the pricing model, discussing market dynamics - and discussing these items with outside observers and mentors - there was a constant parade of people coming into the room to chat with us.  

Another interesting aspect of this adventure was using MongoDB, most of us had worked with a RDBMS before, so you make some early mistakes - especially when you have a crazy deadline and you just met your fellow adventurers a few hours before.  While Node.js + Express + Mongo makes it very easy to retrieve data and throw that JSON out to a jQuery client application (using $.getJSON) and it is also easy to receive a POST with a JSON payload to be persisted - it is NOT a RDBMS - do not normalize the data model.  We made that initial mistake - and when we had to write our first report - we realized that there was no simple join to get the data back out again.  Luckily, Chris (strong code-fu) was able to show off his python skills to rip through the data to produce the report we needed.


Remember, the key thing is validation (and learning), we put our application out in front of a live audience.  Taking all the orders for the food truck that specific evening, asking all parties what they thought of the idea.  And of course we had to interview the food truck operator.



This story might terrify you - and it certainly caused me to lose a fair bit of sleep over the weekend - but I have had crazier projects in the past as a consultant.   For those of you who have worked with small businesses or simply been in the consulting game - you get the assignment of "you are now an expert in technology X, show up at the customer site this coming Monday, you get the whole weekend to prepare".  Or better still, the small business owner that has contracted you to build him a new custom application, who does not understand things like what an "alpha" test is and the next thing you know...you are taking millions of dollars in real transactions on a piece of code that you were not able to test and was not completed.  Performing surgery on the live system on the production server - yep, I have done that.

Now, I have purposely been somewhat vague about the overall idea and the details of the architecture.  That is because the Truxie founders will likely wish to pursue this opportunity further.  And while my day job is focused on open source - I consider the code we prototyped to be Truxie's IP, not something I can publish to the world at large.   With that said, I am working on a tutorial that uses jQuery Mobile with a Java EE 6 backend - JAX-RS & JPA to target a RDBMS.  One of the coolest things about a jQuery front-end is that it is completely portable - build the backend in anything you like.

I did manage to make a demo video of the application, navigating the application with my lefthand while filming with right hand - that was a trick all by itself.   Yes, I removed the sound - but I should have left it in, you could have experienced all the discussion and chaos going on around me.



Myself and my JBoss by Red Hat teammates will be publishing some additional tutorials that show off how to use JBoss as your backend and jQuery + Backbone.js + Underscore.js as your frontend over the next few weeks.  Keep an eye on www.jboss.org/developer for updates.

And I plan to continue experimenting with Node.js + Express + MongoDB.  But that will have to wait a bit longer, my son wishes to learn more about iOS game development.   So I installed XCode and will start digging into Cocos2D tonight - keeps you young. :-)

Perhaps next year's Triangle Startup Weekend will have a father + son team competing.  Plus, my wife is an amazing marketer - we almost have a complete team - just need the idea person!

2 comments:

  1. Having your "picture in the paper" does not quite mean the same as it did 30 years ago, but it is still fun to see it happen - article

    Fearless leaders Ed & Rob in the center - standing.

    ReplyDelete
  2. More news on Triangle Startup Weekend #TSW2012 newsobserver.com

    ReplyDelete