The HUMAN stack
- Google published the beta version of Angular 2. Angular 1 is starting to get old and this new version offers all the modern features you can expect from a front-end framework. There are already countless blog posts regarding this point.
- A discussion on Github directely asks the question: “Is Express dying ?” (and later: this article)
Express is now the most popular framework for building Nodejs web-servers. However, some of the historical contributors of the project left a while ago to create something new (but not too different): Koa. Does Express still have a bright future ? I don’t know. For personal reasons, I do not like it: I am a messy person and Express let me create very messy code that is impossible to maintain.
Based on these two points, I am not certain the MEAN (Mongo Express Angular (version 1) Node) stack is still current. Therefore I would like to propose a new stack:
HUMAN: Hapi U, the dev(Ops) Mongo Angular (version 2) Node
First you can notice that the U stands for “you”. You should be a part of the software you make especially if you find yourself in a devOps position. Therefore the priorities of this stack are:
- developer's comfort and happiness
- code maintainability
- ease to deploy and host
Of courses, providing a great experience to users should be everyone’s first concern. But a lot of other people have explained why the set of tools I have chosen fit this requirement. That is why I will not expand myself on this topic.
Let’s meet the tools now:
Hapi was created around the idea that configuration is better than code, that business logic must be isolated from the transport layer, and that native node constructs like buffers and stream should be supported as first class objects. But most importantly, it was created to provide a modern, comprehensive environment in which as much of the effort is spent delivering business value.
Having spent a few months working with Hapi, I can assure you that the coder’s experience is awesome. You do not have to worry about all the low level issue that Express or Koa raise.
Jonathan Ong, one of the most active Koa developer gives an interesting test to decide whether you should use Hapi or Koa:
So if you want to build with stability, security, and structure in mind, i would personally recommend hapijs. On the other hand, if you want to learn everything, build piece by piece, and code closer to node-core, I’d recommend Koa.
If you should only notice one perks of Hapi, I would recommend taking a look at Glue. This is an amazing tool that advantages devOps greatly. This allows you to compose a server based off a set of plugins. These plugins can contain your business logic or any other server features such as logging tools. I have built an example app showing a few of Glue’s abilities.
A lot of big players have already made the hapi choice.
Last but not least, the Hapi universe offers a set of useful tools to facilitate your developer’s experience.
You are a part of the software you produce. The apps need to be easily maintainable to save valuable time and keep you stress free.
The 4 tools chosen in this stack are very good at making dev(Ops) happy.
I don’t think I have to develop why Mongo is cool. You can find plenty of articles explaining why MongoDB is a great choice. As a starting point, you can read this one.
I have been using Anglar 2 for a week now. At first I was like:
But then I realized that most of the complaints I had regarding the quality of my colleagues’ code (and mine, of courses) were rectified by the smart built into Typescript.
Java developers will love Angular 2! Non Java people will access some of the perks of this language without getting its annoying parts (yes, you know what I’m talking about !).
A lot of features that exists in other modern frameworks have been implemented such as optional server-side rendering, the use of web-workers or components templating. I am confident that Google along with the help of the community have done a great job with this framework and that it will quickly find its position on the market.
As for Mongo, I will not explain why is Nodejs so cool. Plenty of people have done this before me Google will help you find more than enough articles.
Let’s make software crafting more HUMAN friendly.
In the next few weeks, I’ll try to publish a set a tutorials related to this stack. This will include coding and devOps related articles.
I would like to thank Jean-Philippe Pellerin for his valuable help with this article.