Structurizr
Structurizr builds upon “diagrams as code”, allowing you to create multiple software architecture diagrams, in a variety of rendering tools, from a single model.
C4 model
Structurizr is specifically designed to support the C4 model for visualising software architecture, allowing you to reach the highest levels of maturity associated with creating software architecture diagramming.
Model-based
Structurizr is a modelling tool, allowing you to create multiple diagrams from a single model. Here’s an example with the Structurizr DSL:
workspace {
model {
user = person "User"
softwareSystem = softwareSystem "Software System" {
webapp = container "Web Application"
db = container "Database Schema"
}
user -> webapp "Uses"
webapp -> db "Reads from and writes to"
}
views {
systemContext softwareSystem "SystemContext" {
include *
autolayout lr
}
container softwareSystem "Containers" {
include *
autolayout lr
}
styles {
element "Person" {
shape person
}
}
}
}
Authoring tool independent
The Structurizr DSL shown above is just one way to author your software architecture models. There are also a number of programming language libraries (e.g. Structurizr for Java, and ports for .NET, Python, PHP, TypeScript, etc) that can be used to create software architecture models. The open JSON data format defines the data format for a Structurizr compatible “workspace”, which is the wrapper for a software architecture model and views.
With this in mind, Structurizr workspaces can be created in the following ways:
- Manually authored:
- Using the Structurizr DSL (example).
- Using Structurizr for Java (example) or one of the ports for .NET, Python, PHP, TypeScript, etc.
- Reverse-engineered:
- Using Structurizr for Java or one of the ports for .NET, Python, PHP, TypeScript, etc to write a program to reverse-engineer model information from source code, deployment scripts, your live deployment environment, logs, traces, telemetry data, etc).
- Hybrid approach:
- Use the Structurizr DSL to define software systems and containers, and reverse-engineer component level details via code.
- Use code to reverse-engineer a system catalog from Backstage (example), ServiceNow, etc and have teams add container and component level detail via the Structurizr DSL.
Rendering tool independent
Unlike most modelling tools, and because of the open JSON data format, Structurizr is rendering tool independent. For example, here are a number of visualisations of the same model.