Skip to content

DSL Basics

ArchTect uses the Structurizr DSL as its modeling language. This page covers the fundamental syntax you need to get started.

Every model starts with a workspace block containing a model and views:

workspace "My Workspace" "Optional description" {
model {
// elements and relationships go here
}
views {
// view definitions go here
}
}

See Elements for the full reference on Person, Software System, Container, Component, and Deployment Node — and how identifiers work.

The -> operator creates a relationship between two elements:

user -> system "Uses"
system -> db "Reads from and writes to"
webapp -> api "Makes API calls to" "HTTPS/JSON"

The format is: source -> destination "description" "technology"

You can also define relationships inside an element block using implicit this:

softwareSystem "My System" {
-> externalSystem "Sends data to"
}

See Relationships for more details.

See Groups, Tags & Properties for organizing your model and annotating elements with custom metadata.

Styles control the visual appearance of elements and relationships based on tags:

views {
styles {
element "Person" {
shape Person
background "#08427b"
color "#ffffff"
}
element "Database" {
shape Cylinder
}
relationship "Relationship" {
color "#707070"
thickness 2
}
}
}

Controls how identifiers are scoped:

workspace {
!identifiers hierarchical
model { ... }
}

Apply external themes for consistent styling:

views {
theme default
themes https://static.structurizr.com/themes/amazon-web-services-2023.01.31/theme.json
}
workspace "E-Commerce" "Online store architecture" {
model {
customer = person "Customer" "Shops online"
ecommerce = softwareSystem "E-Commerce Platform" {
webapp = container "Web App" "Customer-facing UI" "React"
api = container "API" "Business logic" "Node.js"
db = container "Database" "Product and order data" "PostgreSQL"
webapp -> api "Calls" "HTTPS"
api -> db "Reads/writes" "SQL"
}
customer -> webapp "Browses and purchases" "HTTPS"
}
views {
systemContext ecommerce "Context" {
include *
autoLayout
}
container ecommerce "Containers" {
include *
autoLayout
}
styles {
element "Person" {
shape Person
}
}
}
}