We recommend using the C4 Model in conjunction with the Structurizr DSL as a way to automatically generate the C4 diagrams from code. This allows for the Structurizr code to be kept in the same repository as the code of the system, making it easier to keep the two up to date together.
A Structurizr Lite quick start template has been created that you can use as a starting point in your own projects.
All the code to define the model, relationships and views are held in a single workspace.dsl
file that Structurizr uses to build the visual diagams.
The following code will generate a very simple diagram showing a basic relationship between a user and a software system
workspace {
model {
u = person "User"
s = softwareSystem "Software System"
u -> s "uses"
}
views {
container s {
include *
autoLayout
}
}
Peter Bridger explains how to get up and running with Structurizr to create your own interactive diagrams, along with using the documentation and ADR abilities of Structurizr Lite using the quick start template mentioned previously.