Skip to content
BENIBIX Learn

Structurizr

Design🛠️ Design ToolsDiagram Tools

Also known as Structurizr DSL, Structurizr Lite, workspace.dsl

A tool that draws C4 diagrams from one text model. Change it once, and every view updates.

Think of it like

It is like one toy house you take photos of. Each photo shows the same house from near or far.

Example

Jack writes a workspace.dsl file for his shop. It draws a context diagram and a container diagram from the same model, and the file lives in Git.

Why it matters

Diagrams drawn by hand drift apart as a system changes. One model keeps every view telling the same story.

Definition

Structurizr is a tool that draws C4 model diagrams from text. You write one model in its own language, the Structurizr DSL. The model lists the people, systems and parts, and how they link. Then you ask for views, and it draws each diagram from that one model. Rename a part once, and every diagram changes with it. Simon Brown, who made the C4 model, made it too.

Example code

structurizr
workspace {
  model {
    u = person "Shopper"
    s = softwareSystem "Online Shop"
    u -> s "Buys from"
  }
  views {
    systemContext s {
      include *
    }
  }
}
One shopper, one system and one link. The views part asks for a context diagram.
One model on the left. Each diagram on the right is a view drawn from it.

Common mistake

Drawing each diagram as its own little model. The gain comes from one model with many views, so a change lands everywhere.

Key takeaways

  1. 1
    Model as code. One text file holds the whole system.
  2. 2
    Many views. Each diagram is one view of the model.
  3. 3
    Made for C4. From the maker of the C4 model.

Learn it properly