dac is a compact diagram-as-code playground with a single Docker-based workflow.
It currently supports these engines:
- Python
diagrams - PlantUML
- Mermaid
- Graphviz DOT
- D2
There is also a C4 PlantUML example using the standard C4 include files.
The goal is to keep the workflow small:
- one container
- one
Makefile - sample inputs for easy, medium, and complex diagrams
- render outputs written to
./output
Build and start the renderer container:
make run-containerRun a quick environment check:
make doctorList bundled examples and output locations:
make listRender a single example with the shorthand target:
make render engine=py filename=easy
make render engine=puml filename=medium
make render engine=mermaid filename=complex
make render engine=dot filename=easy
make render engine=d2 filename=mediumOr use the engine-specific targets directly:
make generate-py filename=easy inputext=py
make generate-puml filename=easy inputext=puml
make generate-mermaid filename=easy inputext=mmd
make generate-dot filename=easy inputext=dot
make generate-d2 filename=easy inputext=d2Render every bundled example:
make render-allRun the full verification pass:
make testStop the container:
make stop-containerPython diagrams are best when you want cloud architecture diagrams driven by Python code.
Example files:
diagrams/py/easy.pydiagrams/py/medium.pydiagrams/py/complex.pydiagrams/py/consumer.py
Render:
make generate-py filename=complex inputext=pyPlantUML covers sequence diagrams, component diagrams, deployment diagrams, and more.
Example files:
diagrams/uml/easy.pumldiagrams/uml/medium.pumldiagrams/uml/complex.pumldiagrams/uml/test.umldiagrams/uml/test_c4.puml
Render:
make generate-puml filename=complex inputext=pumlThe C4 example uses a small local compatibility include so it renders without any 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.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.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.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
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