Examples

This page shows some examples of what you can do with Structurizr, with links to the source code in Java and/or C#.

Basic examples - static diagrams

Here are some basic examples of how to create software architecture diagrams that illustrate static structure.

techtribes.je

This is a system context diagram for the techtribes.je website, where the software architecture model has been created using a few lines of code. The diagram elements have been styled for use in presentations by increasing the size of the boxes, line thickness and font sizes.

GitHub TechTribesSystemContext.java

techtribes.je

Financial Risk System

Financial Risk System

This is a system context diagram for a sample solution to the financial risk system architecture kata used in Simon Brown's software architecture sketching workshop. Again, both the elements and the relationships have been styled.

GitHub FinancialRiskSystem.java

Financial Risk System

This is a more complete set of diagrams for a sample solution to the financial risk system architecture kata. This version was created with the .NET client library.

GitHub FinancialRiskSystem.cs

Financial Risk System

Widgets Limited

Widgets Limited

This workspace contains an Enterprise Context diagram and some System Context diagrams for a fictional reseller of widgets online, to illustrate the difference between the two diagram types.

GitHub WidgetsLimited.java WidgetsLimited.cs

Client-side encrypted workspace

Although all workspace data is encrypted, customers on a paid plan can choose to client-side encrypt their workspace for additional peace of mind. The passphrase for this example workspace is password.

GitHub ClientSideEncryptedWorkspace.java ClientSideEncryptedWorkspace.cs

A client-side encrypted workspace

Filtered views

Filtered Views

This workspace is an example of how to use filtered views to show "current state" and "future state" versions of the same diagram. Two filtered views are built on top of a single System Context diagram, each of which excludes elements and relationships with a specific tag. Layout information for common elements is shared between both diagrams.

GitHub FilteredViews.java

Basic examples - dynamic diagrams

Here are some basic examples of how to create software architecture diagrams that illustrate the dynamic interactions between elements in a static model. You can run the animation by pressing the button, or step through the animation using the space key.

Microservices

This is a simple example of what an asynchronous microservices style of architecture might look like. In addition to a diagram showing the static structure, there is also a dynamic diagram that shows the element interactions that take place in the scenario that a "customer update" event is generated. Some of these interactions happen in parallel.

GitHub MicroservicesExample.java

techtribes.je

Extract and supplement

These are more realistic examples where part of the software architecture model is extracted from the codebase and supplemented where necessary.

Spring PetClinic

This is a full C4 representation of the open source Spring PetClinic, which is a demonstration of how to build applications using the Spring MVC framework. The system context and container levels of the software architecture model have been created manually using a few lines of code.

The component level model has been extracted automatically from the codebase using a combination of static analysis and reflection. All of the components in the component model are linked to a source code file on GitHub too. You can see this by double-clicking any of the components on the web application component diagram.

You can also read the step-by-step description of the Spring PetClinic example.

GitHub SpringPetClinic.java

Spring PetClinic

techtribes.je

techtribes.je

This is a full C4 representation of the techtribes.je website. As with the Spring PetClinic example, the system context and container levels of the software architecture model have been created manually, while the component level is extracted automatically from the code.

A single component diagram for the web application would be far too cluttered, so instead there is one component diagram per vertical slice of the web application, one per Spring MVC controller in this case. This results in a larger number of smaller diagrams that are easier to understand, telling a different part of the same overall story. For example, there is a component diagram for just the home page.

This software architecture model is created by a number of separate programs that put the model together piece by piece. All of this is also integrated with the automated build script, which is run by a continuous build server to keep the model up to date.

GitHub Java

Contoso University

This is a full C4 representation of the Contoso University ASP.NET/Entity Framework sample application. The system context and container levels of the software architecture model have been created manually using a few lines of code.

The component level model has been extracted automatically from the codebase using a combination of static analysis and reflection. All of the components in the component model are linked to a source code file on GitHub too. You can see this by double-clicking any of the components on the web application component diagram.

GitHub Structurizr.cs

Contoso University

Documentation

Here are some examples of how to add supplementary documentation to the software architecture models.

Financial Risk System

The Financial Risk System workspace also includes some supplementary documentation, which has been created using the documentation feature and three Markdown/AsciiDoc files, one per section.

The program that creates the workspace simply inserts the contents of the Markdown files into the workspace and uploads it to Structurizr. The documentation is then rendered in the web browser.

GitHub FinancialRiskSystem.java FinancialRiskSystem.cs context.adoc functional-overview.md quality-attributes.md

Financial Risk System documentation

Structurizr on-premises API documentation

Structurizr on-premises API

The Structurizr on-premises API workspace is a small comprehensive example of visualising and documenting a software system.

The full source code for the on-premises API is hosted on GitHub and the build is configured to run on Travis CI. The Gradle build script compiles and assembles the web application before the Structurizr.java program creates a software architecture model and uploads it to Structurizr via the cloud API.

GitHub Structurizr.java Markdown and images build.gradle