This week, let's create a start-up - Day 1

Published on 2013-3-13

This post was written on Monday

I've finished my first day of the build a start-up in a week challenge, and now I know a little more about the project.

Okay, so what the heck are sermons and what's the deal about getting them online

Not that complicated, and my first suggestion is

Can't we just use Wordpress/Drupal/Etc and have this done in a few hours?

If I was building an MVP, that's pretty much what I'd do, but Sam is pretty insistent that he wants it done in .NET (long time no see) and RavenDB (I was doing this last week!), so I guess I need to get out my Windows laptop and once more work my way around the perils of .NET and ASP.NET MVC)

Why ASP.NET MVC? Because I actually remember quite a lot of it from the last time I did .NET and I'm not going to waste time trying to learn another .NET web framework when I have to start building stuff now - when building something with such a short time-frame, you should be using something you know to make the most of the time.

Anyway, after trying to create a few "empty sites" in Visual Studio, I finally find a configuration that is "emptier" than the other ones and get to work (this is still confusing Microsoft!)

Turns out it's not only "mediocre" these days, but I'm actually able to get most of the basic CRUD operations and workflow done in a few hours, highlights of this experience being:

The default model binding seems to work out of the box for everything, and RavenDB is being managed via global action filters so I only have to do

this.Documents()

In any controller to get the document session (yay for extension methods), no I'm not bothering wiring up a container, the only objects in play are the input/view models and RavenDB and the state model that is being persisted in it, and it's unlikely to get much more complicated than that (so end-to-end tests will suffice with an in-memory RavenDB for now)

I even wrote a little bit of magic to do paging in a standard way across any view that needs them in RavenDB

pagedResults = session.Query<Whatever>()
       .Where(x=> SomeCondition(x))
       .PerformPaging(inputModel)

Yay again for extension methods.

I also set up OAuth - I used DotNetOpenAuth, which worked once I'd written a pile of code in a controller action - it's much better than the previous incarnations I used last time I did .NET, but it's still not quite as good as say, passport in NodeJS (and I'll hazard a guess it doesn't quite meet the standards of whatever RoR provides for this either).

I guess that's because with node, we usually have control over the entry point and everything can be done with connect middleware in a standardised fashion, whereas ASP.NET MVC is an opinionated framework which doesn't know what its opinions are and still suffers from a sad-mix of xml configuration and confusion, still - I guess once you know about this stuff you can copy and paste these bits of infrastructure around so it's not too awful.

Anyway, today I achieved with ASP.NET MVC and RavenDB

Tomorrow I'll hook up the script to embed content in third party websites, and get the MVP finished - that'll leave three days to do all the value-adds, I'm fairly happy with this progress and feel that this is still how we build software, even if it's not in the technology I'd have chosen.

2020 © Rob Ashton. ALL Rights Reserved.