Hosted Project Success!

As Hack Reactant, there comes a time when you get the chance to do something amazing. During the long project period, Reactants are offered the opportunity to apprentice at a local tech company, where they spend 3 weeks pushing critical, live code.

As someone with little professional experience, I jumped at the chance to work for a local devshop-for-hire, Monsoon. At Monsoon, agility is a necessity, and shipping quality code is the only thing that truly matters. I wanted to get a taste of that lifestyle before taking the plunge into the professional tech scene.

The project we built was relatively simple. It's little more than an API backend that supports a mobile application, which in turn supports the sales team of an international corporation.

It was interesting because we needed to quickly build a moderately scalable data collection and transfer platform. In order to do this, we used Keystone.js, which is a CMS wrapper built on top of Mongoose/MongoDB and express server.

Fortunately, Monsoon gave my team two mentors/guides. We were put directly under the wing of John, an HR #2 Alum, and linked with Bill, the product manager for the entire application. With their help, we were able to make a set of API's which were secure, easy to consume, and easy to extend or replace should the client's needs change drastically in the future.

In all, we built a users service, a survey survice, a lottery service (app users win prizes), and an abstract data-collection service. Each of these services is a discrete endpoint, and they work together to support the mobile app.

I was in charge of collecting user metrics, and to a lesser extent, surveys. Basically, I wrote abstractions between the application, which wanted JSON, and the database layer. I also made it possible to download the contents of the database as CSV. You can download only last month's CSV, or last year's.

I learned a lot about throwing away work. I spent several days attempting to integrate our application with a 3rd party survey API. Unfortunately, it became clear that the API was more for static consumption of information and useless as a programming interface. So I threw away several days of work and convinced my team to roll our own survey solution halfway through.

I grew a lot during this project. I learned how to communicate effectively in a team situation, and how to mitigate blocking factors. More than anything, I learned how to survive and thrive in a pseudo-agile environment, complete with code reviews and standups.

If I were to do this project again, I would expose Mongoose and generally ignore Keystone's List abstraction. Keystone gets in the way when you don't need an admin interface. For example, my user metrics are stored as Keystone lists, and are therefore visible within the admin interface. Therefore, a rogue admin could tamper with the user metrics data. Instead of working around Keystone to protect these routes, I should have simply skipped using Keystone and used Mongoose directly. Unfortunately, by the time this became apparent, it was too late to do that refactor.

As a final note, working around Keystone reminded of my days working with Python and Django. Keystone is just a little bit too ready to be 'magic,' without letting me, the developer, know where the complexity is hidden. Luckily, Keystone's source is quite small and well maintained, which made it easy to understand how to rip out huge chunks of it when they stopped being helpful. This is the opposite of my experience with Django, which tries and fails to have a modular architecture (although SQLAlchemy is a good ORM swap). Django wants to be your monolithic, full-stack solution, which I'm thoroughly opposed to.

I truly enjoy the batteries NOT included philosophy of Node.js, and the rapid iteration and acceleration of the community that then happens. Keystone is built on top of Mongoose, Jade, and Express. Express is built on top of Connect and several other utility libraries. When Keystone's abstractions got in the way, there was a clear path around them.

What's more, this strategy of many, small tools makes development way faster. None of these libraries takes much effort to learn. None of them is overwhelming in depth and complexity. But when you wire them together (which is relatively straightforward because of their well-defined interfaces), you end up with an amazingly lean, agile, and efficient technology stack.

In these ways, and in a few others, Node.js falls perfectly into the UNIX way of doing things. Node is a great, small, precise, fast tool for doing a very specific kind of job. And it doesn't claim to be anything more than that.