# douglasoliveira10/javadraw architecture

> Architecture diagram of the GitHub repository douglasoliveira10/javadraw, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/douglasoliveira10/javadraw
- Repository: https://github.com/douglasoliveira10/javadraw

## Overview

JavaDraw statically analyzes Java bytecode and turns the resulting class, relation, and call graph into a self-contained interactive diagram. The primary workflow runs from supplied class directories or archives through analysis and graph export, then into the HTML UI, where users explore entry points and neighboring types, edit and arrange cards, and save or export the diagram. The graph captures documented capabilities, including hierarchy, calls, relations, stereotypes, and external-call options. Some UI and analysis links are based on README or index references because their implementation was not sampled.

Main entry points: [`javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/graph/ModelBuilder.java`](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/graph/ModelBuilder.java) (Model builder), [`javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/Analyzer.java`](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/Analyzer.java) (Analyzer), [`javadraw-cli/src/main/java/br/com/douglasoliveira10/javadraw/cli/Main.java`](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-cli/src/main/java/br/com/douglasoliveira10/javadraw/cli/Main.java) (CLI options), [`javadraw-ui/src/diagram/useCanvas.ts`](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-ui/src/diagram/useCanvas.ts) (Canvas persistence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Bytecode analysis"]
  node_analyzer["Analyzer<br/>[Analyzer.java]"]
  node_sources["Class sources"]
  node_asm["ASM parsing"]
  node_hierarchy["Type hierarchy<br/>[TypeHierarchy.java]"]
  node_filter["Type filtering<br/>[TypeFilter.java]"]
end

subgraph group_graph["Graph model and export"]
  node_builder["Model builder<br/>[ModelBuilder.java]"]
  node_entrypoints["Entry points<br/>[EntryPoints.java]"]
  node_stereotypes["Stereotypes<br/>[Stereotypes.java]"]
  node_externalcalls["External calls<br/>[ExternalCalls.java]"]
  node_projectmodel["Project model<br/>[ProjectModel.java]"]
  node_json["Graph JSON"]
end

subgraph group_delivery["CLI and HTML"]
  node_cli["CLI options<br/>[Main.java]"]
  node_renderer["HTML renderer<br/>[HtmlRenderer.java]"]
end

subgraph group_ui_data["UI graph data"]
  node_load["Graph loading<br/>[loadGraph.ts]"]
  node_index["Graph index<br/>[graphIndex.ts]"]
  node_format["Graph formatting<br/>[format.ts]"]
end

subgraph group_ui_workspace["Diagram workspace"]
  node_app["Workspace UI<br/>[App.tsx]"]
  node_canvas["Canvas interactions<br/>[Canvas.tsx]"]
  node_canvas_state["Canvas state<br/>[canvasState.ts]"]
  node_canvas_hook["Canvas persistence<br/>[useCanvas.ts]"]
  node_prune["Graph pruning<br/>[prune.ts]"]
  node_layout["Auto arrange<br/>[elkLayout.ts]"]
end

node_user(("Engineer"))
node_inputs["Class inputs"]
node_html["Interactive HTML"]
node_browser(("Browser user"))

node_user -->|"configures"| node_cli
node_cli -->|"accepts"| node_inputs
node_cli -->|"invokes"| node_analyzer
node_analyzer -->|"reads"| node_sources
node_analyzer -->|"builds"| node_hierarchy
node_analyzer -->|"filters"| node_filter
node_analyzer -->|"delegates"| node_builder
node_builder -->|"parses bytecode"| node_asm
node_builder -->|"resolves types"| node_hierarchy
node_builder -->|"detects"| node_entrypoints
node_builder -->|"classifies"| node_stereotypes
node_builder -->|"configures"| node_externalcalls
node_builder -->|"produces"| node_projectmodel
node_analyzer -->|"returns"| node_projectmodel
node_cli -->|"renders"| node_renderer
node_cli -->|"exports JSON"| node_json
node_renderer -->|"serializes"| node_projectmodel
node_renderer -->|"writes"| node_html
node_json -->|"serializes"| node_projectmodel
node_html -.->|"loads graph"| node_load
node_load -.->|"indexes"| node_index
node_index -.->|"supports display"| node_format
node_app -->|"uses"| node_index
node_app -->|"renders"| node_canvas
node_app -->|"arranges"| node_layout
node_canvas -.->|"edits"| node_canvas_hook
node_canvas_hook -->|"reduces actions"| node_canvas_state
node_canvas_hook -->|"prunes"| node_prune
node_canvas_hook -->|"persists locally"| node_browser
node_user -->|"explores diagram"| node_app
node_layout -.->|"arranges cards"| node_browser

click node_cli "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-cli/src/main/java/br/com/douglasoliveira10/javadraw/cli/Main.java"
click node_analyzer "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/Analyzer.java"
click node_sources "https://github.com/douglasoliveira10/javadraw/tree/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/source"
click node_asm "https://github.com/douglasoliveira10/javadraw/tree/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/asm"
click node_hierarchy "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/graph/TypeHierarchy.java"
click node_filter "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/graph/TypeFilter.java"
click node_builder "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/graph/ModelBuilder.java"
click node_entrypoints "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/analysis/EntryPoints.java"
click node_stereotypes "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/analysis/Stereotypes.java"
click node_externalcalls "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/ExternalCalls.java"
click node_projectmodel "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/model/ProjectModel.java"
click node_json "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/export/GraphJsonWriter.java"
click node_renderer "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-cli/src/main/java/br/com/douglasoliveira10/javadraw/cli/HtmlRenderer.java"
click node_load "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-ui/src/data/loadGraph.ts"
click node_index "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-ui/src/data/graphIndex.ts"
click node_format "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-ui/src/data/format.ts"
click node_app "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-ui/src/App.tsx"
click node_canvas "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-ui/src/diagram/Canvas.tsx"
click node_canvas_state "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-ui/src/diagram/canvasState.ts"
click node_canvas_hook "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-ui/src/diagram/useCanvas.ts"
click node_prune "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-ui/src/diagram/prune.ts"
click node_layout "https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-ui/src/layout/elkLayout.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_analyzer,node_sources,node_asm,node_hierarchy,node_filter,node_browser toneBlue
class node_builder,node_entrypoints,node_stereotypes,node_externalcalls,node_projectmodel,node_json toneAmber
class node_cli,node_renderer toneMint
class node_load,node_index,node_format toneRose
class node_app,node_canvas,node_canvas_state,node_canvas_hook,node_prune,node_layout,node_user,node_inputs,node_html toneIndigo
```

## Components

### Bytecode analysis

- [Analyzer](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/Analyzer.java): `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/Analyzer.java`
- [Class sources](https://github.com/douglasoliveira10/javadraw/tree/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/source): `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/source`
- [ASM parsing](https://github.com/douglasoliveira10/javadraw/tree/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/asm): `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/asm`
- [Type hierarchy](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/graph/TypeHierarchy.java): `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/graph/TypeHierarchy.java`
- [Type filtering](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/graph/TypeFilter.java): `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/graph/TypeFilter.java`

### Graph model and export

- [Model builder](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/graph/ModelBuilder.java): `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/graph/ModelBuilder.java`
- [Entry points](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/analysis/EntryPoints.java): `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/analysis/EntryPoints.java`
- [Stereotypes](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/analysis/Stereotypes.java): `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/analysis/Stereotypes.java`
- [External calls](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/ExternalCalls.java): `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/ExternalCalls.java`
- [Project model](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/model/ProjectModel.java): `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/model/ProjectModel.java`
- [Graph JSON](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/export/GraphJsonWriter.java): `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/export/GraphJsonWriter.java`

### CLI and HTML

- [CLI options](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-cli/src/main/java/br/com/douglasoliveira10/javadraw/cli/Main.java): `javadraw-cli/src/main/java/br/com/douglasoliveira10/javadraw/cli/Main.java`
- [HTML renderer](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-cli/src/main/java/br/com/douglasoliveira10/javadraw/cli/HtmlRenderer.java): `javadraw-cli/src/main/java/br/com/douglasoliveira10/javadraw/cli/HtmlRenderer.java`

### UI graph data

- [Graph loading](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-ui/src/data/loadGraph.ts): `javadraw-ui/src/data/loadGraph.ts`
- [Graph index](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-ui/src/data/graphIndex.ts): `javadraw-ui/src/data/graphIndex.ts`
- [Graph formatting](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-ui/src/data/format.ts): `javadraw-ui/src/data/format.ts`

### Diagram workspace

- [Workspace UI](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-ui/src/App.tsx): `javadraw-ui/src/App.tsx`
- [Canvas interactions](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-ui/src/diagram/Canvas.tsx): `javadraw-ui/src/diagram/Canvas.tsx`
- [Canvas state](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-ui/src/diagram/canvasState.ts): `javadraw-ui/src/diagram/canvasState.ts`
- [Canvas persistence](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-ui/src/diagram/useCanvas.ts): `javadraw-ui/src/diagram/useCanvas.ts`
- [Graph pruning](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-ui/src/diagram/prune.ts): `javadraw-ui/src/diagram/prune.ts`
- [Auto arrange](https://github.com/douglasoliveira10/javadraw/blob/main/javadraw-ui/src/layout/elkLayout.ts): `javadraw-ui/src/layout/elkLayout.ts`

### Other components

- **Engineer**
- **Class inputs**
- **Interactive HTML**
- **Browser user**

## Connections

- Engineer → CLI options: configures
- CLI options → Class inputs: accepts (evidence: `javadraw-cli/src/main/java/br/com/douglasoliveira10/javadraw/cli/Main.java`)
- CLI options → Analyzer: invokes (evidence: `javadraw-cli/src/main/java/br/com/douglasoliveira10/javadraw/cli/Main.java`)
- Analyzer → Class sources: reads (evidence: `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/Analyzer.java`)
- Analyzer → Type hierarchy: builds (evidence: `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/Analyzer.java`)
- Analyzer → Type filtering: filters (evidence: `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/Analyzer.java`)
- Analyzer → Model builder: delegates (evidence: `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/Analyzer.java`)
- Model builder → ASM parsing: parses bytecode (evidence: `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/graph/ModelBuilder.java`)
- Model builder → Type hierarchy: resolves types (evidence: `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/graph/ModelBuilder.java`)
- Model builder → Entry points: detects (evidence: `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/graph/ModelBuilder.java`)
- Model builder → Stereotypes: classifies (evidence: `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/graph/ModelBuilder.java`)
- Model builder → External calls: configures (evidence: `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/graph/ModelBuilder.java`)
- Model builder → Project model: produces (evidence: `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/graph/ModelBuilder.java`)
- Analyzer → Project model: returns (evidence: `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/Analyzer.java`)
- CLI options → HTML renderer: renders (evidence: `javadraw-cli/src/main/java/br/com/douglasoliveira10/javadraw/cli/Main.java`)
- CLI options → Graph JSON: exports JSON (evidence: `javadraw-cli/src/main/java/br/com/douglasoliveira10/javadraw/cli/Main.java`)
- HTML renderer → Project model: serializes (evidence: `javadraw-cli/src/main/java/br/com/douglasoliveira10/javadraw/cli/HtmlRenderer.java`)
- HTML renderer → Interactive HTML: writes (evidence: `javadraw-cli/src/main/java/br/com/douglasoliveira10/javadraw/cli/HtmlRenderer.java`)
- Graph JSON → Project model: serializes (evidence: `javadraw-core/src/main/java/br/com/douglasoliveira10/javadraw/export/GraphJsonWriter.java`)
- Interactive HTML → Graph loading: loads graph
- Graph loading → Graph index: indexes
- Graph index → Graph formatting: supports display
- Workspace UI → Graph index: uses (evidence: `javadraw-ui/src/App.tsx`)
- Workspace UI → Canvas interactions: renders (evidence: `javadraw-ui/src/App.tsx`)
- Workspace UI → Auto arrange: arranges (evidence: `javadraw-ui/src/App.tsx`)
- Canvas interactions → Canvas persistence: edits
- Canvas persistence → Canvas state: reduces actions (evidence: `javadraw-ui/src/diagram/useCanvas.ts`)
- Canvas persistence → Graph pruning: prunes (evidence: `javadraw-ui/src/diagram/useCanvas.ts`)
- Canvas persistence → Browser user: persists locally (evidence: `javadraw-ui/src/diagram/useCanvas.ts`)
- Engineer → Workspace UI: explores diagram
- Auto arrange → Browser user: arranges cards
