Jeff Bailey
Written by Jeff Bailey
Learning resources, opinions, and facts about technology.

Learn Structurizr

Reading Time: 2.8 minutes
Listen to this post

The Basics

Structurizr is primarily a diagram generation tool created by Simon Brown, the creator of the C4 Model. The primary focus of the tool is the rapid generation of several diagrams with the same components. It appears that Simon was tired of the other tools that make you reinvent the wheel. I share the sentiment and believe that most diagram tools don’t facilitate reuse.

Primary Use Cases

  • Creation of architecture diagrams
  • Capture architecture decisions
  • Diagram review
  • Saving time!

Diagrams

Building diagrams can be very tedious, and Structrizr addresses this tedium. A typical workflow in Structurizr looks like this.

  1. Add diagram elements
  2. Create relationships
  3. Layout your diagram
  4. Download your diagrams

The CLI

Diagrams can be edited using the Structurizr command-line interface. If you’re on macOS you can follow these steps to start editing immediately.

# Install docker or some other docker-like app

wget -P /tmp https://raw.githubusercontent.com/structurizr/cli/master/examples/getting-started/workspace.dsl 
docker pull structurizr/lite
docker run -it --rm -p 8080:8080 -v /tmp:/usr/local/structurizr structurizr/lite
open http://localhost:8080/ # Start editing!

# Update /tmp with your preferred directory

Getting Help

I’ve found that learning how to use Structrizr will take time. I’ve barely scratched the surface of what it can do, but luckily you can get help.

I like to learn with examples. I found the Spring PetClinic example to be the best way to learn how to use it. Try exporting the workspace from the workspace menu.

Then import the workspace so you can explore how those diagrams were created.

Learn Structurizr – Beyond the Basics

References