Vocabulary - ForrestJS

In ForrestJS we use a few specific terms to refer to different responsibilities or differnent coding activities.

It takes just a few minutes to go through our vocabulary.
Do it!


Actions are at the very core of any ForrestJS Application.

You can register an Action, to provide custom business logic to existing Extensions, normally provided by ForrestJS Services that you can install from NPM.

EXAMPLE: You can register a new Action to the $FASTIFY_ROUTE extension to provide a new Fastify route definition in your App.

It looks like this:

  target: '$FASTIFY_ROUTE',
  handler: () => {
    /* custom logic */

The target param is a strong reference to an Extension name.
The handler provides your business logic.

👉 As many Extensions accepts declarative handlers, you will likely see a lot of Actions implemented in a declarative fashion:

  target: '$FASTIFY_ROUTE',
  handler: {
    method: 'GET',
    url: '/',
    handler: async () => 'Hello World',


When you create a new ForrestJS Service, you can create new Extensions as so to allow further specialization of your service logic.

EXAMPLE: When your Postgres connection is established, you create a new extension so that other Features can run their initialization SQL queries.


A ForrestJS Feature is a package of Extensions that serve the same goal.

EXAMPLE: you can pack together a few $FASTIFY_ROUTE extensions into a Feature called "static-pages".

Such Feature has the goal to provide generic information to the website visitor.


A ForrestJS Service implements a generic piece of business logic that should extended by some Features in order to provide real user value.

EXAMPLE: service-pg keeps an active connection pool towards a PostgreSQL database.

But without some Features that actually use it to run some SQL queries, it doesn't really do much for the end user.

Services are often thin wrappers around existing NPM Modules such Fastify or Node Postgres.


A ForrestJS App is a composition of Services and Features that provide some kind of User value.

App Manifest

We call "App Manifest" the entry point of a ForrestJS App (usually src/index.js).

This piece of code is mostly declarative and implements some specific responsibilities:

  1. Validate the App's Environment
  2. Provide configuration to Services and Features
  3. Compose the App with lists of Services and Features
  4. Handle boot errors

Service (or Feature) Manifest

We call "Service or Feature Manifest" the entry point of a ForrestJS Service or Feature. (usually: src/(services|features)/xxx/index.js).

This piece of code is mostly declarative and implements some specific responsibilities:

  1. Register all the Extensions that are implemented by the Service/Feature
  2. Declare new Extension's Targets for new Extensions provided by the Service/Feature

results matching ""

    No results matching ""