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.4.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.4.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.4.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.4.0-all.jar \
--input example-shipping-system/src/main/java/com/karta/shipping/core \
--output output \
--sequence-only
# Any codebase: point --input at a checkout. Tests, build output, .git and node_modules
# are skipped (--include-tests keeps the tests); one diagram per production package
java -jar code-karta-cli/target/code-karta-cli-0.4.0-all.jar \
--input ~/src/some-project \
--output output \
--split-packages
# State transition diagram — KartaCli's own pipeline (PARSING→LAYOUT→RENDERING→WRITING→DONE)
java -jar code-karta-cli/target/code-karta-cli-0.4.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;
--viewer (or <viewer>true</viewer> in the Maven plugin) writes one for your own diagrams.
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/MAVEN-PLUGIN.md |
Generating diagrams from a Maven build |
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 |
| Page | What it covers |
|---|---|
COMPATIBILITY.md |
What is public API, what is not, and what a version bump means |
SECURITY.md |
Threat model, supported versions, how to report a vulnerability |
CONTRIBUTING.md |
Build gate, architecture rules, what a pull request needs |
CODE_OF_CONDUCT.md |
Contributor Covenant 2.1 |
LICENSE |
MIT |
| 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 |
code-karta-maven-plugin |
Maven goal that drives the CLI during a build |
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.