Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Lesson 4 of 6 · Lab · 25 min · revision 1

Diagrams as code in a docs-as-code workflow

Build a small docs-as-code setup: a Structurizr model with six views, arc42-style sections and one decision record as Markdown, a Python check that fails when the model drifts from what runs, and one script that validates, inspects, checks and renders it all, on your laptop and in CI.

Contentsand lesson path

What you will learn

  • Draw C4 system context, container and component diagrams with consistent notation, legends and scope.
  • Add deployment and dynamic views (C4 or UML sequence and state diagrams) where static structure alone does not explain runtime behavior.
  • Assemble a lean architecture document (for example arc42 sections) kept as code next to the system it describes.

01. Goal and setup

Docs as code means treating documentation like source code: plain-text files in the same repository as the system, changed in the same pull requests, and checked by the same CI pipeline. In this lab you set that up for the ride-booking system from lessons 2 and 3. At the end, one command validates the model, reviews its notation, compares it with what actually runs, and renders a static web site of diagrams and docs. The same command runs in CI.

You need Java 21 for Structurizr (we used Eclipse Temurin 21.0.13) and Python 3.12 with PyYAML 6.0.3. Structurizr ships as one .war file; this lab was tested with release 2026.10.26. It is a 220 MB download, so keep it outside the repository. If you prefer Docker, see the troubleshooting box after step 5.

