The complete guide to Node.js frameworks

A quick tour of the best MVC frameworks, REST API frameworks, full-stack frameworks, and other handy libraries for Node.js

1 2 3 Page 2
Page 2 of 3

Kraken relies on yo to generate projects, as shown in the screen shot below. Like Locomotive, it organizes its projects into conventional Rails-like directories including models, controllers, and config. As generated, Kraken ties into Express as standard middleware, defined as an app which then has its app.use() and app.listen() methods called. Each route in a Kraken server lives in its own file in the controllers folder.

nodejs kraken IDG

Meteor

Meteor is a full-stack application platform that gives you a radically simpler way to build real-time mobile and web apps, entirely in JavaScript, from one code base. Rather than sending HTML over the wire, Meteor sends data from the server for the client to render. In addition to running standalone, Meteor can integrate with Angular and React, supporting the MVC pattern. Meteor is nothing like Express, even though it is also built on top of Node.js and supports Handlebars, Blaze, and Jade templates.

Meteor allows for rapid prototyping and produces cross-platform (web, Android, iOS) code. It integrates with MongoDB and uses the DDP (Distributed Data Protocol) and a publish–subscribe pattern to automatically propagate data changes to clients without requiring the developer to write any synchronization code. On the client, Meteor depends on jQuery and can be used with any JavaScript UI widget library.

Meteor is developed by the Meteor Development Group, a startup that was incubated by Y Combinator. Meteor is now mature enough to support half a dozen tutorial books.

Meteor itself is free open source software, but the Meteor group monetizes it by selling Meteor Galaxy DevOps subscriptions, which include AWS server space and basic Meteor support, and a separate Premium support subscription.

nodejs meteor IDG

 

Nodal

Nodal bills itself as a web server for Node.js that is optimized for building API services. It has its own opinionated, explicit, idiomatic, and extensible framework, with a philosophy similar to Rails and Django. Beyond the basics of a Node.js MVC server, it has built-in PostgreSQL integration, both standalone and database-linked models, an ORM query composer, Regex matching in its routing, and CLI tools for creating models, controllers, and best-guess routes.

To spin up a Nodal server, first install Nodal, and then generate and start a new server:

npm install nodal -g
nodal new
nodal s

Sails

Sails makes it easy to build custom, enterprise-grade Node.js apps. It is designed to emulate the familiar MVC pattern of frameworks like Ruby on Rails, but with support for the requirements of modern apps, namely data-driven APIs with a scalable, service-oriented architecture. It’s especially good for building chat apps, real-time dashboards, and multiplayer games, but you can use it for any web application project. Sails supports WebSockets and automatically sends socket messages to your app’s routes.

Like Rails, Sails values convention over configuration, has generators and scaffolds for building out REST APIs quickly from blueprints, and uses an active-record design pattern. Sails is built on top of Express and Socket.io, and uses Waterline for its ORM, with support for ORM joins. Waterline supports a bunch of data stores and databases, both SQL and NoSQL.

Sails is a back-end framework designed to be compatible with whatever front-end web framework, such as Angular or React, or mobile device, such as iOS or Android, that you happen to like or need to support. There are three published books on Sails.

ThinkJS

ThinkJS is an MVC framework that supports ES6 (generator function) and ES7 (async and await) features, Babel and TypeScript, hot reload, WebSocket libraries, various types of session and cache, and the MySQL, MongoDB, PostgreSQL, and SQLite databases. In the view, ThinkJS supports EJS, Jade, Swig, and Nunjucks template engines.

The creators claim that ThinkJS has the functionality and complexity of Sails with performance that’s almost as good as Express or Koa. The ThinkJS CLI auto-generates REST APIs, with data-level user authorization control.

Trails

Trails builds on the pedigree of Rails and Grails to accelerate Node.js development by adhering to a straightforward, convention-based, API-driven design philosophy. Trails uses Yeoman to generate scaffolding for new applications, and to create resources inside the application, such as models, controllers, policies, and services.

