Readme

Apache License 2.0 Maven Central javadoc build issues discussions

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 17 or higher.

Try it out.

Download and Documentation

Include the library in your Maven configuration as:

<dependency>
    <groupId>net.tangly.erp</groupId>
    <artifactId>ui</artifactId>
    <version>0.2.7</version>
</dependency>

Include the library in your Gradle configuration as:

    implementation "net.tangly.erp:ui:0.2.7"

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

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.productionMode                       (1)
  net.tangly.erp.ui/build/install/net.tangly.erp.ui/bin/net.tangly.erp.ui   (2)

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                 (3)
  net.tangly.erp.ui/build/install/net.tangly.erp.ui-shadow/bin/net.tangly.erp.ui (2)
  java $JVM_OPTS -jar net.tangly.erp.ui/build/install/net.tangly.erp.ui-shadow/lib/net.tangly.erp.ui-all.jar (3)
  • <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 define 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 -ti -p 8080:8080 -e PORT=8080 -e m=true  -v /var/tangly-erp:/var/tangly-erp tanglyllc/tangly-erp:latest

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.