# michaeltschreiber/c4-structurizr-llm-assistant architecture

> Architecture diagram of the GitHub repository michaeltschreiber/c4-structurizr-llm-assistant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/michaeltschreiber/c4-structurizr-llm-assistant
- Repository: https://github.com/michaeltschreiber/c4-structurizr-llm-assistant

## Overview

#### 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`](https://github.com/michaeltschreiber/c4-structurizr-llm-assistant/blob/main/workspace.dsl) (Root Workspace Model), [`structurizr-lite_launcher.sh`](https://github.com/michaeltschreiber/c4-structurizr-llm-assistant/blob/main/structurizr-lite_launcher.sh) (Lite Launcher), [`c4-example.code-workspace`](https://github.com/michaeltschreiber/c4-structurizr-llm-assistant/blob/main/c4-example.code-workspace) (Workspace Setup), [`examples/example - basic syntax.c4`](https://github.com/michaeltschreiber/c4-structurizr-llm-assistant/blob/main/examples/example%20-%20basic%20syntax.c4) (Basic Syntax Example)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Authoring"]
  node_engineer(("Architecture Author<br/>person"))
  node_vscode["VS Code<br/>editor"]
  node_c4_extension["C4 DSL Extension<br/>editor extension"]
  node_java["Java 17+<br/>runtime dependency"]
  node_workspace_config["Workspace Setup<br/>editor workspace"]
  node_c4_assistant{{"C4-Focused Assistant<br/>external AI assistant"}}
end

subgraph group_models["DSL Sources"]
  node_workspace_dsl["Root Workspace Model<br/>Structurizr DSL<br/>[workspace.dsl]"]
  node_basic_example["Basic Syntax Example<br/>C4 template"]
  node_ntier_example["N-Tier Example<br/>C4 template<br/>[n-tier.c4]"]
  node_ecommerce_example["E-Commerce Example<br/>C4 template"]
  node_generation_guide["DSL Generation Guide<br/>LLM workflow guide"]
end

subgraph group_rendering["Validation &amp; Rendering"]
  node_external_rendering{{"External Extension Rendering<br/>external API"}}
  node_launcher["Lite Launcher<br/>shell launcher"]
  node_docker["Docker<br/>container runtime"]
  node_structurizr_lite["Structurizr Lite<br/>local container"]
  node_browser["Browser<br/>visualization client"]
end

node_engineer -->|"authors models"| node_vscode
node_workspace_config -->|"configures"| node_vscode
node_vscode -->|"hosts"| node_c4_extension
node_c4_extension -->|"language server requires"| node_java
node_c4_extension -->|"validates and edits"| node_workspace_dsl
node_engineer -->|"creates or updates"| node_workspace_dsl
node_basic_example -.->|"template for"| node_workspace_dsl
node_ntier_example -.->|"pattern reference for"| node_workspace_dsl
node_ecommerce_example -.->|"advanced reference for"| node_workspace_dsl
node_generation_guide -->|"instructs"| node_c4_assistant
node_c4_assistant -->|"generates DSL"| node_workspace_dsl
node_c4_extension -->|"optionally renders via"| node_external_rendering
node_launcher -->|"starts"| node_docker
node_docker -->|"runs"| node_structurizr_lite
node_workspace_dsl -->|"mounted root workspace"| node_structurizr_lite
node_launcher -->|"launches"| node_structurizr_lite
node_structurizr_lite -->|"renders on localhost:8080"| node_browser

click node_workspace_config "https://github.com/michaeltschreiber/c4-structurizr-llm-assistant/blob/main/c4-example.code-workspace"
click node_workspace_dsl "https://github.com/michaeltschreiber/c4-structurizr-llm-assistant/blob/main/workspace.dsl"
click node_basic_example "https://github.com/michaeltschreiber/c4-structurizr-llm-assistant/blob/main/examples/example%20-%20basic%20syntax.c4"
click node_ntier_example "https://github.com/michaeltschreiber/c4-structurizr-llm-assistant/blob/main/examples/n-tier.c4"
click node_ecommerce_example "https://github.com/michaeltschreiber/c4-structurizr-llm-assistant/blob/main/examples/example%20-%20Comprehensive%20example%20of%20a%20modern%20e-commerce%20system.c4"
click node_generation_guide "https://github.com/michaeltschreiber/c4-structurizr-llm-assistant/blob/main/docs/C4%20Structurizr%20DSL%20Generation%20System%20Prompt.md"
click node_launcher "https://github.com/michaeltschreiber/c4-structurizr-llm-assistant/blob/main/structurizr-lite_launcher.sh"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_engineer,node_vscode,node_c4_extension,node_java,node_workspace_config,node_c4_assistant toneBlue
class node_workspace_dsl,node_basic_example,node_ntier_example,node_ecommerce_example,node_generation_guide toneAmber
class node_external_rendering,node_launcher,node_docker,node_structurizr_lite,node_browser toneMint
```

## Components

### Authoring

- **Architecture Author**: person
- **VS Code**: editor
- **C4 DSL Extension**: editor extension · Provides DSL editing, language-server support, and optional rendering.
- **Java 17+**: runtime dependency · Required by the extension language server.
- [Workspace Setup](https://github.com/michaeltschreiber/c4-structurizr-llm-assistant/blob/main/c4-example.code-workspace): editor workspace · `c4-example.code-workspace`
- **C4-Focused Assistant**: external AI assistant

### DSL Sources

- [Root Workspace Model](https://github.com/michaeltschreiber/c4-structurizr-llm-assistant/blob/main/workspace.dsl): Structurizr DSL · Root-convention model consumed by Structurizr Lite. · `workspace.dsl`
- [Basic Syntax Example](https://github.com/michaeltschreiber/c4-structurizr-llm-assistant/blob/main/examples/example%20-%20basic%20syntax.c4): C4 template · Minimum workspace, model, and view structure. · `examples/example - basic syntax.c4`
- [N-Tier Example](https://github.com/michaeltschreiber/c4-structurizr-llm-assistant/blob/main/examples/n-tier.c4): C4 template · Layered architecture reference model. · `examples/n-tier.c4`
- [E-Commerce Example](https://github.com/michaeltschreiber/c4-structurizr-llm-assistant/blob/main/examples/example%20-%20Comprehensive%20example%20of%20a%20modern%20e-commerce%20system.c4): C4 template · Complex decomposition, deployment, dynamic views, and styling. · `examples/example - Comprehensive example of a modern e-commerce system.c4`
- [DSL Generation Guide](https://github.com/michaeltschreiber/c4-structurizr-llm-assistant/blob/main/docs/C4%20Structurizr%20DSL%20Generation%20System%20Prompt.md): LLM workflow guide · Guides natural-language architecture translation into valid DSL. · `docs/C4 Structurizr DSL Generation System Prompt.md`

### Validation & Rendering

- **External Extension Rendering**: external API · Extension rendering crosses an external data boundary.
- [Lite Launcher](https://github.com/michaeltschreiber/c4-structurizr-llm-assistant/blob/main/structurizr-lite_launcher.sh): shell launcher · Mounts the repository working directory and starts Lite. · `structurizr-lite_launcher.sh`
- **Docker**: container runtime
- **Structurizr Lite**: local container · Renders the mounted workspace on port 8080.
- **Browser**: visualization client · Views the locally rendered workspace at localhost.

## Connections

- 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
