The Brave New World of Static Sites
Once upon a time, if we wanted to do anything actually functional with a website, we needed a backend to it and if we wanted a client to manage their own content, we needed a Content Management System (CMS); oftentimes, we’d do a little (or a lot) of both.
Static sites have come a long way. The benefits are clear: they’re faster to build, easier to work on, and they are exponentially faster than their cousins. When they first came out, the content management and the functionality aspect were issues; but it’s a whole new world now though.
Starting with CMSs: Traditional content management systems are like a marriage. You better love them, because you’re stuck with them for the foreseeable future. Want to move from Wordpress to Drupal, you’d better have a good bottle of whiskey in the cupboard; want to shift from PHP to Ruby, or Ruby to Node, or Node to Go, good luck with that. It’s possible, sure. I’ve done it, several times. But it’s not pretty, it’s not cheap, and every time I did it I swore I never would again.
Enter Contentful (or Prismic). The premise here is that all your content lives in one place, and you pull it into various tools as you need it. iOS app, sure; Android, fine; your Ruby site, peachy; decide that you are sick of wearing the tight T-shirt and beard and are switching that site to Node, awesome — content doesn’t move, you just pull your content in differently. And pulling your content in is quite easy. And static site generators are super easy (at least with Contentful).
Ok, now you want a shopping cart. There are some good options (but not great ones) out there. You can do a lot with options such as Snipcart married to Stripe, but if you want a variable price (like a donation), you’re going to have to go a different route. Wufoo works, but it’s ugly and skinning it is zero fun. I decided that Stripe Checkout (with some modification) was my best bet here, but it requires some backend for the token which you can do on AWS. Essentially, this gives you a full fledged backend environment without the drama of actually having to have one. So, you can work with your Stripe tokens in Ruby, Node, whatever your flavor of the month is. You can store the data, access it, write a user login, whatever.
I generally do static sites married to various services, but a backend isn’t always bad—if you have the devs on staff, it can be awesome. And sometimes you really need one. This is the rub though, a lot of clients can’t afford a backend developer on staff, and what happens when Heroku is doing some updates and you need to change stuff, or you want to add a small feature, or something goes wrong? It’s not cheap to begin with, but don’t forget that your backend dev doesn’t see that code all the time, so she is going to have play Sherlock before she even starts.
So, perfect? No. Getting really good? Yes. Fun to work on? Yes. Cheaper for the client? Absolutely.
This is the stack I’m using right now:
What’s important to note is that the stack is very modular, you can absolutely mix and match your own preferences into it. Don’t like Ruby, switch out Middleman for Roots.cx. What’s great about modern web development is that there are lots of really good options.