All-in-one diagram-as-code playground: Python diagrams, PlantUML, Mermaid, Graphviz & D2 in one Docker container. Zero setup complexity. Perfect for architecture docs, CI/CD pipelines, and infrastructure visualization.
dac is a compact diagram-as-code playground with a single Docker-based workflow.
# Build the container
make run-container
# Verify everything works
make doctor
# Render all examples
make render-all
# View outputs in ./outputThat's it! All diagram engines ready to go.
| Feature | Benefit |
|---|---|
| Single Makefile | No npm, pip, or complex setup. Just make. |
| One Docker container | All 5 engines in one containerβno dependencies sprawl. |
| Zero configuration | Works out-of-the-box with curated examples. |
| CI/CD ready | Perfect for automated architecture documentation pipelines. |
| Engine agnostic | Learn or switch between tools easily with the same workflow. |
Best for cloud architecture diagrams driven by Python code.
make render engine=py filename=easy
make render engine=py filename=medium
make render engine=py filename=complexExamples:
- Cloud infrastructure (AWS, GCP, Azure)
- Microservices architecture
- Network topology
Covers sequence diagrams, component diagrams, deployment diagrams, and more. Includes C4 model support with built-in compatibility includes (no external fetches needed).
make render engine=puml filename=medium
make render engine=puml filename=test_c4Examples:
- Sequence diagrams
- Component & deployment diagrams
- C4 architecture models
The easiest path for lightweight architecture, flowchart, and sequence diagrams in docs. Renders through Kroki.
make render engine=mermaid filename=easyExamples:
- Architecture diagrams
- Flowcharts
- Sequence & state diagrams
- Great for embedding in Markdown docs
Useful when you want direct layout control and a very stable rendering path.
make render engine=dot filename=complexExamples:
- Dependency graphs
- State machines
- Custom layouts with precise control
A modern diagram scripting language with strong layout and styling support. Outputs both SVG and PNG.
make render engine=d2 filename=mediumExamples:
- Modern architecture diagrams
- Entity relationship diagrams
- Timeline diagrams
make render engine=py filename=easy # Python
make render engine=puml filename=medium # PlantUML
make render engine=mermaid filename=easy # Mermaid
make render engine=dot filename=complex # Graphviz
make render engine=d2 filename=medium # D2make render-all
make sync-doc-examplessync-doc-examples keeps docs/assets/examples/ synchronized with rendered PNGs so the site gallery pages stay current.
make doctormake listmake testmake refresh-docsmake stop-containerYou can also run this repo against another project with the same engine layout (py, uml, mermaid, dot, d2).
make -C /opt/projects/labs/dac render \
DIAGRAMS_HOST_LOCATION=/opt/projects/stonetoned/bandai/infra \
OUTPUT_HOST_LOCATION=/tmp/bandai-infra-diagrams \
engine=puml \
filename=stack \
inputext=puml/opt/projects/labs/dac/dac render \
--source /opt/projects/stonetoned/bandai/infra \
--engine puml \
--name stack \
--ext puml \
--out /tmp/bandai-infra-diagramsCLI arguments:
--source/--source-dir: absolute input directory--out/--output/--output-dir: output directory--engine:py|puml|uml|mermaid|dot|d2--name: diagram name--ext/--inputext: extension override (py/puml/mmd/dot/d2)--help: print help--version: print version
dac/
βββ diagrams/
β βββ py/ # Python diagram examples
β βββ uml/ # PlantUML examples (including C4)
β βββ mermaid/ # Mermaid examples
β βββ dot/ # Graphviz DOT examples
β βββ d2/ # D2 examples
βββ output/ # Generated PNG/SVG outputs
βββ Makefile # All build commands
βββ Dockerfile # Single containerized environment
βββ README.md
Rendered diagrams are organized by engine:
- Python:
output/py/... - PlantUML:
output/uml/... - Mermaid:
output/mermaid/... - Graphviz:
output/dot/... - D2:
output/d2/...(includes both.svgand.png)
make testThe test suite:
- Renders every example in the repository
- Verifies expected PNG files exist and are non-empty
- Validates all 5 engines + C4 PlantUML sample
- Gives you a quick smoke test for your setup
- Architecture Documentation β Generate diagrams as part of your documentation build
- CI/CD Pipelines β Auto-render diagrams on every commit
- Infrastructure as Code β Visualize your infrastructure definitions
- Technical Design Docs β Create sequence, component, and deployment diagrams
- Learning Playground β Experiment with different diagram engines and syntax
cat VERSION
make versionmake install PREFIX=$HOME/.local
make install-completion PREFIX=$HOME/.localdac --version
dac versionVERSION is the semantic version source. Current value is 0.1.1.
diagrams/py/easy.pydiagrams/py/medium.pydiagrams/py/complex.pydiagrams/py/extreme.pydiagrams/py/consumer.py
Render:
make generate-py filename=easy inputext=pydiagrams/uml/easy.pumldiagrams/uml/medium.pumldiagrams/uml/complex.pumldiagrams/uml/extreme.pumldiagrams/uml/test.umldiagrams/uml/test_c4.pumldiagrams/uml/test_c4_complex_enterprise.pumldiagrams/uml/test_c4_realtime_dispatch.puml
Render:
make generate-puml filename=complex inputext=pumlThe C4 example uses a small local compatibility include so it renders without external fetches.
Mermaid is the easiest path for lightweight architecture, flowchart, and sequence diagrams in docs. In this repo, Mermaid examples are rendered through Kroki, which keeps the container small and avoids browser setup.
Example files:
diagrams/mermaid/easy.mmddiagrams/mermaid/medium.mmddiagrams/mermaid/complex.mmddiagrams/mermaid/extreme.mmd
Render:
make generate-mermaid filename=medium inputext=mmdDOT is useful when you want direct layout control and a very stable rendering path.
Example files:
diagrams/dot/easy.dotdiagrams/dot/medium.dotdiagrams/dot/complex.dotdiagrams/dot/extreme.dot
Render:
make generate-dot filename=complex inputext=dotD2 is a modern diagram scripting language with strong layout and styling support.
Example files:
diagrams/d2/easy.d2diagrams/d2/medium.d2diagrams/d2/complex.d2diagrams/d2/extreme.d2
Render:
make generate-d2 filename=easy inputext=d2Rendered PNGs are written to:
output/py/...output/uml/...output/mermaid/...output/dot/...output/d2/...
D2 also keeps the native SVG output next to the PNG preview:
output/d2/*.svgoutput/d2/*.png
To change this in the same run, set:
DIAGRAMS_HOST_LOCATION(default:./diagrams)OUTPUT_HOST_LOCATION(default:./output)
make test renders every example in the repository and verifies the expected PNG files exist and are non-empty.
That gives you a quick smoke test for:
- Python
diagrams - PlantUML
- Mermaid
- Graphviz DOT
- D2
- the C4 PlantUML sample
This repo provides:
- 5 diagram engines β compare and choose what works for you
- Sample inputs for easy, medium, and complex diagrams per engine
- C4 PlantUML β industry-standard architecture modeling
- Docker containerization β reproducible environment
- Makefile automation β simple, explicit commands
- Comprehensive examples β from basic to advanced
- Docker
- Make
- That's it!
Creative Commons Zero v1.0 Universal (CC0) β Use freely, no attribution required.
Found a bug? Have a great example? Issues and PRs welcome!