Skip to content

_Prtcl dev guide 3: Cortex modules

guillem.cordoba edited this page Nov 12, 2019 · 1 revision

A Cortex module is the basic unit of MicroModule that we are gonna use as the building blocks of our applications.

Each module represents a slice of vertical functionality, built form these parts:

  • Patterns: basic unit of logic of any Cortex module. They determine how a certain kind of object can behave (has links, redirects, can be cloned...)
  • Lenses: native HTML elements that know how to render and interpret the module's patterns.
  • Service providers: service classes that allow the module's patterns, lenses and other parts of Cortex to interact with the backends where the data is stored.

For example, tasks module would include:

  • Patterns:
    • TaskPattern: implements the differents pattern that our Task entity follows.
    • DependencyPattern: implements generic dependency linking for any two content addressable objects.
  • Lenses:
    • TaskDetail: renders the task and its details.
    • TaskDependencyGraph: renders the task and all its dependencies as a visual graph.
  • Service providers:
    • TaskProvider: service with a generic get(hash: string): Task function and some other functionality: createTask or assignTask, for example.
    • DependenciesProvider: service that offers getters and setters of generic linking between content-addressable objects.

In this first part of the guide, we are going to learn how to use the documentsModule together with the eveesModule, to build a simple document editor with version control built-in.

Let's begin by configuring our backend services at 4 - Configuring service providers.

Developer guide

1 - Installing the tools

2 - Looking around

3 - Cortex modules

4 - Configuring service providers

5 - Configuring modules

6 - Loading modules with micro-orchestrator

7 - Displaying an entity

8 - Adding the Evees module

9 - Adding multiple backends

[TBD]10 - adding lens selection

[TBD] Using Cortex without modules

[TBD] Building a pattern

[TBD] Building a lens

[TBD] Building a service provider

[TBD] Building a Cortex module

[TBD] Customizing the lenses module

[TBD] Building a plugin for the lenses module

Clone this wiki locally