Skip to main content

System Design Diagram

A Docker container for generating system design diagrams using PlantUML and the diagrams library.

https://img.shields.io/badge/Docker-Ready-blue.svg https://img.shields.io/badge/license-MIT-green.svg https://github.com/aydabd/sys-design-diagram/actions/workflows/ci.yml/badge.svg PyPI Version Docker Pulls

Overview

System Design Diagram is a container & Python CLI that generates diagrams from:

  • PlantUML (*.puml)

  • Python diagrams library modules (*.py)

  • Mermaid (*.mmd)

It targets automation workflows (CI/CD, docs pipelines) while staying simple for local use.

Features

  • PlantUML rendering (using system plantuml + Graphviz)

  • Mermaid rendering via @mermaid-js/mermaid-cli (Chromium bundled & sandbox-configured)

  • Python diagrams library support

  • Unified multi-run command: process-all

  • Async processing with per-file task fan-out

  • Graceful fallback placeholders for Mermaid if headless browser fails unexpectedly

  • Opinionated defaults + environment variable overrides

Installation

To use the Docker container, pull it from the GitHub Container Registry or docker hub:

docker pull ghcr.io/aydabd/sys-design-diagram:latest
docker pull aydabd/sys-design-diagram:latest

Make sure you have Docker installed and running on your system.

Usage

The entrypoint is sys-design-diagram. Subcommands:

  • plantuml – Generate diagrams from PlantUML files

  • diagrams – Generate diagrams with the diagrams library

  • mermaid – Generate diagrams from Mermaid files

  • process-all – Run all of the above (recommended for batch pipelines)

Global option:

  • -v / --verbose – more logging (including per-task timings)

Defaults & Resolution Order

Design & output directories are resolved in this order (per flag):

  1. CLI option (-d / -o)

  2. Environment variable (SDD_DESIGNS_DIR / SDD_OUTPUT_DIR)

  3. Conventional path: ./designs (if it exists) for designs; ./sys-design-diagram-output for output (created on demand)

Inside official Docker images, you typically mount:

  • /designs – input (read-only recommended)

  • /output – generated diagrams

Environment Variables

Core overrides:

  • SDD_DESIGNS_DIR – override designs path

  • SDD_OUTPUT_DIR – override output path

Mermaid / Puppeteer tuning:

  • MERMAID_PUPPETEER_CONFIG – path to injected Puppeteer JSON (set by image to /opt/puppeteer-config.json adding --no-sandbox etc.)

  • SDD_MERMAID_EXTRA_ARGS – extra raw arguments appended to mmdc (e.g. --scale 1.2 --theme dark)

Note: If Chromium launch fails (sandbox / missing dependency) a placeholder PNG containing the original Mermaid source is written so pipelines stay green.

Quick Start (Docker)

Create a local directory with your design sources (.puml, .mmd, Python diagrams):

tree my-designs/
my-designs/
  plantuml1.puml
  sequence.mmd
  infra.py

Run all processors (preferred):

docker run --rm -v "$PWD/my-designs:/designs:ro" -v "$PWD/out:/output" ghcr.io/aydabd/sys-design-diagram:latest process-all

Run only PlantUML:

docker run --rm -v "$PWD/my-designs:/designs:ro" -v "$PWD/out:/output" ghcr.io/aydabd/sys-design-diagram:latest plantuml

Override paths with env vars (custom layout):

docker run --rm \
    -e SDD_DESIGNS_DIR=/work/src/designs \
    -e SDD_OUTPUT_DIR=/work/build/diagrams \
    -v "$PWD/my-designs:/work/src/designs:ro" \
    -v "$PWD/out:/work/build/diagrams" \
    ghcr.io/aydabd/sys-design-diagram:latest process-all

Verbose mode:

docker run --rm -v "$PWD/my-designs:/designs:ro" -v "$PWD/out:/output" ghcr.io/aydabd/sys-design-diagram:latest -v process-all

Using docker compose (see compose.yaml):

Compose services provided:

  • sdd-process-all - runs all processors on test data

  • sdd-plantuml - PlantUML only

  • sdd-diagrams - diagrams library only

  • sdd-mermaids - Mermaid only (local build variant)

  • sdd-build-locally - builds from workspace sources then process-all

Example (rebuild & run everything detached):

docker compose up --build -d sdd-process-all
# or just Mermaid
docker compose up --build sdd-mermaids

Outputs land in the corresponding subdirectories under ./sdd-outputs or ./sdd-local-outputs as defined in the compose file.

Mermaid Rendering Notes

Chromium + mermaid-cli are bundled. A Puppeteer config (/opt/puppeteer-config.json) adds sandbox‑relaxing flags suitable for rootless containers. If you operate in a hardened environment and can enable the system Chromium sandbox (setuid / userns), you may build a derivative image removing --no-sandbox flags.

To append more Mermaid CLI arguments (e.g. scaling, theme):

docker run --rm -e SDD_MERMAID_EXTRA_ARGS="--scale 1.5 --theme dark" \
    -v "$PWD/my-designs:/designs:ro" -v "$PWD/out:/output" ghcr.io/aydabd/sys-design-diagram:latest mermaid

If rendering fails due to a transient headless issue, a placeholder file is created instead of failing the whole run.

Development

To contribute to the development of this project, follow these steps:

  1. Clone the repository

  2. for linux users, install mamba-githook [mamba-githook](https://github.com/aydabd/mamba-githook?tab=readme-ov-file#installation)

  3. Initiate mamba-githook, check the installation link above

  4. Create a new branch (e.g. git checkout -b feature)

  5. Make your changes

  6. Commit your changes (e.g. git commit -am ‘Add new feature’)

  7. Push to the branch (e.g. git push origin feature)

  8. Create a new Pull Request

Testing

Pre-commit hooks are used to run tests before each commit. To run the tests manually, use the following command:

# Create a virtual environment
python -m venv .venv
pip install hatch
# Run the tests
hatch run test:all
# For formatting
hatch fmt

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

Contact

For any questions or suggestions, please open an issue on the GitHub repository.

Release files for sys-design-diagram 2.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sys-design-diagram 2.0.2
File Size Uploaded
sys_design_diagram-2.0.2.tar.gz 34.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sys-design-diagram 2.0.2
File Interpreter ABI Platform
sys_design_diagram-2.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 51.3 kB

Release files / sys_design_diagram-2.0.2.tar.gz

Download URL sys_design_diagram-2.0.2.tar.gz
Size 34.7 kB
Tags Source
SHA-256 checksum
How to use checksums
35ff1b1302a81c55f2388f388d07a8e02af5290a6b0236c1256f3c8fa6ad781f
BLAKE2b-256 checksum
How to use checksums
d63286cba5056e4825ba825c0b205277fb1f1a4a897fbf72cdd828bea4e13e1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2025.

Transparency log

Release files / sys_design_diagram-2.0.2-py3-none-any.whl

Download URL sys_design_diagram-2.0.2-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19feeaf13b3b5ca61d98020a401d17cd672e3e3837e058074bf915c0256e1727
BLAKE2b-256 checksum
How to use checksums
d5c93968f0ddba7499e4bd837e6aeac7049e25e4b928f89c5c60c1e5f395d0f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.2 This release

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page