code-karta is a Java architecture mapping tool. It parses Java source and emits SVG diagrams for modules, class relationships, method call sequences, exception flow, stitched multi-file call graphs, and enum-backed state machines.
code-karta's own graph IR, diagrammed by code-karta.
mvn clean package
java -jar code-karta-cli/target/code-karta-cli-0.2.0-all.jar \
--input example-shipping-system/src/main/java/com/karta/shipping/domain \
--output outputCommon modes:
# JPMS module diagram
java -jar code-karta-cli/target/code-karta-cli-0.2.0-all.jar \
--input example-shipping-system/src/main/java/module-info.java \
--output output
# Single-file sequence and exception-flow diagram
java -jar code-karta-cli/target/code-karta-cli-0.2.0-all.jar \
--input example-shipping-system/src/main/java/com/karta/shipping/core/OrderProcessor.java \
--output output
# Multi-file stitched call graph — OrderProcessor→InventoryService across files
java -jar code-karta-cli/target/code-karta-cli-0.2.0-all.jar \
--input example-shipping-system/src/main/java/com/karta/shipping/core \
--output output \
--sequence-only
# State transition diagram — KartaCli's own pipeline (PARSING→LAYOUT→RENDERING→WRITING→DONE)
java -jar code-karta-cli/target/code-karta-cli-0.2.0-all.jar \
--input code-karta-cli/src/main/java/se/deversity/codekarta/cli/KartaCli.java \
--output output \
--state-machinecode-karta generates six diagram types, and the ones below are generated from code-karta's own
source on every mvn verify. Click a thumbnail for the full-size vector SVG, or read
docs/DIAGRAM-GALLERY.md for the command and explanation behind each.
For large or highly coupled systems there is a self-contained
interactive viewer with search, edge-type toggles, and zoom —
see docs/VIEWER.md.
| Page | What it covers |
|---|---|
docs/README.md |
Documentation index |
docs/BUILD.md |
Maven and Gradle commands, running from source |
docs/CLI.md |
Full flag reference |
docs/DIAGRAM-MODES.md |
What each input shape produces |
docs/LIBRARY.md |
Using the tiers directly from Java |
docs/ARCHITECTURE.md |
Tier responsibilities, graph schema, extension points |
docs/QUALITY.md |
The mvn verify quality gate |
docs/SKILL.md |
Compact operating guide for coding agents |
| Module | Purpose |
|---|---|
code-karta-core |
Shared graph IR |
code-karta-input |
JavaParser-based source analysis |
code-karta-layout |
Simple and ELK layout engines |
code-karta-render |
SVG rendering |
code-karta-cli |
Command-line wrapper |
No tier imports from a sibling or from a tier above it — the Graph IR is the only contract that
crosses tier boundaries, and ArchitectureRulesTest
enforces that with ArchUnit rather than convention.
code-karta is built and maintained by a single developer in his spare time. If it saves you time, a small donation helps keep the project alive:
- Donate via PayPal — every contribution, however small, is appreciated.
- Don't have PayPal yet? Sign up with this invite link — free for you, and PayPal gives the project a referral bonus.