Stop Redrawing Your Architecture: YAML, SQL, Terraform and EXPLAIN Plans to Diagrams in One Paste
I have a confession: for years, the most out-of-date file in every repo I worked on was docs/architecture.png. It was never anyone's fault. The diagram was correct on the day someone drew it. Then a service got split, a Redis cache appeared, a queue was added, a table gained a foreign key. Nobody wanted to open a drawing tool and push boxes around again, so the picture slowly turned into fiction,…
The article discusses a tool called LetDraw that can generate diagrams from various types of code and configuration files, making them editable and easier to understand. The author uses LetDraw for six different purposes:
1. Kubernetes YAML to diagram Kubernetes: By pasting Kubernetes YAML files, LetDraw auto-detects the format and creates a cluster diagram that groups resources by namespace. It links Services to the workloads they select based on label selectors, and workloads to the ConfigMaps, Secrets, and PersistentVolumeClaims they mount. It supports various Kubernetes objects like Deployments, StatefulSets, Ingress, ConfigMaps, Secrets, and volume claims.
Helm users can also use the tool by pasting the output of helm template or the Chart.yaml to see the rendered resources and dependencies.
2. Docker Compose to diagram: Pasting a Docker Compose file generates a diagram with four services, linked and connected based on the "depends_on" relationships. Adding icons to the services makes them recognizable (e.g., a database cylinder for Postgres, an icon for Redis). The tool's smart connector avoids crossing boxes with arrows.
3. SQL to ER diagram: By pasting SQL migration statements or schema dumps, LetDraw generates an Entity-Relationship (ER) diagram. It represents each table as a grid with a header and one row per column, showing column types, primary key (PK) and foreign key (FK) markers. Relationships between tables are drawn as lines, arrows, or smart routed connectors, with cardinality inferred from foreign key constraints.
The core feature behind all these conversions is the "Generate from Code" dialog, which auto-detects the format, shows a live preview, and allows for editing the generated diagrams. Additional features include adding icons, comparing the current import with previous versions (Drift vs last), and choosing layout direction and relationship types.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.