Thursday, 7 March 2013

Bootstrap a Startup in a Week–Days 2 and 3: A Walking Skeleton

Rob Ashton and I are engaged in a challenge to build a minimal viable product for my start-up TruthVine in a week. We kicked off on Monday. This is how Tuesday and Wednesday panned out.

I’m surfacing briefly from the code-face this morning to announce that our efforts have met in the middle. My desktop sermon-recording client is now encoding and uploading sermons to Rob’s web application.

Having spent Monday working on the Administrator user interface, where churches will upload and manage sermons, Rob turned his attention on Tuesday and Wednesday to the public facing website which will supply the smarts to allow churches to easily embed a rich sermon browsing experience in their existing websites.

Single Page Application without client side templating

The brief I set Rob had three parts:

  1. A church must be able to add the sermon display to their website just by pasting a snippet of html/javascript code onto a page of their website
  2. Individual areas of the sermon browsing experience should have unique urls to make them easy to share
  3. If possible, the whole thing should be SEO friendly

We can now tick off points 1 and 2, and we’re running some experiments with Google to see if we have accomplished 3.

Rob has come up with an elegant solution whereby our small snippet of code loads a small truthvine.js file which brings the whole experience to the page. The javascript inspects the url of the page where it is embedded, and reads the part after the hash bang (ie ‘#!’). It interprets that as a url and requests it from the TruthVine server, which returns a JSONP result containing some html. For example, in the url http://mychurch.com/sermons/#!/sermons/view/33, the part after the hash bang is /sermons/view/33 , and that url is requested from the server. The javascript on the page appends the html fragment from the JSONP request to a <div/> which is part of the snippet.

The best part of this is that there’s no client side templating involved. We can render everything using Razor views on the server side, including all the links between different parts of the experience.

Immutable collections and audio editing

Meanwhile, on my side of the tunnel, work on the desktop recording client has been going forward steadily. It can now play back the audio that it has recorded, and encode it to AAC format. More importantly, it can post sermons to the website.

I spent a large part of yesterday laying the groundwork for being able to trim a recording. This has been very interesting work, not least because I’ve been able to try out the new Immutable collections that the BCL team have created.

The approach I’m taking is to write all the raw audio samples to a memory-mapped file which I’m treating as append-only. I then keep a list of segments – pointers to the start and end of sections in the original recording which will be included in the output. The idea is that it is this list of segments which will change during the editing process rather than manipulating the raw audio. By using immutable data structures it becomes much easier to do work on different threads. It should also make it almost trivial to implement undo-redo, because undoing an operation just requires us to reinstate the previous version of the segments list. Remind me to share the code with you sometime!

Deployment

Yesterday evening we deployed our code to the web for the first time – “the moment of truthvine”, as Rob called it. I was impressed by how painless deployments are using Microsoft’s Web Deploy. Having installed Web Deploy on the server, you can simply create a new website in IIS, then choose the “Deploy –> Configure Web Deploy Publishing…” from the context menu. This creates a publishing profile that you then import into Visual Studio. Then every time you have fresh bits for the server you just select “Build –> Publish Selection” in Visual Studio and – hey presto! – there it is for all the world to see.

There was one point in the deployment where I thought I was going mad. Having successfully deployed the admin website, I tried deploying the public facing website, only to discover IIS wouldn’t serve .js files from the root of the application – it was returning Http 404 errors instead. I checked folder permissions, checked that the Static Content module was installed – nothing doing. I was saved by the old trick: I deleted the site and started again, and everything was fine!

With our skeleton now on his feet, we have two days left on the clock to put some flesh on his bones and make sure he doesn’t wobble over. Stay tuned!

Monday, 4 March 2013

Bootstrap a Startup in a Week: Day 1

Hurricane Rob (aka Rob Ashton) is the mildest-mannered whirlwind one could ever hope to meet, and he passed through my office today leaving in his wake a wonderful trail of construction. It was Day 1 of my “Build a Startup in a Week” challenge, and Rob arrived at my house (we’re working from my garden office) bright and early, eager to re-caffinate. Whilst he patched up his scarcely-used Windows laptop with Asp.Net MVC 4 (am I the only Windows developer still actually using a PC and not a Macbook Air?) we talked tactics.

There are three major components for my sermon sharing service that I want to get built this week. One is the administration website, where churches will upload and manage sermons. Second is the public-facing website which will embed sermon listings in churches websites. And third is “The Studio” – a super-easy-to-use desktop application for recording, editing and uploading sermons.

Since Rob’s strength lies in web development and my expertise is centred on desktop applications, a natural division of labour emerged. So whilst Rob got started on the web stuff, I cracked open Visual Studio and created a fresh WPF project.

Some of the ground work for our weeks work, I laid last week.

Ground Work

After much toing and froing I’ve settled on Amazon to host the services, and in particular, Amazon EC2 for the servers. I considered AppHarbour, and Azure Websites, with their promises of painless deployments, but in the end I decided I’d trade off a little extra work on deployment in return for complete control of the stack.

Wherever you turn, Amazon seem to have you covered. The TruthVine landing page is currently hosted as a static website on Amazon S3, and we’ll be using S3 for sermon storage too. The truthvine.com domain is pointed at Amazon’s Route 53 DNS service. We’ll be using SES for sending notification emails. If only Amazon Flexible Payments service worked in the UK, I’d be use that in a shot.

For hosting our source code and managing issues, I’ve settled on BitBucket, with a Git repo. Whilst I prefer Mercurial from an ease-of-use perspective, and would have loved to use Fogcreek’s Kiln, it seems Git has become the lingua franca for DVCS, particularly after Microsoft announced they were adopting it for TFS. Why BitBucket rather than GitHub? Because I think their pricing model makes more sense. GitHub charges per repository, whereas BitBucket charge per user. I can see our repository count growing over time, whereas the number of developers I’m likely to involve in my projects is going to remain small.

The last thing to get sorted before Rob’s arrival was a UI theme for Admin pages. We’re going to be using Twitter Bootstrap to make the UI a little easier to develop. I found a wonderful site called WrapBootstrap which sells themes built on Twitter Bootstrap, all for very reasonable prices. From that, I’ve picked the Optimus Dashboard theme, which not only looks the part, but is responsive, so it resizes to accommodate tablets and smartphones.

Progress Report

So how did we get on today?

Rob made a sterling effort. Starting with some code I’d written for our church website (which he seemed to like) he got a good chunk of the admin website done today – login, sermon management, and series management.

My efforts were a bit more lacklustre. They amounted to this:

TruthVine Studio

I did make a few useful discoveries though. A while back, I found the NAudio library, which does a lot of the grunt work when working with Audio in .Net. Today I discovered that they’ve added code to handle AAC encoding using the encoder built into Windows as of Windows 7. I was thinking I’d need to spend a day or translating C++ samples into C# interop to get that working.

All in all, a profitable day. Hopefully a sign of a good week to come.

Saturday, 2 March 2013

Introducing TruthVine

This Monday morning, the metaphorical starting gun will fire, and Rob and I will be off on our one-week startup challenge. We aim to have a minimum viable product up and hosting at least one customer in 5 days. So what is it we’re building?

Allow me to introduce TruthVine – “the easiest way to share sermons online”. The theory I’m testing with the launch of this product is that there are many churches who would love to put their sermons online, but simply don’t know where to start. There are already sites like SermonAudio.com or SermonCloud.com, but my research suggests that there is room in the market for a service which makes the whole process so simple that no IT know-how is required.

With TruthVine I aim to streamline the whole process of recording, publishing, and engaging with sermons. Engagement is a major part of my vision for the future. As a wise man once said, “a sermon is not over until it is lived”, and God-willing, I want to build TruthVine into a tool which helps Christians keep the preached Word of God at the front of their minds so they can live it.

That’s the lofty goal. But every journey begins with a first step, and on Monday we take ours.

Check out the landing page, sign up for the newsletter, and follow along with our hackathon next week.

Saturday, 23 February 2013

My one week Start-up challenge

Regular readers of this blog know that I relish a challenge. Two years back the task was to conjure up a mobile app in 3 days. This time, I’m aiming to launch a start-up in 1 week.

At the beginning of December Rob Ashton posted a startling entry to his blog. “I’m not looking for a job” was the title, and 1-2 weeks of his expertise in exchange for just expenses and a roof over his head was his offer. It was exactly the catalyst I needed.

I suspect many software developers suffer from the affliction I’ve experienced ever since going freelance: the urge to launch some new product. We developers love making things, and seeing people get value out of them. And we freelancers would love to be free of the tyranny of the clock – earning exactly in accordance with the time we can bill for.

About the middle of last year I settled on the niche I wanted to target, and the product I wanted to build. Ever since then I’ve been waiting for everything to fall into place so that I could get started. Of course, things never happen like that. There’s always just one more paying project that crops up first, one more thing to get out of the way before you get going.

So when Rob’s offer came along, I seized it. I knew that if I committed myself, things would start moving. I emailed Rob the day after he posted his offer, and arranged to host him for a week. With a deadline settled, and other parties involved, things have started to fall into place. My product now has a name, it has a graphic designer working on a logo, and it has a landing page which illustrates why I should not be left in charge of graphic design (or copywriting too, come to that).

And by the end of the first week of March, with Rob’s help, I aim to have a minimum-viable-product coded and in the hands of beta testers.

Follow along here, and on Rob’s blog, and we’ll let you know how it goes.

Next up: what is we’re building?