<dependency>
<groupId>net.tangly.erp</groupId>
<artifactId>ui</artifactId>
<version>0.2.8</version>
</dependency>
Readme
Purpose
The tangly erp ui bounded domain component provides regular business model abstractions for business applications written in Java. The component is using records and requires Java 21 LTS or higher.
Try it out.
Download and Documentation
Include the library in your Maven configuration as:
Include the library in your Gradle configuration as:
implementation "net.tangly.erp:ui:0.2.8"
The documentation can be found under Business documentation.
For any further questions, you can use the forum tangly-Discussions.
Run as an Application
Run Locally with Gradle
The gradle script compiles, packages, and runs the application with an embedded web server. Run from the project root.
gradle run
The following end points are available:
-
The application user interface is available at
http://localhost:8080/erp/
. -
The REST interfaces are available under
http://localhost:8080/erp/DOMAIN/ENTITY
. An example ishttp://localhost:8080/erp/rest/customers/natural-enitites
. -
The openAPI description file is available under
http://localhost:8080/rest/openapi.json
. -
The swagger server is serviced under
http://localhost:8080/rest/swagger
.
The documents and reports are available under http://localhost:8080/erp/docs/
.
Each bounded domain has a dedicated document folder.
Run locally as compiled application
You can build and run the generated Java Vaadin application locally. Run from the project root.
./gradlew build installDist -Pvaadin.-Pvaadin.forceProductionBuild=true (1)
net.tangly.erp.ui/build/install/net.tangly.erp.ui/bin/net.tangly.erp.ui (2)
-
<1> The production mode parameter is mandatory. Otherwise, the distribution frontend is not built, and the application cannot run without JavaScript build tools.
-
<2> Head to http://localhost:8080/erp/. The default port is 8080, and the application starts with in-memory storage. The environment variables are set in the run script.
If you encounter an error message like |
Run locally as fatjar application
You can build and run the generated Java Vaadin application as fat jar locally. Run from the project root.
./gradlew build installShadowDist -Pvaadin.productionMode (1)
net.tangly.erp.ui/build/install/net.tangly.erp.ui-shadow/bin/net.tangly.erp.ui (2)
java $JVM_OPTS (3)
-jar net.tangly.erp.ui/build/install/net.tangly.erp.ui-shadow/lib/net.tangly.erp.ui-all.jar
-
<1> The production mode parameter is mandatory. Otherwise, the distribution frontend is not built, and the application cannot run without JavaScript build tools.
-
<2> Head to http://localhost:8080/erp/. The default port is 8080, and the application starts with in-memory storage. The environment variables are set in the run script.
-
<3> Start the application with java command. You are responsible to provide the JVM options as defined below.
The JVM options to run the application are
JVM_OPTS="--enable-preview --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \
--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED -XX:+ShowCodeDetailsInExceptionMessages -Xmx256m"
Run in a Docker Image
The prerequisite is that the application was built locally for production mode as described above. The first step is to build the Docker image with the provided configuration. Run from the project root.
./gradlew net.tangly.erp.ui:installDist -Pvaadin.productionMode (1)
docker login -u tanglyllc -p <password> (2)
docker build -t tanglyllc/tangly-erp:latest net.tangly.erp.ui/ (3)
docker push tanglyllc/tangly-erp:latest (4)
1 | Build the Java application and create a binary distribution of the application. |
2 | Login into DockerHub with username and password. |
3 | Generate a Docker image containing the binary application generated in the previous step. |
4 | Push the Docker image to the repository. Customers can retrieve the published Docker image and execute it in a container. |
We currently push to Docker Hub repository. The image is accessible unde tangly-erp Docker Image.
To run the built image, use the following commands.
docker run --rm -it -p 8080:8080 -e PORT=8080 -v /var/tangly-erp:/var/tangly-erp tanglyllc/tangly-erp:latest -p 8080 -c app-in-memory-no-imports.properties (1)
docker run --rm -it -p 8080:8080 -e PORT=8080 -v /var/tangly-erp:/var/tangly-erp tanglyllc/tangly-erp:latest -p 8080 (2)
1 | The application is started with the in-memory storage and the configuration file app-in-memory-no-imports.properties . |
2 | The application is started in production mode with loading of all defined tenants and data. |
The user under which the erp application shall not have root privileges.
The port of the application is configured through the port environment variable. This approach is mandatory if the image is deployed in Heroku.
Run in the Cloud
The deployment on the Heroku cloud was removed due to changes in the usage conditions of the platform. Therefore, we do not deploy anymore our applications on Heroku. |