How michaeltschreiber/c4-structurizr-llm-assistant works
Purpose and Entry Points
This is an architecture-modeling repository, not an application runtime. It provides Structurizr DSL source, reusable C4 examples, and an LLM-oriented modeling guide. The primary editable/renderable model is workspace.dsl; examples begin at examples/example - basic syntax.c4 and examples/example - Comprehensive example of a modern e-commerce system.c4.
C4 Model Authoring
Structurizr DSL files are the repository’s source of truth for architecture descriptions: people, software systems, containers, components, relationships, deployment environments, and views. workspace.dsl is the root-convention model consumed by Structurizr Lite, while the example .c4 files demonstrate progressively richer model structures.
Example Model Library
The examples form the main reference implementation boundary for authors:
• examples/example - basic syntax.c4 establishes the minimum workspace/model/view structure.
• examples/n-tier.c4 represents a layered/n-tier architecture pattern.
• examples/example - Comprehensive example of a modern e-commerce system.c4 demonstrates complex system decomposition, relationships, deployment, dynamic views, and styling.
These files are templates and learning artifacts; they are not composed into a single build pipeline.
AI-Assisted DSL Generation
docs/C4 Structurizr DSL Generation System Prompt.md defines the workflow for translating natural-language architecture descriptions into valid C4/Structurizr DSL. The intended control flow is: system description → identify architectural actors/elements and relationships → generate structured DSL → review or render the model. This guide can be held in editor context for GitHub Copilot or used with an external C4-focused assistant.
Visualization Boundary
Two rendering paths consume DSL independently:
• The VS Code C4 DSL extension provides editing, language-server support, and optional Structurizr rendering.
• structurizr-lite_launcher.sh starts local Structurizr Lite, mounting the repository working directory into the container. Structurizr Lite expects workspace.dsl at the mounted root and exposes the rendered workspace on port 8080.
External extension rendering is a data-boundary concern because it uses an external API; local Lite rendering keeps the workspace mounted in a local Docker container.
Runtime and Infrastructure
Authoring requires VS Code plus the C4 DSL Extension. Its language server requires Java 17+. Local visualization requires Docker and the structurizr/lite container image, launched through structurizr-lite_launcher.sh. The workspace editor setup is captured in c4-example.code-workspace.
Operational Flow
An engineer creates or updates workspace.dsl (or derives a new model from examples/), validates it interactively through the editor language server, then renders it either externally through the extension or locally via Docker. The browser is only a visualization client for Structurizr Lite at localhost; no web service implemented by this repository exists.
Main entry points: workspace.dsl Root Workspace Model · structurizr-lite_launcher.sh Lite Launcher · c4-example.code-workspace Workspace Setup · example - basic syntax.c4 Basic Syntax Example
Components 16
Authoring
- Architecture Author
- VS Code
- C4 DSL Extension · Provides DSL editing, language-server support, and optional rendering.
- Java 17+ · Required by the extension language server.
- Workspace Setup
c4-example.code-workspace - C4-Focused Assistant
DSL Sources
- Root Workspace Model · Root-convention model consumed by Structurizr Lite.
workspace.dsl - Basic Syntax Example · Minimum workspace, model, and view structure.
examples/example - basic syntax.c4 - N-Tier Example · Layered architecture reference model.
examples/n-tier.c4 - E-Commerce Example · Complex decomposition, deployment, dynamic views, and styling.
examples/example - Comprehensive example of a modern e-commerce system.c4 - DSL Generation Guide · Guides natural-language architecture translation into valid DSL.
docs/C4 Structurizr DSL Generation System Prompt.md
Validation & Rendering
- External Extension Rendering · Extension rendering crosses an external data boundary.
- Lite Launcher · Mounts the repository working directory and starts Lite.
structurizr-lite_launcher.sh - Docker
- Structurizr Lite · Renders the mounted workspace on port 8080.
- Browser · Views the locally rendered workspace at localhost.
Connections 17
- Architecture Author → VS Code: authors models
- Workspace Setup → VS Code: configures
- VS Code → C4 DSL Extension: hosts
- C4 DSL Extension → Java 17+: language server requires
- C4 DSL Extension → Root Workspace Model: validates and edits
- Architecture Author → Root Workspace Model: creates or updates
- Basic Syntax Example → Root Workspace Model: template for
- N-Tier Example → Root Workspace Model: pattern reference for
- E-Commerce Example → Root Workspace Model: advanced reference for
- DSL Generation Guide → C4-Focused Assistant: instructs
- C4-Focused Assistant → Root Workspace Model: generates DSL
- C4 DSL Extension → External Extension Rendering: optionally renders via
- Lite Launcher → Docker: starts
- Docker → Structurizr Lite: runs
- Root Workspace Model → Structurizr Lite: mounted root workspace
- Lite Launcher → Structurizr Lite: launches
- Structurizr Lite → Browser: renders on localhost:8080