Visualise

Unlike traditional modeling tools, Structurizr does not provide a "drag and drop" editor to create diagrams. Instead, you create a software architecture model using code and upload it as a JSON document via the web API.

public static void main(String[] args) throws Exception {
Workspace workspace = new Workspace("Getting Started", "This is a model of my software system.");
Model model = workspace.getModel();

Person user = model.addPerson("User", "A user of my software system.");
SoftwareSystem softwareSystem = model.addSoftwareSystem("Software System", "My software system.");
user.uses(softwareSystem, "Uses");

ViewSet viewSet = workspace.getViews();
SystemContextView contextView = viewSet.createSystemContextView(softwareSystem, "SystemContext", "An example of a System Context diagram.");
contextView.addAllSoftwareSystems();
contextView.addAllPeople();

Styles styles = viewSet.getConfiguration().getStyles();
styles.addElementStyle(Tags.SOFTWARE_SYSTEM).background("#1168bd").color("#ffffff");
styles.addElementStyle(Tags.PERSON).background("#08427b").color("#ffffff").shape(Shape.Person);

StructurizrClient structurizrClient = new StructurizrClient("key", "secret");
structurizrClient.putWorkspace(25441, workspace);
}

And here's the resulting diagram when you open it in Structurizr, where the layout of the diagrams can be modified.

A simple diagram
A simple diagram
A diagram key is automatically generated for you, based upon the styles and shapes defined in the model.

The code used to create the software architecture model can be thought of as an executable domain specific language, or an executable architecture description language. This offers a number of opportunities over using a static textual description, such as the ability to use the programming language's reflection and static analysis capabilities to find and extract components from the codebase being documented. There are currently two client libraries; Structurizr for Java and Structurizr for .NET, both of which are open source. The web API is open and documented too, providing you the ability to create your own tooling if desired.

Software architecture diagrams as text

Structurizr also provides a free "Express" feature that allows you to create a single diagram without creating and uploading a workspace via the API. This is useful if you need to quickly create a simple software architecture diagram.

To use this feature, simply head to Structurizr Express where you'll find a regular diagram editing page along with some controls on the left to define the diagram.

Structurizr Express