Architecture
Stapi.ai is set of packages allowing to define your systems workings declaratively. Because of this declarative nature, the system can also be very well analyzed and visualized. Here are few point of views of how you can look at the system:
Repository-level point of view
The simplest high level from the perspective of repository dependencies is as follows:
Default sandbox repository looks like this:
Stapi is structure agnostic, which means it does not force how you should structure your service repository. Your service can be in one repository or splitted by business modules into more repositories - however you wish.
Running-service level point of view
One running JVM container can handle all your business logic:
You may want to scale later and it will be easy.
You just change configuration (UI or yaml) and you can run more containers. Each container can be configured to accept requests only for part of your system with granularity of up to one specific endpoint. Or you can have running container for one, resource-intensive business module.
More point of views
Different people will need to see different scope and different angle of the system. We like the idea of C4 model (opens in a new tab), which we would like to incorporate in UI admin.
Your app
Any app (API service) powered by stapi.ai (purple ones on the images), needs to have repository with at least two maven dependencies:
- Specific System driver plugin (stapi.ai provides Axon Framework System Driver)
- Specific read-model database driver plugin (stapi.ai provides ArangoDB Driver) But usually you will also use one or both of these:
- GraphQL plugin, which can expose your public model API with GraphQL automatically
- SDK generator plugin, which will allow you to work with your model and connect external services
When everything is released, we will also provide prepared sandbox repos as hello-world examples, ready to deploy.
Plugins
App powered by stapi.ai can require any plugin with maven. We consider plugin anything outside stapi.ai Core package, which means there are few different kinds of plugins.
Model plugins
They are plugins containing mainly declarative JSON definitions of plugin's functionality. After you require this kind of plugin and deploy, your app GraphQL should update and contain new features model plugin offers.
Extension plugins
Sometimes you need something more custom, where declarative language may not be able to serve well. For example, when you want to customize how declarative system works itself, or connect external service API, it usually takes to use some imperative code where you call some SDKs. Extension plugins are place to put it so that it can be reused.
Driver plugins
Stapi.ai Core package uses principles, which can be implemented using different infrastructure. For each infrastructure choice, there need to be a plugin. Stapi.ai comes with AxonIQ System Driver package for using Axon Framework (opens in a new tab) for declarative domain-driven system and ArangoDB Driver package for ArangoDB declarative read-model.