Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

180 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

code-karta

License: MIT Maven Central Build and Test Java 21+ Maven Gradle ArchUnit PMD SpotBugs JSpecify Checkstyle Error Prone SBOM PIT Mutation Testing Lines of Code Donate

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.

Class diagram of code-karta's own graph IR, generated by code-karta
code-karta's own graph IR, diagrammed by code-karta.

Quick Start

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 output

Common 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-machine

Examples

code-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.

Module diagram — JPMS requires/exports
📦 Module — JPMS dependencies and exported packages
Class diagram — IR model classes
📐 Class — inheritance and composition, stdlib filtered out
KartaCli exception-flow sequence diagram
🔥 Exception-Flow Sequence — calls plus colour-coded exception routes and try/catch regions
CallSequenceParser call-only sequence diagram
📞 Call-Only Sequence — the same call graph without exception noise
Input layer multi-file stitched sequence diagram
🔗 Multi-File Stitched — cross-class calls resolved by JavaParser symbol solving
KartaCli pipeline state machine
🔄 State Transition — states from enums, switch cases, and builder DSLs

For large or highly coupled systems there is a self-contained interactive viewer with search, edge-type toggles, and zoom — see docs/VIEWER.md.

Documentation

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

Modules

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.

💛 Support code-karta

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:

About

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.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages