Blueprint
  • Blueprint Developer Guide
  • Quick Start
    • Getting Started
    • My First Application
      • Creating Your Application
      • Controllers
      • Routers & Routes
      • Services
      • Resources & Resource Controllers
      • Validating & Sanitizing Input
      • Unit Testing Your Application
      • Policies
  • Developer Guide
    • The Object Model
      • Introduction
      • Classes and Instances
      • Computed Properties
      • Aggregated Properties
      • Mixins
    • Routers and Controllers
      • Introduction
      • Routers
      • Controllers
      • Resources
    • Models
    • The Server
    • Policy Framework
    • Services
    • Messaging Framework
    • Configuration Management
    • Application and Resources
      • Lookup Operation
      • Views
      • Assets
    • Blueprint Modules
    • Blueprint Cluster
      • What is a Blueprint Cluster?
      • Running a Blueprint Cluster
      • Technical Details
    • Testing Framework
    • Command-line Interface (Coming Soon)
Powered by GitBook
On this page
  • What is a Blueprint Module?
  • Creating a Blueprint Module
  • Loading Blueprint Modules
  • Supported Entities
  • Module Directory
  • Authentication
  • Communication/Messaging
  • Data Models
  • Documentation
  1. Developer Guide

Blueprint Modules

Codify design solutions into reusable modules

PreviousAssetsNextBlueprint Cluster

Last updated 6 years ago

What is a Blueprint Module?

A Blueprint module is a node module that contains a reusable Blueprint entities that can be applied to a Blueprint application. The goal of a Blueprint module is to provide functionality that address a certain application concern. For example, a Blueprint module many provide support for MongoDB, or it may implement a solution for integrating a paywall into your application. This way, the Blueprint application developer does not have to implement the solution themselves.

Creating a Blueprint Module

It is not hard to create a Blueprint module. First, you need to create a standard Blueprint application.

blueprint new [name]

After the Blueprint application is created, add blueprint-module to the keywords property in the generated packaged.json file. Now, save the application and publish it using npm.

You have now created your first Blueprint module.

Loading Blueprint Modules

The Blueprint application automatically loads all Blueprint modules. It does so by using a postorder depth-first search of the dependencies defined in package.json, and loading all modules that have the keyword blueprint-module. This ensures that all dependencies are available to the parent module, or application, when it is loaded into memory.

A Blueprint module can depend on other Blueprint modules.

When a Blueprint module is loaded into memory, the module is added to the Blueprint application and the entities in the Blueprint module are merged with the entities in the application. If an entity with the same type and name already appears in the application, it is overwritten. The overwritten entity, however, will still be accessible via the application. You just have to include the Blueprint module name when you are perform a . For example

blueprint.lookup ('module-a:model:message');    // using lookup() method
blueprint.model ('module-a:message');           // using model() method 

Supported Entities

The following entities can be loaded from a Blueprint module into a Blueprint application:

  • Controllers

  • Listeners

  • Models

  • Policies

  • Resources

  • Routers

  • Sanitizers

  • Services

  • Validators

Module Directory

The following is a list of know Blueprint modules.

Authentication

Communication/Messaging

Data Models

Documentation

When a router is loaded from a Blueprint module, its routes are not automatically added to the Blueprint application. Instead, you must for it to be useable from the Blueprint application.

- Token-based authentication

- Let's Encrypt support for free, automated SSLs

- Google Firebase Messaging support

- Socket.IO support

- MongoDB support via Mongoose

- generate and view Swagger specification from application

lookup operation
mount a router
Gatekeeper
Greenlock
Firebase Messaging
Socket.IO
MongoDB
Swagger UI