Today's Deep-Dive: Kroki
Ep. 231

Today's Deep-Dive: Kroki

Episode description

Kroki is a technology designed to simplify visual communication by creating diagrams from text descriptions. It bridges the gap between plain text and complex visuals, making diagramming accessible without the need for specialized software. Kroki uses a unified API to support various diagram types, including PlantUML, BPMN, C4, GraphViz, Mermaid, and more, reducing the friction of using multiple tools. It is free, open-source, and hosted on GitHub, with a goal to provide a fast and efficient service. Kroki operates through an HTTP API, handling both GET and POST requests, and can output diagrams in formats like SVG or PNG. Its modular architecture allows it to manage different diagram types efficiently. Users can try Kroki via a free public service at kroki.io or self-host it with minimal resources. The tool aims to democratize visual communication, making it easier for anyone to create clear and shareable diagrams, which can be integrated into version control systems. This simplifies collaboration and ensures diagrams stay up-to-date with evolving systems.

Gain digital sovereignty now and save costs

Let’s have a look at your digital challenges together. What tools are you currently using? Are your processes optimal? How is the state of backups and security updates?

Digital Souvereignty is easily achived with Open Source software (which usually cost way less, too). Our division Safeserver offers hosting, operation and maintenance for countless Free and Open Source tools.

Try it now for 1 Euro - 30 days free!

Download transcript (.srt)
0:00

Have you ever found yourself, you know, needing to draw a diagram, maybe for a

0:04

system or a process,

0:05

or even just a simple flowchart, and you think about opening up some complicated

0:08

software and you

0:09

just, oh, sigh, all that dragging and dropping, finding the right shapes that can

0:13

be a real drag?

0:14

Well, today we're doing a deep dive into something that might just change all that

0:17

for you.

0:18

Kroki. It's this really interesting technology aiming to make visual communication

0:23

way easier.

0:24

But before we unpack exactly how it works and why it's getting attention,

0:27

a quick word from our supporter. This deep dive is brought to you by Safe Server.

0:32

Safe Server handles

0:33

hosting for software like Kroki and can really help with your digital

0:36

transformation. You can

0:37

find out more at www.safeserver.de. Okay, so our mission today is to demystify Kroki.

0:44

We've looked

0:44

at the info from their GitHub repository, their official website, and we're going

0:48

to break it down

0:48

so anyone really technical background or not can get what it is, how it works, and

0:53

why it might be

0:54

a game changer. Yeah, what's really fascinating, I think, is how Kroki bridges that

0:59

gap. You know,

1:00

between just plain text and these quite complex professional-looking visuals, it

1:05

makes diagramming

1:07

accessible in a way traditional tools often don't. Right, so let's unpack that. At

1:11

its core, Kroki

1:12

creates diagrams from text descriptions. You literally write some simple text,

1:17

maybe a few

1:17

lines that look a bit like code, and boom, out pops a diagram. Which sounds almost

1:22

too simple,

1:23

doesn't it? But why is that actually a big deal? Especially if you're maybe just

1:27

starting out with

1:28

diagrams. Most tools, you know, they have a specific interface you need to learn.

1:31

Drag and drop,

1:32

menus, sometimes different software for different types of diagrams. Kroki just

1:37

cuts through that.

1:37

Describe it in text, it draws it. And here's where it gets really powerful, I think.

1:41

Kroki is a

1:42

unified API. That means it acts like one single doorway to a whole bunch of

1:46

different diagram

1:47

tools and libraries. A massive array, actually. Yeah, we're talking things like

1:51

PlantUML,

1:52

which is great for sequence diagrams. BPMN for business processes. C4 for software

1:57

architecture.

1:58

Graph Fizz. Mermaid, which is super popular. Excalibur for more sketch-like

2:04

diagrams. Dita,

2:06

Erd. The list is huge. It really is. And connecting that to the bigger picture,

2:10

it just massively reduces friction. Think about developers, analysts, project

2:16

managers,

2:17

anyone needing to visualize something. Suddenly, you don't need to install five

2:21

different tools,

2:22

learn five interfaces, worry about compatibility. Exactly. Kroki aims to be ready

2:28

to use. No complex

2:29

setup for the public service. It's simple because of that unified API. And it's

2:34

free and open-source,

2:34

which is huge. It's on GitHub. The goal is a free service. Plus, it's designed to

2:38

be fast.