Project layout at the end of the lab
ride-docs/
├── docs/architecture/
│   ├── workspace.dsl          step 1: the model and its six views
│   ├── sections/*.md          step 3: five arc42-style sections
│   └── decisions/0001-*.md    step 3: one decision record (MADR format)
├── deploy/compose.yaml        step 4: what actually runs in staging
├── tools/check_docs.py        step 4: the drift check
└── check-docs.sh              step 4: one script for laptop and CI
Terminal (macOS or Linux; on Windows use WSL or Git Bash)
mkdir ride-docs && cd ride-docs
mkdir -p docs/architecture/sections docs/architecture/decisions deploy tools
python3.12 -m venv .venv && source .venv/bin/activate
python -m pip install pyyaml==6.0.3
mkdir -p ~/tools && curl -fsSL -o ~/tools/structurizr.war \
  https://download.structurizr.com/structurizr-2026.10.26.war
export STRUCTURIZR_WAR=~/tools/structurizr.war WS=docs/architecture/workspace.dsl
java -jar "$STRUCTURIZR_WAR" version | grep -o "structurizr: .*"
Expected output
structurizr: 2026.10.26

02. Step 1: Write the model and its views

Save the file below as docs/architecture/workspace.dsl. It is the model from lessons 2 and 3 in one file, so copy it as it is rather than reading it line by line again. Only three things are new:

  • A properties block at the top lowers one inspection rule, explained in step 2.
  • Every container that runs on a server has a deploy.service property that names its service in deploy/compose.yaml. The queue names broker, the service that hosts it.
  • Containers that run on users' devices carry the tag Client instead, because no server file lists them.
Structurizr DSL · docs/architecture/workspace.dsl
workspace "Ride booking" "C4 model of the ride-booking system." {

    properties {
        "structurizr.inspection.model.relationship[person->container].technology" \
            ignore
        "structurizr.inspection.model.relationship[person->softwaresystem].technology" \
            ignore
    }

    model {
        rider = person "Rider" "Books rides, follows the driver and pays."
        driver = person "Driver" "Accepts ride offers and drives riders."
        agent = person "Support agent" "Answers riders and issues refunds."

        payments = softwareSystem "Payment provider" \
            "Authorises and captures card payments." "External"
        maps = softwareSystem "Maps platform" \
            "Routes, travel times and address search." "External"
        push = softwareSystem "Push service" \
            "Delivers notifications to iOS and Android phones." "External"

        rides = softwareSystem "Ride Booking System" {
            description "Matches riders with drivers, prices trips and takes payment."

            riderApp = container "Rider app" {
                description "Requests rides, shows the driver on a map, pays."
                technology "TypeScript, React Native"
                tags "Client,Mobile"
            }
            driverApp = container "Driver app" {
                description "Receives ride offers and streams the phone's GPS position."
                technology "TypeScript, React Native"
                tags "Client,Mobile"
            }
            console = container "Support console" {
                description "Lets support agents search trips and issue refunds."
                technology "TypeScript, React single-page app"
                tags "Client,Browser"
            }
            api = container "Booking API" {
                description "Quotes fares, creates rides and takes payment."
                technology "Python 3.12, FastAPI"
                properties {
                    "deploy.service" "booking-api"
                }
                trips = component "Trips endpoint" \
                    "Handles quote, ride and refund requests." "FastAPI router"
                fares = component "Fare quoter" \
                    "Prices a trip from route distance and time." "Python module"
                mapsClient = component "Maps client" \
                    "Calls the maps platform for routes." "httpx"
                payClient = component "Payment client" \
                    "Authorises, captures and refunds card payments." "httpx"
                repo = component "Trip repository" \
                    "Reads and writes trips." "SQLAlchemy"
                publisher = component "Request publisher" \
                    "Publishes ride requests to the queue." "aio-pika"
            }
            dispatch = container "Dispatch worker" {
                description "Offers each ride request to nearby drivers, one at a time."
                technology "Python 3.12"
                properties {
                    "deploy.service" "dispatch-worker"
                }
            }
            gateway = container "Location gateway" {
                description "Keeps WebSocket connections to driver apps open."
                technology "TypeScript, Node.js 22"
                properties {
                    "deploy.service" "location-gateway"
                }
            }
            tripDb = container "Trip database" {
                description "Trips, fares, offers and payments."
                technology "PostgreSQL 18 schema"
                tags "Database"
                properties {
                    "deploy.service" "trip-db"
                }
            }
            locStore = container "Location store" {
                description "Latest position of every online driver, with a geo index."
                technology "Redis"
                tags "Database"
                properties {
                    "deploy.service" "location-store"
                }
            }
            queue = container "Ride request queue" {
                description "Ride requests waiting for the dispatch worker."
                technology "RabbitMQ queue"
                tags "Queue"
                properties {
                    "deploy.service" "broker"
                }
            }
        }

        rider -> riderApp "Requests rides and pays with"
        driver -> driverApp "Accepts ride offers with"
        agent -> console "Looks up trips and refunds with"
        riderApp -> api "Requests quotes and rides" "JSON/HTTPS"
        driverApp -> api "Accepts or declines offers" "JSON/HTTPS"
        driverApp -> gateway "Streams GPS positions every 4 s" "WebSocket"
        console -> api "Searches trips, issues refunds" "JSON/HTTPS"
        api -> tripDb "Reads and writes trips" "SQL over TCP"
        api -> queue "Publishes ride requests to" "AMQP"
        api -> payments "Authorises and captures payments" "JSON/HTTPS"
        api -> maps "Gets routes and travel times" "JSON/HTTPS"
        dispatch -> queue "Takes ride requests from" "AMQP"
        dispatch -> locStore "Finds drivers near the pickup" "Redis protocol"
        dispatch -> tripDb "Records offers and matches" "SQL over TCP"
        dispatch -> push "Sends ride offers" "JSON/HTTPS"
        gateway -> locStore "Saves each driver's position" "Redis protocol"
        push -> driverApp "Delivers offer notifications to" "APNs/FCM"

        riderApp -> trips "Requests quotes and rides" "JSON/HTTPS"
        driverApp -> trips "Accepts or declines offers" "JSON/HTTPS"
        console -> trips "Searches trips, issues refunds" "JSON/HTTPS"
        trips -> fares "Asks for a fare quote" "Python call"
        fares -> mapsClient "Gets distance and time" "Python call"
        mapsClient -> maps "Gets routes and travel times" "JSON/HTTPS"
        trips -> payClient "Authorises, captures or refunds" "Python call"
        payClient -> payments "Authorises and captures payments" "JSON/HTTPS"
        trips -> repo "Saves and loads trips" "Python call"
        repo -> tripDb "Reads and writes trips" "SQL over TCP"
        trips -> publisher "Asks for a driver" "Python call"
        publisher -> queue "Publishes ride requests to" "AMQP"

        staging = deploymentEnvironment "Staging" {
            deploymentNode "Staging VM" "One virtual machine." "Ubuntu 24.04, Docker" {
                deploymentNode "Docker Compose" "Runs deploy/compose.yaml." "Docker" {
                    containerInstance api
                    containerInstance dispatch
                    containerInstance gateway
                    containerInstance tripDb
                    containerInstance locStore
                    containerInstance queue
                }
            }
        }

        production = deploymentEnvironment "Production" {
            deploymentNode "Rider's phone" "Rider's own device." "iOS or Android" {
                containerInstance riderApp
            }
            deploymentNode "Driver's phone" "Driver's own device." "iOS or Android" {
                containerInstance driverApp
            }
            deploymentNode "Agent's PC" "Support office computer." "Web browser" {
                containerInstance console
            }
            deploymentNode "Cloud region" "One region, three zones." "Public cloud" {
                lb = infrastructureNode "Load balancer" \
                    "Terminates TLS, routes /api and /ws." "Managed L7 load balancer"
                deploymentNode "Kubernetes" "Runs the stateless services." "Managed" {
                    deploymentNode "booking-api" "Pod" "Docker" "" 3 {
                        apiPod = containerInstance api
                    }
                    deploymentNode "dispatch-worker" "Pod" "Docker" "" 2 {
                        containerInstance dispatch
                    }
                    deploymentNode "location-gateway" "Pod" "Docker" "" 2 {
                        gatewayPod = containerInstance gateway
                    }
                }
                deploymentNode "PostgreSQL" "Primary and standby." "Managed, v18" {
                    containerInstance tripDb
                }
                deploymentNode "Redis" "Rebuilt from GPS updates." "Managed, v8" {
                    containerInstance locStore
                }
                deploymentNode "RabbitMQ" "Three-node cluster." "Managed, v4" {
                    containerInstance queue
                }
                lb -> apiPod "Forwards API requests to" "HTTPS"
                lb -> gatewayPod "Forwards WebSocket connections to" "WSS"
            }
        }
    }

    views {
        systemContext rides "Context" {
            include *
            autolayout lr
        }
        container rides "Containers" {
            include *
            autolayout lr
        }
        component api "ApiComponents" {
            include *
            autolayout lr
        }
        dynamic rides "RequestRide" "Rider requests a ride; a driver gets an offer." {
            riderApp -> api "Requests a ride from pickup to drop-off"
            api -> maps "Gets the route distance and time"
            api -> payments "Authorises the quoted fare"
            api -> tripDb "Saves the trip as REQUESTED"
            api -> queue "Publishes the ride request"
            dispatch -> queue "Takes the ride request"
            dispatch -> locStore "Finds online drivers near the pickup"
            dispatch -> push "Sends the offer to the nearest driver"
            push -> driverApp "Shows the offer for 15 seconds"
            autolayout lr
        }
        deployment rides staging "Staging" {
            include *
            autolayout lr
        }
        deployment rides production "Production" {
            include *
            autolayout lr
        }
        styles {
            element "Person" {
                shape person
            }
            element "Mobile" {
                shape mobileDevicePortrait
            }
            element "Browser" {
                shape webBrowser
            }
            element "Database" {
                shape cylinder
            }
            element "Queue" {
                shape pipe
            }
            element "External" {
                background #6b6b6b
                color #ffffff
            }
        }
    }

    configuration {
        scope softwaresystem
    }
}
Terminal
java -jar "$STRUCTURIZR_WAR" validate -workspace "$WS" && echo valid
Expected output
valid

validate prints nothing when the file is correct, so the echo confirms it. It checks syntax and references: that every identifier exists, that each element suits the view it is placed in, and that every step of a dynamic view follows a relationship in the model.

03. Step 2: Let the tool review the notation

Valid is not the same as readable. Structurizr's inspect command runs review rules much like a code linter: missing descriptions, containers without a technology, relationships without a protocol, and documentation that is missing. -severity error,warning shows only problems that should fail a build, and the command exits with a non-zero code when it shows any.

Terminal
java -jar "$STRUCTURIZR_WAR" inspect -workspace "$WS" -severity error,warning
Expected output (exit code 1; long lines wrapped to fit this page)
ERROR  | model.softwaresystem.documentation | The software system "Ride Booking System"
    has containers, but is missing documentation.
ERROR  | model.softwaresystem.decisions     | The software system "Ride Booking System"
    has containers, but is missing decisions.

Two errors, and both are about documentation: a system with containers should come with written docs and recorded decisions. Step 3 adds both.

Without -severity you also see six IGNORE lines: the three arrows from people and the system-level arrow each one implies. By default, inspections want a technology on every relationship, but the C4 notation guidance asks for a protocol on arrows between containers, where it tells an operator something. A rider tapping a screen has no protocol worth writing, and typing "Touchscreen" everywhere would teach readers nothing. So the two properties at the top of the file lower this one rule for arrows that start at a person, and only those, in the model where reviewers can see it.

04. Step 3: Add lean docs and one decision

arc42 is a free template that organises architecture documentation into twelve sections; lesson 5 discusses how to choose among them. Here you add five short ones and one decision record, all as Markdown. Each section file starts with a ## heading, which Structurizr turns into a numbered section. ![](embed:Key) places a live diagram from the model in the text. The decision record follows MADR, a common Markdown template for architecture decision records (ADRs): front matter with the status and date, then the problem, the options, the choice and its consequences. The skill Architecture Decision Records covers writing them well.

Paste the block below into the terminal, in the ride-docs folder. Each cat command writes one file, so you can open them afterwards and read them.

Bash · paste into the terminal: writes five files in sections/ and one in decisions/
cat > docs/architecture/sections/01-introduction-and-goals.md <<'EOF'
## Introduction and goals

Riders book a car from a phone; nearby drivers get the offer within seconds.

Quality goals, most important first:

1. A rider sees a fare quote within 2 s for 95% of requests.
2. No trip is charged twice, even when a request is retried.
3. A new developer can run the whole system locally in one hour.
EOF
cat > docs/architecture/sections/03-context-and-scope.md <<'EOF'
## Context and scope

The system owns booking, dispatch and payment orchestration. Card payments,
maps and push delivery are bought in from external providers.

![](embed:Context)
EOF
cat > docs/architecture/sections/05-building-block-view.md <<'EOF'
## Building block view

Containers, with the Booking API opened up one level.

![](embed:Containers)

![](embed:ApiComponents)
EOF
cat > docs/architecture/sections/06-runtime-view.md <<'EOF'
## Runtime view

The most important scenario: a rider requests a ride.

![](embed:RequestRide)
EOF
cat > docs/architecture/sections/07-deployment-view.md <<'EOF'
## Deployment view

Staging runs everything on one VM with Docker Compose (`deploy/compose.yaml`).
Production runs the stateless services on Kubernetes and uses managed data stores.

![](embed:Staging)

![](embed:Production)
EOF
cat > docs/architecture/decisions/0001-separate-dispatch-worker.md <<'EOF'
---
status: accepted
date: 2026-11-02
---

# Run dispatch as a separate worker

## Context and Problem Statement

Matching a ride can take up to 45 s (three offers of 15 s each). Holding an
HTTP request open that long ties up API workers and fails on mobile networks.

## Considered Options

* Match drivers inside the Booking API request
* Queue the request and match in a separate dispatch worker

## Decision Outcome

Chosen option: "Queue the request and match in a separate dispatch worker",
because the API can answer at once and matching can take as long as it needs.

### Consequences

* Good, because API latency no longer depends on how fast drivers answer.
* Bad, because there is one more deployable unit and a queue to operate.
EOF

Now attach both folders to the software system: add the two !docs and !adrs lines below the system's description in workspace.dsl, so that lines 22 to 25 read like this. Paths are relative to the DSL file. Then run the inspection again.

Structurizr DSL · docs/architecture/workspace.dsl, lines 22–25
        rides = softwareSystem "Ride Booking System" {
            description "Matches riders with drivers, prices trips and takes payment."
            !docs sections
            !adrs decisions madr
Terminal
java -jar "$STRUCTURIZR_WAR" inspect -workspace "$WS" \
  -severity error,warning && echo "no errors or warnings"
Expected output
no errors or warnings

The inspections also read the docs. If a section embeds a view key that does not exist, for example after someone renames a view, inspect fails with a documentation.embeddedview error naming the missing key. As long as the docs are published only after this check passes, a broken diagram link cannot reach readers.

05. Step 4: Compare the model with what runs, in one script

Validation and inspection compare the model with itself. Neither knows that someone added a service to the deployment last week. For that you need an independent source of truth: here, the Compose file that defines staging. Save it as deploy/compose.yaml:

YAML · deploy/compose.yaml
# Staging: what actually runs. The architecture model must match this file.
services:
  booking-api:
    image: registry.example.com/rides/booking-api:1.42.0
    depends_on: [trip-db, broker]
  dispatch-worker:
    image: registry.example.com/rides/dispatch-worker:1.42.0
    depends_on: [broker, location-store, trip-db]
  location-gateway:
    image: registry.example.com/rides/location-gateway:1.42.0
    depends_on: [location-store]
  trip-db:
    image: postgres:18-alpine
  location-store:
    image: redis:8-alpine
  broker:
    image: rabbitmq:4-management-alpine

The check reads Structurizr's JSON export of the model, so it does not have to parse the DSL. It applies three rules:

  1. Every service in compose.yaml is claimed by a container's deploy.service, and every claimed service exists. Containers tagged Client are exempt.
  2. Every depends_on entry matches a relationship in the model, in the same direction. This works because the model draws arrows from the element that starts the interaction. Compose uses depends_on for start-up order, so confirm that it also lists real connections in your project before you rely on this rule.
  3. Every view is embedded in at least one doc section, so no diagram exists that nobody can find. (inspect already catches the opposite case.)

Save it as tools/check_docs.py:

Python 3.12 · tools/check_docs.py
"""Fail when the architecture model, its docs and deploy/compose.yaml disagree."""
import json
import re
import sys
from pathlib import Path

import yaml

EMBED = re.compile(r"!\[[^\]]*\]\(embed:([A-Za-z0-9_-]+)\)")


def check(workspace: dict, compose: dict) -> list[str]:
    problems = []
    system = next(s for s in workspace["model"]["softwareSystems"]
                  if s.get("containers"))
    containers = system["containers"]
    service_of = {c["id"]: c["properties"]["deploy.service"] for c in containers
                  if "deploy.service" in c.get("properties", {})}
    services = compose["services"]

    # 1. Every service that runs is claimed by a container, and vice versa.
    for name in sorted(set(services) - set(service_of.values())):
        problems.append(f"service '{name}' runs, but no container claims it")
    for c in containers:
        name = service_of.get(c["id"])
        if name is None and "Client" not in c["tags"].split(","):
            problems.append(f"container '{c['name']}' has no deploy.service")
        elif name is not None and name not in services:
            problems.append(f"container '{c['name']}' claims '{name}', "
                            "which does not run")

    # 2. Every depends_on in compose.yaml is a relationship in the model.
    edges = {(service_of.get(r["sourceId"]), service_of.get(r["destinationId"]))
             for c in containers for r in c.get("relationships", [])}
    for name, spec in sorted(services.items()):
        for dep in spec.get("depends_on", []):
            if (name, dep) not in edges:
                problems.append(f"'{name}' depends on '{dep}', "
                                "but the model has no such relationship")

    # 3. Every view appears in the docs. (inspect already rejects embeds of
    #    views that do not exist.)
    keys = {v["key"] for views in workspace["views"].values()
            if isinstance(views, list) for v in views}
    sections = system.get("documentation", {}).get("sections", [])
    embedded = {k for s in sections for k in EMBED.findall(s["content"])}
    for key in sorted(keys - embedded):
        problems.append(f"view '{key}' is not embedded in any doc section")
    return problems


def main() -> int:
    workspace = json.loads(Path(sys.argv[1]).read_text(encoding="utf-8"))
    compose = yaml.safe_load(Path(sys.argv[2]).read_text(encoding="utf-8"))
    problems = check(workspace, compose)
    for problem in problems:
        print(f"DRIFT: {problem}")
    if problems:
        print(f"{len(problems)} problem(s): fix the model, docs or compose.yaml.")
        return 1
    print("OK: model, docs and compose.yaml agree.")
    return 0


if __name__ == "__main__":
    sys.exit(main())

Put the Structurizr steps and the check in one script that runs the same way on your laptop and in CI. It stops at the first failure and keeps Structurizr's log quiet unless something goes wrong. Its last step renders a static HTML site with every diagram and doc section; no browser is needed on the build machine, because the diagrams are drawn when someone opens the page. Everything it generates goes to build/, so add build/ and .venv/ to .gitignore. Save it as check-docs.sh:

Bash · check-docs.sh
#!/usr/bin/env bash
# Architecture docs checks. Run the same script on your machine and in CI.
set -euo pipefail
WAR=${STRUCTURIZR_WAR:?set STRUCTURIZR_WAR to the path of structurizr.war}
WS=docs/architecture/workspace.dsl
mkdir -p build

quiet() {  # run a Structurizr command; print its log only when it fails
    if ! java -jar "$WAR" "$@" > build/structurizr.log 2>&1; then
        cat build/structurizr.log
        exit 1
    fi
}

echo "1/4 validate the DSL"
quiet validate -workspace "$WS"
echo "2/4 inspect notation and docs"
quiet inspect -workspace "$WS" -severity error,warning
echo "3/4 compare the model with the docs and deploy/compose.yaml"
quiet export -workspace "$WS" -format json -output build
python tools/check_docs.py build/workspace.json deploy/compose.yaml
echo "4/4 render the static site"
quiet export -workspace "$WS" -format static -output build/site
echo "All architecture docs checks passed."
Terminal
chmod +x check-docs.sh
./check-docs.sh
ls build/site
Expected output
1/4 validate the DSL
2/4 inspect notation and docs
3/4 compare the model with the docs and deploy/compose.yaml
OK: model, docs and compose.yaml agree.
4/4 render the static site
All architecture docs checks passed.
css
img
index.html
js
workspace.js

Open build/site/index.html in a browser to see the six diagrams, the five sections and the decision.

06. Step 5: Catch drift, then fix the model

A teammate makes the Booking API show nearby cars on the rider's map. The API now reads driver positions from Redis, and their pull request updates compose.yaml, but nobody touches the architecture model. Make the same change: edit the booking-api entry so its depends_on line matches the excerpt below, then run ./check-docs.sh again.

YAML · deploy/compose.yaml, lines 3–5 after the edit
  booking-api:
    image: registry.example.com/rides/booking-api:1.42.0
    depends_on: [trip-db, broker, location-store]
Expected output (exit code 1)
1/4 validate the DSL
2/4 inspect notation and docs
3/4 compare the model with the docs and deploy/compose.yaml
DRIFT: 'booking-api' depends on 'location-store', but the model has no such relationship
1 problem(s): fix the model, docs or compose.yaml.

The check found the gap that review missed. The fix belongs in the model, not in the check: if the API really reads the location store, the container view should say so. Add this relationship to workspace.dsl, directly below the api -> maps line, and run ./check-docs.sh once more.

Structurizr DSL · docs/architecture/workspace.dsl, lines 111–112 after the edit
        api -> maps "Gets routes and travel times" "JSON/HTTPS"
        api -> locStore "Reads driver positions for the map" "Redis protocol"
Expected output
1/4 validate the DSL
2/4 inspect notation and docs
3/4 compare the model with the docs and deploy/compose.yaml
OK: model, docs and compose.yaml agree.
4/4 render the static site
All architecture docs checks passed.

Run the same script in CI on every pull request, and make it a required check. Then a new or renamed service, or a new depends_on entry, without a matching change to the model fails the build in the pull request that caused it. Changes to images, ports or settings pass, as they should: the model does not describe them. "Apply it" below has a GitHub Actions workflow that does this.

07. Check your understanding

Practice check · 3 questions

Reading the docs checks

Predict what the checks in this lab do.

Q1. A new `receipt-mailer` service with `depends_on: [trip-db]` appears in `compose.yaml`. The check prints two DRIFT lines: the service is unclaimed, and its dependency has no relationship. Which change to the model clears both?
Q2. You rename the container "Dispatch worker" to "Matching worker" by editing only the text in quotes on its `container` line. What happens when you run `./check-docs.sh`?
Q3. Without the properties block at the top of `workspace.dsl`, `inspect` reports errors because arrows from people have no technology. Which response matches the reasoning of this lab?
Practice only: not graded, not saved, not evidence.

08. Apply it

This is the skill project. Do it for a system you work on:

  1. Put your model in docs/architecture/workspace.dsl with context, container, one component and one deployment view, plus a dynamic view if a flow needs it.
  2. Add three to five short sections and at least one decision record, and make inspect -severity error,warning pass. Lower a rule only with a reason you would defend in review.
  3. Adapt check_docs.py to your own source of truth: Kubernetes manifests, Terraform output or a service catalogue. Break it on purpose once to prove that it fails.
  4. Run check-docs.sh in CI on every pull request as a required check, publish build/site, and link it from the repository README. The workflow below does this on GitHub Actions; any CI system that can run a shell script works the same way.
YAML · .github/workflows/architecture-docs.yml (illustrative: not run in this lab; the file parses as YAML)
name: architecture-docs
on:
  pull_request:
  push:
    branches: [main]

jobs:
  docs:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-java@v6
        with:
          distribution: temurin
          java-version: "21"
      - uses: actions/setup-python@v7
        with:
          python-version: "3.12"
      - run: pip install pyyaml==6.0.3
      - name: Download Structurizr
        run: >
          curl -fsSL -o "$RUNNER_TEMP/structurizr.war"
          https://download.structurizr.com/structurizr-2026.10.26.war
      - run: ./check-docs.sh
        env:
          STRUCTURIZR_WAR: ${{ runner.temp }}/structurizr.war
      - uses: actions/upload-artifact@v7
        with:
          name: architecture-site
          path: build/site

09. Review prompt

Without looking back: name the four steps of check-docs.sh and what each one can and cannot catch. Explain why the drift check compares the model with compose.yaml rather than with the diagrams Structurizr exports. Then describe what happened in step 5 and why the fix went into the model, not into the check.

References

Your progress

Reading state

Sign in to save that you finished reading this lesson.

Sign in to mark reading complete

Prove this skill

6 questions · about 5 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.
Take the skill check