explaingit

plantuml-stdlib/c4-plantuml

7,274PlantUMLAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

A library that lets you draw software architecture diagrams by writing simple text commands instead of dragging boxes, using the structured C4 model approach for multiple levels of detail.

Mindmap

mindmap
  root((C4-PlantUML))
    Diagram types
      System context
      Container diagrams
      Component diagrams
      Deployment diagrams
    Features
      Icon support
      Custom styles
      VS Code snippets
    Tech stack
      PlantUML
      C4 model
    Use cases
      Architecture docs
      System design
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Create a system context diagram showing how your app connects to users and external services with a few lines of text.

USE CASE 2

Generate container diagrams that show the main technical building blocks of your software and how they communicate.

USE CASE 3

Document a deployment architecture showing how software components map to servers or cloud infrastructure.

USE CASE 4

Produce sequence diagrams styled consistently with the rest of your C4 architecture documentation.

Tech stack

PlantUML

Getting it running

Difficulty · easy Time to first run · 30min
Use freely for any purpose including commercial projects, as long as you keep the copyright notice. (MIT License)

In plain English

C4-PlantUML is a library that lets you draw software architecture diagrams using a text-based approach. Instead of dragging boxes around in a drawing tool, you write simple text descriptions and the library turns them into clean, consistent diagrams. It is built on top of two existing things: PlantUML, which is a tool that generates diagrams from plain text, and the C4 model, which is a structured way of describing software systems. The C4 model breaks software architecture down into several levels of detail. At the outermost level you describe the whole system and the people or other systems that interact with it. Zooming in, you describe the main technical pieces (such as web applications, databases, or mobile apps) and how they communicate. Zooming in further, you describe the internal components of each piece. C4-PlantUML gives you ready-made commands for each of these levels so you do not have to draw everything from scratch. The library supports several diagram types: system context diagrams (the big picture), system landscape diagrams (multiple related systems side by side), container diagrams, component diagrams, deployment diagrams that show how software maps to infrastructure, dynamic diagrams that show how elements interact at runtime, and sequence diagrams styled to match the C4 look. You include the library in a PlantUML file with a single line, then use its shorthand commands to place elements and draw relationships between them. You can customize colors and styles using tags, add icons, and control how elements are arranged on the page. The library ships with snippets for Visual Studio Code and live templates for IntelliJ to speed up writing. The project is open source, licensed under MIT, and is part of the official PlantUML standard library. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Using C4-PlantUML, write a system context diagram for a web app with a React frontend, a FastAPI backend, and a PostgreSQL database, with an end user interacting through the frontend.
Prompt 2
Show me how to add icons and custom colors to a C4-PlantUML container diagram to visually distinguish databases from web apps and message queues.
Prompt 3
Generate a C4-PlantUML sequence diagram showing the login flow: browser sends credentials to API, API checks database, returns a token to the browser.
Prompt 4
How do I include the C4-PlantUML library in a PlantUML file and create a component diagram that zooms into the internals of one microservice?
Open on GitHub → Explain another repo

← plantuml-stdlib on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.