Skip to content
PIsbergPublic

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

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Latest commit

 

History

391 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

code-karta

License: MIT Maven Central Build and Test Runs on Java 17+ Builds with JDK 21-25 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.4.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.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-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; --viewer (or <viewer>true</viewer> in the Maven plugin) writes one for your own diagrams. 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/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

Using it in a company

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

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

💛 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

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages