In Gabion a module is not a single Java class, a frontend component, or a
general-purpose library.
A module represents a complete vertical part of the application. It
combines the elements of different technical layers needed to implement a
particular capability of the product within the agreed architecture.
What one module can contain
Depending on the task, a module can contain:
- a Java backend;
- Spring configuration;
- an API or server-side actions;
- TypeScript code;
- Thymeleaf templates and sections;
- CSS;
- a separate page;
- interface elements;
- a data structure;
- Flyway migrations;
- checks;
- tests;
- project configuration;
- diagnostics for the human and the AI.
This makes it possible to treat a feature not as a set of unrelated
files, but as one deliverable unit with defined boundaries.
Example
An administrative audit module can include the tables and migrations,
the server-side recording of events, the access rules, a page for
viewing them, the frontend behavior, the styles, and the checks that
confirm correct installation.
A specific public example has to use only an implemented and verified
module.
The module manifest
The contents and technical properties of a module are declared in
gabion.manifest.json.
The manifest is the single source of module metadata.
On the basis of the manifest, Gabion determines:
- the pages and the navigation;
- the access scope of a page;
- the public and protected API paths;
- the sections for aggregator pages;
- the presence of migrations;
- the contracts provided;
- the mandatory contracts;
- the optional contracts;
- the elements of the project that belong to the module;
- the checks the module requires.
Dependencies use the declarations:
provides;
requires;
optional.
Gabion derives the behavior of a module from the manifest, rather than
from separate imperative installation code.
The page does not publish the full internal manifest schema until the
policy for versioning it is approved.
The manifest describes the contents of a module and its place in the
project. The Java contract describes the permitted interaction with other
modules.
Contracts instead of direct dependencies
Modules do not depend on each other's internal implementation.
A Gabion contract is a Java interface in a stable layer,
dev.gabion.contracts.
A module can provide an implementation of a contract as a Spring bean
that returns the type of that contract.
Another module uses the contract, but does not import the internal
classes of the provider.
The manifest declares:
-
which contract the module provides, through
provides;
- which contract it requires, through
requires;
-
which contract it can use where one is present, through
optional.
A module must not:
- import the internal implementation of another module;
- depend directly on the classes of another module;
- make arbitrary changes to files belonging to others;
- access the hidden data structure of another module;
- create an undeclared dependency on installation order;
- bypass a contract with a direct call;
- bypass the architectural checks of Gabion.
A module knows the Java contract of the capability it needs, but does not
know the internal structure of the module that implements that contract.
A module and the business logic of the client
A shared module solves a repeatable technical or product task, but does
not hold material unique to a particular client.
A reusable module must not contain:
- client data;
- secrets;
- the source code of the old product;
- the name of the client or of its users;
- unique business rules;
- confidential calculations;
- specific identifiers;
- internal documents of the client.
Unique logic stays in the separate project of the client and uses the
permitted module contracts.
If a new repeatable component is required during a migration, Pikiner
creates an anonymized module outside the client project directory. The
implementation specific to the product stays inside the project.
A module and the Starter
The Starter and a module are different layers.
The Starter is the single visual shell of the project.
Exactly one Starter is used in a project.
Starter
The Starter contains:
- the main layout body;
- the themes;
- the canonical
--gb-* CSS values;
- the shared UI fragments;
- the visual foundation of the application.
The Starter:
- is not a module;
- does not create product functionality;
- does not declare a business capability;
- does not replace the standard modules;
- does not create the project itself.
Module
- adds a complete vertical capability;
-
can include a backend, a frontend, templates, styles, a page, and
migrations;
-
declares its contents through
gabion.manifest.json;
- provides and uses Java contracts;
- does not depend directly on other modules.
The project is created by the gabion init command, not by
the Starter.
When a project is created, Gabion applies one Starter and the provided
starting set of standard modules.
gabion init creates the project. The Starter sets its visual
shell. Modules add functional capabilities.
Creating a project
A new project is initiated by a command of the form
gabion init my-project.
Gabion creates a separate project directory and installs the provided
starting set of standard modules.
This directory holds:
- the source code of the application;
- the project configuration;
- the business logic;
- the frontend and the backend;
- the migrations;
- the tests;
- the templates;
- the styles;
- the project documentation.
Gabion Runtime and the internal module storage are located outside this
directory.
This separation is not merely an organizational convention. It sets the
technical boundary between the Pikiner tool and the result that belongs
to the client.
Module management
The internal Gabion production CLI makes it possible to:
- add a module from the storage;
- remove a module;
- replace a compatible implementation;
- update a module;
- validate the manifest;
- verify architectural compatibility;
- apply the changes that belong to the module;
- run the necessary checks.
These operations are carried out through a controlled production process,
not by copying files arbitrarily.
Direct access to the internal module storage, and the functions that
manage it, are not part of the project edition of Gabion for Pikiner
clients.
The client receives the assembled project and the means to develop it
further that the license provides for, but not the internal production
catalog of Pikiner.
What happens when no module exists
The absence of a ready-made module does not mean Gabion should let the AI
create an arbitrary architecture freely.
Pikiner first determines:
- whether the task is repeatable;
- whether it should become a shared module;
- which contract it requires;
- which layers belong to the vertical implementation;
- which properties have to be verified;
- how to exclude the data and the unique logic of the client.
If a new module is necessary to deliver a client project that has already
been agreed, creating it is internal Pikiner work.
The client pays for the agreed result of the project, not for the number
of modules created or for the growth of the internal Gabion storage.
Which tasks become modules
The case for creating a module is stronger if the task:
- recurs across projects;
- affects several technical layers;
- has significant security requirements;
- is often implemented by the AI incompletely or inconsistently;
- requires coordinated migrations;
- has to preserve uniform architectural properties;
- needs a deterministic check;
- has a clear contract with the rest of the system.
Potential classes of module:
- identity and authentication;
- roles and access rights;
- the audit of actions;
- work with files;
- notifications;
- background operations;
- integration adapters;
- configuration;
- observability;
- administrative functions.
This list describes possible classes of task; it does not promise that
every module exists in the current version of Gabion.
A module may be called implemented on a public page only if it:
- exists in the storage;
- passes the checks provided for it;
- is compatible with a supported pipeline;
- has a defined contract;
- is used in a real project or a prepared showcase.
The result of installing a module
Once a module has been applied, the files and changes the application
needs are in the project directory.
The production application:
- does not load the module from Pikiner storage while running;
- does not call Gabion in order to serve a user request;
- does not verify a Gabion license;
- does not require a valid token;
- does not depend on the availability of the Runtime;
- is built as a standard project on the coherent stack.
The module storage takes part in creating the project. It takes no part
in the operation of the production application.