2:39

Modern architecture. Pretty efficient. So what does that mean for you listening? It

2:43

means you can whip

2:44

up quite sophisticated diagrams without needing graphic design skills or spending

2:49

ages learning

2:50

specific software. It's kind of a shortcut. It is. It's a shortcut to clear

2:53

communication.

2:54

I remember wrestling with alignment tools and drawing software for aging. Just

2:58

typing it sounds

2:59

so much better. Definitely. It forces you to think clearly, too, maybe. Like, you

3:03

have to describe

3:04

the relationships logically in text first. That's a really good point, actually. It's

3:08

not just about

3:08

the output. Writing it down forces clarity, unlike just, you know, randomly moving

3:13

boxes around on a

3:13

canvas. Okay, so we get what it is and why it's pretty significant. But how does

3:18

the magic happen?

3:19

How does Kroki turn your text into, say, an SVG or a PNG image? Right, the under-the-hood

3:26

stuff.

3:26

It mainly uses an HTTP API. An API is just, what, a standardized way for computer

3:32

programs to talk

3:33

to each other, send information back and forth. Okay. And Kroki handles both Git-T

3:37

and Post-Secret

3:37

Requests, basically ways of sending instructions. So let's take the GeT request

3:41

first. That's where

3:42

the diagram description gets encoded into the URL itself. Exactly. So that simple

3:46

example,

3:46

bob-alice.hell, hello, in PlantUML. Yeah. It gets compressed and encoded into this

3:51

string of characters

3:52

and becomes part of the URL, like geet-plantl-mells-vg followed by that encoded

3:57

string.

3:57

syskj2rkt3-coccanellerr1.io4 is a dose of 70,000 or something similar. Yeah,

4:03

something like that.

4:03

It uses deflate compression and then base64 encoding. Sounds complex, but the point

4:08

is it

4:08

packages your text neatly into the web address. But you don't need to do the

4:12

encoding yourself

4:13

necessarily, right? There are tools for that. Absolutely. The docs even show a

4:17

Python one-liner

4:18

to do it, but often you'd use a library or an integration that handles it. However,

4:23

there's

4:23

also the POST request method. Which is often simpler for users. Generally, yeah.

4:28

Especially

4:28

for longer diagrams. With POST, you don't stuff everything into the URL. You send

4:33

the diagram

4:34

source text, the type of diagram, and the output format you want, like SVG or PNG.

4:40

Usually as a

4:40

JSON object in the request body. So that Bob Assala sat hello example would just

4:45

look like.

4:46

Sending a little package with diagram source is the text. Diagram type is plantable.

4:50

Output format

4:51

is SVG. Precisely. Much cleaner, much more readable, especially when your diagram

4:55

description gets

4:56

longer. And you can even send plain text directly, apparently, with the right

5:00

headers. You can, yeah.

5:01

Setting the content type header to text plane, that may be the accept header for

5:05

the output format.

5:06

Or even put the output format in the URL path for a post C, like post T plantamalsvg.

5:11

Okay. So the

5:12

main point is flexibility. You can talk to Kroki using pretty much any standard web

5:17

tool or code.

5:18

Any HTTP client. Exactly. Browser, command line, like C or RL, scripting languages.

5:24

So how does it manage all those different diagram types then? Mermaid, plant UML,

5:28

GraphViz. They're all separate projects. Ah, that's down to its architecture.

5:32

It's quite clever and modular. There's a central server. It's actually a Java web

5:38

server acting

5:38

as the main entry point, the gateway. Okay. But then for many of the individual

5:42

diagram libraries,

5:43

it uses separate companion servers or sometimes Node.js command line tools. So when

5:48

a request

5:49

comes in for, say, mermaid, the main server passes it off to the specific mermaid

5:54

service.

5:55

Ah, so it's like a manager directing traffic to different specialists.

5:58

Exactly. It means they can add support for new diagram types relatively easily just

6:04

by adding a

6:04

new companion service without messing with the core gateway. That makes sense. Keeps

6:08

it nimble.

6:08

Very much so. It allows it to evolve as new tools pop up.

6:11

Right. So if someone's listening and thinking, okay, I want to try this,

6:14

what's the easiest way in? The absolute simplest way is just

6:17

go to croquis.io. They run croquis as a free public service right there.

6:23

Ready to use in the browser or through those API calls we talked about?

6:27

