Easy Diagram With JAVA Kroki On FreeBSD

The free Java library allows software developers to create diagrams from textual descriptions. Kroki is an open source MIT-licensed unified Java API that makes it easy for software developers to create diagrams from textual descriptions within their Java applications. Kroki is a highly stable, unified API for all diagram libraries that can be used anywhere.

The Kroki library follows a modular architecture that provides many different modules such as a Java web server that acts as a gateway, Umlet Java API for generating diagrams, Node.js CLI, and more. Kroki also supports BlockDiag (BlockDiag, SeqDiag, ActDiag, NwDiag, PacketDiag, RackDiag), BPMN, Bytefield, C4 (with PlantUML), D2, DBML, Ditaa, Erd, Excalidraw, GraphViz, Mermaid, Nomnoml, Pikchr, PlantUML, Structurizr, SvgBob, Symbolator, TikZ, UMLet, Vega, Vega-Lite, WaveDrom, WireViz.

1. Kroki Features

The library Kroki great performance and speed. You can easily interact with the library using any HTTP client. It provides an HTTP API to create diagrams from textual descriptions and can handle both GET and POST requests. Kroki supports a diagram encoding facility and allows users to use deflate + base64 algorithm with GET request.

Kroki has several advantages, including:
  • Simple
        Kroki provides a unified API for all the diagram libraries.
  • Fast
        Built using a modern architecture, Kroki offers great performance.
  • Ready to use
        Diagrams libraries are written in a variety of languages: Haskell, Python, JavaScript, Go, PHP,                Java.
  • Free & Open source
        All the code is available on GitHub.

2. Quickstart Kroki On FreeBSD

To start Kroki on FreeBSD, you must first install JAVA. Read the previous article about installing Java on FreeBSD.

In this article, we will assume that you have installed JAVA on FreeBSD, so we will immediately continue by installing the JAVA library that will be used to run Kroki.
root@ns7:~ # pkg install graphviz erd svgbob
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 3 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        erd: 3.0.6_6
        graphviz: 9.0.0
        svgbob: 0.7.1_6

Number of packages to be installed: 3

The process will require 9 MiB more space.
820 KiB to be downloaded.

Proceed with this action? [y/N]: y
You can also create a Kroki installation manually, so it can be customized to your needs. To do this, you need to manually install the Kroki gateway server as a standalone executable jar, install any diagram libraries you want to use, and then run the gateway server jar file. Read more about Kroki Installation Guide.
mkdir -p root@ns7:~ # mkdir -p ~/kroki-server
root@ns7:~ # cd ~/kroki-server
root@ns7:~/kroki-server #
root@ns7:~/kroki-server # pwd
After we have finished creating the Kroki folder, we continue by downloading the Kroki file from Github.
root@ns7:~/kroki-server # fetch https://github.com/yuzutech/kroki/releases/download/v0.23.0/kroki-standalone-server-v0.23.0.jar
kroki-standalone-server-v0.23.0.jar                     16 MB 6184 kBps    03s
root@ns7:~/kroki-server # file kroki-standalone-server-v0.23.0.jar
kroki-standalone-server-v0.23.0.jar: Java archive data (JAR)
We start running the Kroki server.
root@ns7:~/kroki-server # java -jar kroki-server-v0.16.0.jar
The command above will open the Kroki web server on port 8080, you can change the port according to your FreeBSD system.

With a Web browser, open http://localhost:8000/.

The beauty of Kroki is that it also provides HTTP APIs to create diagrams that can be accessed using tools like cURL. Try Kroki for a happy diagramming!.

Iwan Setiawan

I Like Adventure: Mahameru Mount, Rinjani Mount I Like Writer FreeBSD

Post a Comment

Previous Post Next Post