Trailpacks extend the Trails framework’s capabilities. Many Trails installations will include some of the following Trailpacks: Router, REPL, Hapi, Express, Waterline, and Knex. When using the Yeoman script to generate a Trails application, you interactively choose your web server (Hapi, Express, or other), your ORM (Waterline, Mongoose, Knex, Sequelize, Bookshelf, other, or none), and whether you want to use Footprints, which generates a REST API automatically from your models.

Full-stack frameworks for Node.js

Catberry.js

Catberry is an isomorphic framework for building universal front-end apps using components, a Flux data-layer architecture, and optimized parallel progressive rendering. Isomorphic or universal applications use the same codebase on both the server and client to render what the client would see as a single-page application. At the same time, Catberry supports SEO: A search crawler receives a full page from the server, and the whole state of the application is restored from its URL.

Catberry’s Flux-like architecture defines the use of stores – data sources – and views/components that get and render data from stores. Catberry uses cat-components for these views. According to the developers, this is a robust and high-performance architecture that allows you to create large, complex applications with many data dependencies. 

nodejs catberry Catberry.js Team

Feathers

Feathers is a REST and real-time API layer for modern applications. The developers claim you can use it to build prototypes in minutes and production-ready real-time back ends and REST APIs in days. That claim isn’t exactly unique to Feathers. They also call Feathers a “batteries included but easily swappable” framework. 

Among the essential selling points of Feathers are that it provides service adapters you can use to connect to all of the most popular databases, and query them with a unified interface no matter which one you use. Feathers automatically provides REST APIs for all your services, gives you pagination for every service, and automatically returns appropriate errors to the client.

Feathers supports WebSockets for real-time performance, supports services and hooks for cross-cutting concerns, and supports email/password, OAuth, and Token (JWT) authentication. The Feathers CLI allows you to generate apps, database code, authentication, services, and hooks. 

Horizon

Horizon is a platform for building real-time apps. It provides a complete back end that makes it dramatically simpler to build, deploy, manage, and scale JavaScript-based web and mobile apps. Horizon is extensible, integrates with the Node.js stack, and allows building modern, arbitrarily complex applications.

Horizon is built on top of RethinkDB and consists of four components: the Horizon server, a middleware server that exposes a simple API/protocol to front-end applications; the Horizon client library, a JavaScript client library that wraps Horizon server’s protocol in a convenient API for front-end developers; the Horizon CLI, a command-line tool aiding in scaffolding, development, and deployment; and GraphQL support, which allows you to get started building React/Relay apps without writing any back-end code at the beginning.

Horizon currently exposes four APIs: Subscribe, a streaming API for building realtime apps directly from the browser without writing any back-end code; Auth, an authentication API that connects to common auth providers such as Facebook, Google, and GitHub; Identity, an API for listing and manipulating user accounts; and Permissions, a security model that allows the developer to protect data from unauthorized access.

KeystoneJS

KeystoneJS is a Node.js content management system (CMS) and web app framework built on the Express web server and the MongoDB database via Mongoose. Keystone makes it easy to create websites and apps, and comes with an auto-generated admin UI.

The easiest way to get started with Keystone is to use the Yeoman generator:

$ npm install -g generator-keystone
$ yo keystone

Alternatively, to include Keystone in an existing project or start from scratch (without Yeoman), specify keystone: “^0.3.9” in the dependencies array of your package.json file, and run npm install from your terminal.

The Keystone yo generator sets up a user model, authentication, sessions (which you can turn off if you don’t need them), routes, middleware, views using Jade templates, and the admin UI. Keystone isn’t opinionated about how you design or build the front end of your site, however. Use jQuery, Angular, React with Less, Sass, or CSS modules, and any Node.js template language supported by Express.

Common patterns in KeystoneJS include blogs, image galleries, and contact forms.

