C4 Architecture

Compared to Structurizr

The format borrows its concepts, not its syntax, from the Structurizr DSL, created by Simon Brown, the author of the C4 model. If you know Structurizr, you already know the model; this page lists what maps to what and where it differs.

Why JSON

Models here are mostly written by agents. JSON lets them produce a valid document by construction (structured outputs) and validate it with any JSON Schema library, without a dedicated parser. Some choices follow from that:

Mapping

Structurizr DSL JSON
workspace "Name" "Description" { … } root: name, description
!include file.dsl include: ["file.json"]
person, softwareSystem, container, component model.people[], model.softwareSystems[], .containers[], .components[]
identifier assignment web = container … "id": "web"
tags, url, properties, group tags, url, properties: [{ name, value }], group
an external element (a convention in Structurizr, usually a tag with a grey style) "external": true, grey by default
a -> b "Description" "Technology" { "from": "a", "to": "b", "description": "…", "technology": "…" }
!impliedRelationships model.impliedRelationships (default true)
systemLandscape, systemContext, container, component views views[].type with the same names
dynamic <scope> [key] { a -> b "…" } { "type": "dynamic", "scope": …, "steps": [{ from, to, description }] }
include *, include a, exclude … include: ["*", "a"], exclude: […], plus { "tag": … } and { "relationship": … }
autoLayout lr 300 300 layout: { direction: "LR", rankSeparation: 300, nodeSeparation: 300 }
styles { element "Tag" { shape cylinder } } styles.elements: [{ "tag": "Tag", "shape": "cylinder" }]

Deliberate differences

Not supported