DSL Basics
ArchTect uses the Structurizr DSL as its modeling language. This page covers the fundamental syntax you need to get started.
Workspace structure
Section titled “Workspace structure”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 }}Elements and identifiers
Section titled “Elements and identifiers”See Elements for the full reference on Person, Software System, Container, Component, and Deployment Node — and how identifiers work.
Relationships
Section titled “Relationships”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.
Tags, properties, and groups
Section titled “Tags, properties, and groups”See Groups, Tags & Properties for organizing your model and annotating elements with custom metadata.
Styles
Section titled “Styles”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 } }}Directives
Section titled “Directives”!identifiers
Section titled “!identifiers”Controls how identifiers are scoped:
workspace { !identifiers hierarchical model { ... }}Themes
Section titled “Themes”Apply external themes for consistent styling:
views { theme default themes https://static.structurizr.com/themes/amazon-web-services-2023.01.31/theme.json}Complete example
Section titled “Complete example”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 } } }}See also
Section titled “See also”- Elements — Person, Software System, Container, Component, Deployment Node
- Relationships — Defining and styling connections
- Groups, Tags & Properties — Organizing and annotating your model
- Views — View types, scoping, and include/exclude
- DSL Support Matrix — What ArchTect supports from the full Structurizr DSL
- DSL Reference — Detailed syntax reference