Yep. No installation needed. Just start sending requests

6:30

or use the simple interface they have on the site. Perfect for trying it out.

6:34

But what if you want to run it yourself? Maybe for privacy or internal use?

6:38

You could do that too. It's open source. Remember, you can self-manage it,

6:42

download the code, install it on your own server. The documentation mentions it

6:46

probably requires a bit of Linux know-how to set up smoothly.

6:50

Okay, so maybe not for total beginners to self-host, but the options there.

6:54

Right. But for just using it, that free service is fantastic.

6:58

And it's supported by sponsors like Exoscale providing servers, which keeps it

7:02

running.

7:03

And that commitment to being free and open source really stands out. MIT license.

7:08

Yeah, very permissive.

7:09

Available on GitHub for anyone to look at, contribute to.

7:12

And you can host it yourself with pretty minimal resources, apparently.

7:15

They even say on the site, crookie is never going away.

7:19

That's quite a statement. Shows confidence in the model.

7:21

It does. And that open approach really encourages community involvement.

7:26

The sources mentioned they're actively planning the future,

7:28

even have a questionnaire out asking for user input.

7:32

Ah, so they're listening to users.

7:35

Seems like it. It reflects that idea that more perspectives make things better.

7:38

Plus, they provide good resources, a cheat sheet, lots of examples.

7:42

Decent documentation makes it easier to get started.

7:45

So it's not just code thrown over the wall, it's an active project.

7:49

Definitely feels like a living project, yeah.

7:51

Okay, so stepping back a bit.

7:53

Beyond just making diagrams quickly, what's the bigger picture here?

7:57

Why does simplifying visualization like this really matter?

8:00

Well, knowledge is only useful if it's understood and can be applied, right?

8:04

Visuals are just incredibly powerful for that.

8:07

Croquis makes creating those visuals almost trivial.

8:10

And think about modern workflows.

8:12

You can actually store the text for your diagram right alongside your code in Git.

8:16

So the diagram becomes part of your version control.

8:19

Exactly.

8:20

Diagrams is code.

8:22

It means your documentation, your architecture diagrams,

8:25

can evolve right along with the system itself.

8:28

They stay up to date.

8:29

That's huge.

8:30

No more outdated diagrams floating around.

8:32

Hopefully fewer anyway.

8:34

It makes collaboration smoother, turns abstract ideas into something concrete and

8:38

shareable.

8:39

And it really lowers the barrier to entry, doesn't it?

8:41

It democratizes it.

8:42

You don't need to be a designer.

8:44

You don't need expensive software licenses.

8:46

Anyone who can write a bit of structured text can create a clear visual.

8:51

It empowers more people to communicate their ideas effectively, quickly too.

8:56

Yeah, speed seems key.

8:57

And think about those industries mentioned in the sources,

8:59

DevSecOps, healthcare, finance, manufacturing.

9:03

Right, lots of complex systems there.

9:04

Absolutely critical to understand workflows, architectures, processes in those

9:08

fields.

9:09

Kroki offers a simple, consistent way to generate those vital diagrams

9:13

across different teams, different projects.

9:15

So it promotes consistency as well.

9:17

And maybe even better understanding,

9:19

because you had to articulate it clearly in text first, like we discussed.

9:23

We've covered a lot of ground here on Kroki.

9:25

From what it is creating diagrams from text.

9:27

Using that unified API for tons of formats.

9:30

To how it works with HTTP requests, GET and POST.

9:34

And its modular architecture.

9:36

And how you can use the free service or self-host the open source tool.

9:39

It really boils down to efficiency, accessibility,

9:43

and making complex stuff easier to grasp.

9:46

Hopefully this deep dive sparks some ideas, maybe an aha moment,

9:49

about how text diagram could help you.

9:52

Yeah, it's a powerful concept.

9:53

So maybe think about it.

9:55

What's one complex idea or process you've struggled to visualize recently?

9:59

Perhaps Kroki is the tool to finally make that clear.

10:02

For yourself or for your team.

10:04

And before we wrap up, a huge thank you once again to our sponsor, Safe Server.

10:09

They focus on hosting software solutions and supporting digital transformation

10:12

journeys.

10:13

Check them out at www.safeserver.de.

10:16

Great stuff.

10:17

Until then, keep exploring, keep learning, and keep asking questions.

10:17

Until then, keep exploring, keep learning, and keep asking questions.