= edemokracia Application
== Using the generated application
This application is generated from the model defined in the upper directory or the given consumed model.
To compile and run project use judo.sh
script. Linux and MacOS are supported. Maybe it works with WSL2, but it's not
tested, and it can have poor performance. For more details please run ./judo.sh --help
=== Prerequisite
==== Docker
Most commands rely on Docker, therefore it is expected to be installed. The judo.sh
will install the required tools with https://sdkman.io/[sdkman].
==== Maven
To work with the model we have to set up the distribution repository in your ~/.m2/settings.xml
=== Build application To build the application, execute
=== Start the application After build it can be started
The commands can be chained:
=== Stop the application After start or reckless, karaf is not terminated automatically. To stop type:
=== Check status To check the running instances, use:
=== Reckless mode
There are several situations when minimal change performed on model. To decrease the model-to-deploy time the reckless
command can be used. It will enable caching, disabling validation to perform maximum speed. It causes sometimes
errors. On that case it can be fixed with a build
.
=== Compile with maven
To create and package karaf service, run:
It uses the model version and frontend version defined in pom.xml
.
In development sometimes other version is required (for example locally compiled ESM) On that case model-version
and frontend-version
can be overridden.
== Profiles
build-model
The backend models are transformed by default. If there was no change, it can be ignored. To skip backend model transformations, use the system property: -DskipBackendModels
build-schema
The backend schema is used to create migration scripts. It is created by default. When you are testing with hsqldb or using empty database, it can be skipped. To skip schema evolution script generations, use the system property: -DskipSchema
build-sdk
The SDK can be generated from model. It is generated by default. It is used to implement functions in Java. To build karaf it have to be compiled. To skip SDK generations, use the system property: -DskipSDK
build-frontend-react
The React frontend code can be generated from model. It is generated by default. To skip React frontend generations, use the system property: -DskipFrontendReact
build-karaf
The karaf runtime is created by default. It integrates backend and frontend modules, it can be used as a standalone server. To skip creating the karaf runtime, use the system property: -DskipKaraf
build-docker
The docker image is created by default. It uses karaf runtime and creates runnable docker image. To skip creating the docker image, use the system property: -DskipDocker
Sometimes maven compiling can be slow. In order to investigate what is causing potential issues we can run maven with:
-Dprofile -DprofileFormat=HTML
Using these flags, maven will generate a HTML report in the .profiler
directory.
== Layout
=== model
The model project.
It creates the intermediate models from ESM model and stores in /model/target/generated-resources/model/
directory.
This model is packed as OSGi bundle which is used the JUDO runtime.
It also attach 4 OSGi bundles:
script2operation.jar
The generated Java representation of scripts as OSGi services
asm2jaxrsapi.jar
CXF based JaxRS implementation which delegates operations as REST. It is the server side definitions of OpenAPI specified functions.
=== schema
The schema is used to make transition between model states in RDBMS. Schema supports incremental DDL. It creates standalone CLI and docker images to update a database to new model state.
=== app
The implementations for model defined custom operations.
=== sdk
SDK API codes which can be implemented as custom Java operations in app
or other custom subprojects.
=== internal
SDK API wrapper which are technical services to bind the user defined Java custom operations.
=== frontend-react
It contains the generator project and the generated react frontend source. It uses maven with frontend maven plugin to create deployable web bundle which is served as static content in karaf runtime.
=== karaf-features
The description of the karaf service.
It aggregates bundle definitions and configurations for the backend service in src/main/feature/features.xml
.
=== karaf-offline
The assembled karaf service which can be deployed.
We can use the run-offline.sh
script to run it
=== docker
The docker image builder which is including karaf-offline
.
== Run service
After the project compilation every artifact is created to be able to start karaf service. Keycloak service have to be accessed by backend for all apps.
=== Keycloak
By default JUDO apps integrate with keycloak in order to provide authentication and authorization features. Keycloak must be running in order for applications to start up.
It is accessible in port 8080 by default, so in browser:
http://localhost:8080
== Settings
Settings can be set up as https://internal-documentation.judo.technology/getting-started/introduction.html[judo-documentation] describes.