The backend is developed using a software component approach in order to compose and adapt the platform based on needs and constraints. The current section describes this approach, and how to extend it by creating new components.
The platform has the following properties:
A platform is composed of multiple components
A component has an unique name in the platform
A component can provide a
A component can consume
services from other components
A component has a lifecycle composed of several states:
A component lifecycle changes when a lifecycle event is triggered by the platform:
By creating links between components (service producers and consumers), components lifecycles are also linked together: A component going from
initialized will wait for all its dependencies to be in
initialized state. This is automatically handled by the platform.
The platform currently have some limitations:
Components can not have cyclic dependencies: if
component X requires a component which requires
component X directly or in one of its dependencies, the platform will not start
Components can only have local dependencies.
To unfold the internal ways of services in Twake, we will follow a simple request journey into our framework.
The requests starts from Twake Frontend or Postman for instance,
it then goes to a controller which validate the request parameters and extract them for the services,
the services uses the given parameters to get/set entities in database and returns a proper reply.
This is where you declare the routing you want to use.
This is where you work for real, calling databases, sending websockets events, using tasks pushers etc.
If you store data, you must define its data model and how it is stored in our database middleware.