The Structurizr DSL (as mentioned on the ThoughtWorks Tech Radar - Techniques - Diagrams as code) allows you to create multiple diagrams based upon the C4 model, in multiple output formats, from a single DSL source file. There are two options for authoring workspaces with the Structurizr DSL.
Structurizr CLI (recommended)
The Structurizr CLI is a command line utility, designed to be used in conjunction with the Structurizr DSL. It provides the ability to push/pull workspaces to/from the Structurizr cloud service or an on-premises installation, in additional to exporting the views defined in a DSL file to other formats (PlantUML, Mermaid, WebSequenceDiagrams, and Ilograph).
The CLI provides access to the full feature set offered by the Structurizr cloud service/on-premises installation and Structurizr DSL. See Getting started with the Structurizr CLI and DSL for more information.
If you'd rather not use the CLI, the Structurizr cloud service/on-premises installation provides an online DSL editor. The editor provides some basic syntax highlighting and the ability to use the DSL without installing the Structurizr CLI, but it does not provide access to the full feature set offered by the Structurizr cloud service/on-premises installation and Structurizr DSL - see the comparison table below.
The DSL editor can be opened using the link on your workspace summary page.
|Structurizr CLI||DSL editor|
|Architecture decision records||
|Element style icons||
||HTTPS URLs only|
||HTTPS URLs only|
|Export to PlantUML, Mermaid, WebSequenceDiagrams, and Ilograph|
The DSL editor also supports real-time collaboration, which can be opened using the link on your workspace summary page.
Anybody who has owner, admin, or read-write role-based access to your workspace can click the same button to join your collaboration session. The collaborative editor currently functions as follows:
- DSL source is synchronized in real-time.
- Each user can click the "Render" button to render the DSL as one or more diagrams.
- Clicking the "Save workspace" button will save the DSL definition, and automatically reload the diagrams for each collaborator.
At the moment, diagram layout changes (moving elements, adding vertices to relationships, etc) are not synchronized until the workspace is saved. This feature may be added at a later date.