Developer diary recommences
Earlier this year I blogged a lot about a web app project I was working on that used mostly Ruby stack: Padrino (sinatra + stuff) on top of Riak + Redis for persistence + ElasticSearch for search + Davis.js + my own Backbone-ish model with ajax persistence. I reached a point where I had just implemented some markdown extensions in my javascript preview library & realized that I’d have to re-implement them in Ruby. At that moment I stopped and pondered the virtues of the single-language stack.
And then I got a job in San Francisco. That plus commuting has been hell on personal projects. I resurrected it recently, though, because I discovered a massive itch that needed scratching that was similar to (but not identical to!) the previous project. Thus Project Two, Electric Boogaloo was born.
The stack isn’t quite the same:
javascript + node.js
couchdb for document persistence via cradle (this project is much more document-centric than the other one; this could easily be swapped out for riak if necessary)
redis for fast indexes (am using couch views as little as possible, since all the operational stories discuss their suckage)
redback for some higher-level data structures built on redis
my own model schema + persistence layer (actually separate!)
express.js for serving web pages
blade for templating
ElasticSearch for full-text search via my own very thin wrapper
and a few smaller packages, like my fork of marked for github-flavored markdown, prettydate so javascript can have strftime() like a civilized language, and so on.
I also finally broke down and started using the async flow control library. If there’s anything I hate, it’s boilerplate. And node.js callback error-handling is boilerplate at its repetitive code-cluttering worst.
I haven’t done anything on the client-side that needs a single-page app just yet. But if I do, I’ll use davis.js again, again with my own non-backbone model library. Backbone made me write reams of boilerplate. You know what I think about that.
Javascript is such a dangerous and loose language that I’ve been trying to maintain some strict discipline with myself about the code. Not just formatting (which I’ve always had strong opinions about) and not just running linters. I’m trying to stay modular with small files and small pieces that work together and aren’t interdependent. Any single piece should be something I could swap out.
This week I’ve been wiring up ElasticSearch. My next programming session should have documents being indexed on their way into the system. The one after that will start implementing a search API that is intended to be consumed by two kinds of web pages (a general “search stuff” text box that tries to guess what you mean, and a tweaky search form, the kind with a zillion checkboxes) plus the externally-focused json api I’m planning. I’ve been trying to write design documents for myself as I go on this project. Not just for myself! My plan is to open it up as soon as I have a site running with alpha-level features.
As always, it was raving frustration with a really-badly-written and -performing existing site that motivated me to start this one. Niche audience, though. No idea how I’m going to make it self-sustaining given the user base. Yes, I haven’t told you what it is yet.


Find me on
hJZTQMSP