MEAN.io

MEAN is a framework for building applications with MongoDB, Express, Angular, and Node.js. It is designed to give you a quick and organized way to start developing MEAN-based web apps with useful modules like Mongoose and Passport pre-bundled and configured. The MEAN.io framework mainly tries to take care of the connection points between its component frameworks and solve common integration problems.

This version of the MEAN stack includes a CLI, which generates, manages, and updates your MEAN apps. The CLI also serves as a help facility.

MEAN.js

MEAN.js is a full-stack JavaScript solution that helps you build fast, robust, and maintainable production web applications using MongoDB, Express, Angular, and Node.js. The idea is to solve the common issues with connecting those frameworks, build a robust framework to support daily development needs, and help developers use better practices while working with popular JavaScript components.

There are currently three books and a video about developing with MEAN.js, all published by Packt.

Meteor

Meteor is a full-stack application platform that gives you a radically simpler way to build real-time mobile and web apps, entirely in JavaScript, from one code base. Rather than sending HTML over the wire, Meteor sends data from the server for the client to render. In addition to running standalone, Meteor can integrate with Angular and React, supporting the MVC pattern. Meteor is nothing like Express, even though it is also built on top of Node.js and supports Handlebars, Blaze, and Jade templates.

Meteor allows for rapid prototyping and produces cross-platform (web, Android, iOS) code. It integrates with MongoDB and uses the DDP (Distributed Data Protocol) and a publish–subscribe pattern to automatically propagate data changes to clients without requiring the developer to write any synchronization code. On the client, Meteor depends on jQuery and can be used with any JavaScript UI widget library.

Meteor is developed by the Meteor Development Group, a startup that was incubated by Y Combinator. Meteor is now mature enough to support half a dozen tutorial books.

Meteor itself is free open source software, but the Meteor group monetizes it by selling Meteor Galaxy DevOps subscriptions, which include AWS server space and basic Meteor support, and a separate Premium support subscription.

nodejs meteor IDG

 

Meatier

Meatier is basically an attempt to embody the general architecture and functionality of Meteor in a component-based project that relies on different dependencies than Meteor. For example, Meteor is strongly tied to MongoDB and Simple Schema; Meatier uses RethinkDB and GraphQL instead. Meteor has its own build system; Meatier uses Webpack. Meatier clients depend on React; Meatier servers depend on Express and SocketCluster.

The differences go on. What’s clear is that Meatier is an updated and probably better approach to the underlying design of Meteor. However, “trades a little simplicity” might be an understatement. Meatier is definitely not for n00bs.

Seneca

Microservice architectures are a hot topic. The catch in building an app that uses microservices is often figuring out how to interconnect the microservices. Seneca offers an elegant, modular solution for interconnecting microservices that is based on messages, pattern matching, transport independence, and an ecosystem of plug-ins, all built on top of Node.js. Note that Seneca is not a web framework, although you can connect it up to your web service API.

Seneca messages are JSON objects, and they can have any internal structure you like. Messages can be sent via HTTP/S, TCP, message queues, publish/subscribe services, or any other supported transport. From your perspective as the writer of a Seneca service, you just send messages out into the world. You don’t need to know which services receive them.

To receive messages, you specify the property patterns that your service cares about, and Seneca (with a little configuration help from you) makes sure that they get any messages sent by other services that match those patterns. Seneca is responsible for seeing that the most specific patterns take precedence over more general patterns.

SocketCluster

SocketCluster is a fast, highly scalable HTTP and real-time (WebSocket) server engine that lets you build multi-process, real-time servers, making use of all of the CPU cores on a machine. It removes the limitations of having to run your Node.js server as a single thread and makes your back end resilient by automatically recovering from worker crashes and aggregating errors into a central log on each host. SocketCluster can also auto-scale across multiple hosts on top of Kubernetes.

1 2 3 Page 2
Page 2 of 3