Nodal — A Node.js Server Platform

Randolph Perkins
5 min readJan 11, 2021

Are you trying to get an API service project up and running quickly, without all of the server decision making and that will interface with your data seamlessly? Enter Nodal — an opinionated, explicit, highly-extensible full-service framework. Only in the developer world is a writer able to get away with introducing a product or tool with that many adjectives in an opening paragraph. For the sake of budding software engineers, I will define each concept in detail below. Fortunately, this is one of the primary purposes of Nodal — to delegate much of the decision making with regards to the essential features that make up a web server, such as models, controllers, and routing. This makes Nodal an essential tool for developers.

Create Read Update DESTROY (emphasis mine)

In Node parlance, CRUD operations are those which allow you to work with data stored in a particular database. These represent a set of operations that we have servers execute. Broken down into simple definitions, we have the following:

  • Create (POST) — Make something
  • Read (GET)- Get something
  • Update (PUT) — Change something
  • Delete (DELETE)- Remove something

Nodal, in this respect, is a data manipulation-centric framework, and therefore is CRUDdy, or CRUDful, or covered in CRUD, or… well you get the point.

Opinionated and Explicit

Many, if not most, developers are already familiar with Express, a very popular Node.js framework which simplifies the server creation process. This framework is unopinionated and minimalist. Software is considered opinionated when it is built to certain design patterns more than others. A prime example is Ruby on Rails, software that works seamlessly with other software by design. Whereas a server framework such as Express is unopinionated, and therefore flexible for any design approach, Nodal prides itself in its use of fairly rigid design patterns and idioms. This approach is predicated on the ubiquity of JavaScript and the wide spectrum of code variability in the developer world as a result. Thus Nodal is intended to restrict the developer in writing programs, while still being accessible in most respects.

Distributed Design

Nodal encourages a distributed architecture, which is based on three design tenets which developers should consider when working within its ecosystem:

  • Software platforms should delegate services to functionally distinct parts of the program, or problem domains. For example, the business logic of a project should be handled separately from the user interface concerns.
  • Each service should be optimal for performing only a single type of task. For the business logic, you would want an API service that only returns API responses, and nothing else.
  • Problem domains should be loosely-coupled. These services should have separate code repositories, and as a result the project architecture should not be reliant on any single module. In an instance in which the developer should want to outsource a part of the program to a different firm, then that firm should be granted repository access to that project alone, and they should be given an interface for your API.

This design strategy is intended in order to avoid generating monolithic applications, and this is carried out by Nodal’s stateless, distributed architecture.

Getting Off The Ground

It is relatively easy to get started on a project using Nodal. The framework is built to run with PostgreSQL, an object-relational database. For this example, we will just look at getting the server started to see what Nodal looks like out of the box.

First, run the following in the terminal:

You will be asked to provide your password, and then Nodal will be installed to the directory specified. Navigate to your projects folder, and type into the terminal: nodal new. You will be asked to enter your new project directory, and then type: nodal s. Then behold the raw power and beauty of an opinionated, stateless, idiomatic, extensible, explicit, scalable, robust, distributed… well, you get the point… Nodal server!

Newly Created Nodal Directory

Observe the built-in features ready to be modified to fit your project parameters: models, controllers, worker functions, and more pre-written and decided in advance structurally. There is even a test folder with example Mocha tests to be implemented for your project.

Controller Index in ES6 Class Syntax

Your Opinion…Please

Web developers and software engineers of all experience levels will likely find that having an opinionated server option within the Node ecosystem is highly valuable in today’s development world. Design flexibility is certainly important, but some structure and pre-fabricated components are increasingly necessary for any task. Nodal is a powerful tool for projects at most scales, and hopefully I have described its features well enough for the uninitiated to give the opinionated framework approach a try.

--

--