Which option is right for your project?

Rahman Ardian
Sep 5, 2018 · 4 min read
Speed Up Your Development (https://wallpaperstudio10.com)

JavaScript has grown up rapidly in recent years. The rapid spread of JavaScript also stems from its strong community. According to StackOverflow survey, JavaScript is the most popular technology in 2017.

Similarly, GitHub found that JavaScript is the most commonly used programming language. Seen in a report released at the end of 2017, JavaScript has a massive footprint on GitHub, with more than twice the number of pull requests than the second-leading language.

JavaScript today is not only used in the front end but also in the back end and mobile. Node.js is an open-source run-time environment allows creating server-side code using JavaScript. Dozens of Node.js based frameworks make this technology suitable for almost any type of projects and provide the functionality required for building highly scalable web apps. But, most Node.js frameworks don’t come with a fixed directory structure and it might be challenging to get it right from the beginning. Alternatively, you can use boilerplate to start your project.


What is Boilerplate?

Boilerplate is the term used to describe sections of code that can be included in many places with little or no alteration. It is more often used when referring to languages which are considered verbose, i.e. the programmer must write a lot of code to do minimal jobs. Boilerplate code is a piece of code which can be used over and over again or we can say it, a piece of reusable code.

Listing
Here is a list of boilerplate code you should consider when starting your Node.js project:

  1. Sahat Boilerplate

The first is Sahat boilerplate. Sahat for Node.js web applications is the most complete boilerplate and comes with a complex package. Sahat makes it as generic and reusable as possible to cover most use cases of hackathon web apps, without being too specific. In the worst case, you can use this as a learning guide for your projects. They have over 24k stars on GitHub.

2. Kriasoft Boilerplate

Kriasoft creates a Node.js API starter; this is a boiler and a tool for creating API data backend with Node.js, GraphQL, and bundle with Docker. This boilerplate is the most suitable for developing the GraphQL API endpoint. It can be built as an independent microservice or for creating a web front-end back-up and mobile application. If you are interested in GraphQL, this boilerplate is recommend to start your project.

3. Madhums’ Boilerplate

Madhums’ boilerplate is a boilerplate application for building web apps using Express, Mongoose, and Passport. Madhums’ boilerplate comes with MVC base pattern to implement the project. If you are familiar with MVC pattern it can be easier to switch from another language to Node.js

4. Icebob Boilerplate

Icebob boilerplate is a full-stack web app boilerplate project with VueJS, ExpressJS, and MongoDB. Inspired by Sahat boilerplate, it focused on a starter project which contains common functions like user signup, login, OAuth, and user profile. So, we can create a new web app and only need to develop the business logic.

5. Talyssonoc Node API boilerplate

The last one is Talyssonoc Node API boilerplate. This boilerplate was built for creating backend API. The folder structure and logical architecture of this boilerplate focused on the separation of concerns based on domain-driven design and clean architecture. Instead of using the MVC pattern, this boilerplate has layers inside the src folder. Each of the folder layers is scoping by a namespace on the concern it is about (like the user, errors, logging and so on). For detailed information about the structure behind the boilerplate, read this. Unlike the others, this API base boilerplate by Talyssonoc is the simplest way to install the API project.


Recap

All boilerplates have advantages and disadvantages, each depending on the type of project. You can choose Sahat or Icebob to create an application with back end and front end support. Talyssonoc, Kriasoft, or Madhums boilerplate is suitable to create an API back end. You can choose Madhums boilerplate if you’re familiar with the MVC pattern, but if you’re looking for clean architecture and scalability, go for Talyssonoc.

Better Programming

Advice for programmers.

Rahman Ardian

Written by

Full time remote worker. Interest in technology and education. Loves cycling and archery. Ph.D Wannabe!

Better Programming

Advice for programmers.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade