# ldn-softdev/jtc architecture

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

- Interactive diagram: https://gitdiagram.com/ldn-softdev/jtc
- Repository: https://github.com/ldn-softdev/jtc

## Overview

`jtc` is a command-line JSON extraction and transformation tool. The principal workflow is to accept command-line options and JSON input, select data with walk paths, apply requested operations, and emit JSON or comparison results. The README also documents templates, namespaces, regex searches, streaming, concurrent reads, in-place edits, and optional shell evaluation. The source excerpts expose the CLI, JSON model, input abstraction, and threading; some feature links rely on README statements and the SOURCE INDEX rather than complete call sites.

Main entry points: [`jtc.cpp`](https://github.com/ldn-softdev/jtc/blob/master/jtc.cpp) (Command workflow), [`lib/extensions.hpp`](https://github.com/ldn-softdev/jtc/blob/master/lib/extensions.hpp) (C++ extensions), [`lib/dbg.hpp`](https://github.com/ldn-softdev/jtc/blob/master/lib/dbg.hpp) (Debugging), [`lib/Json.hpp`](https://github.com/ldn-softdev/jtc/blob/master/lib/Json.hpp) (JSON tree and walk paths)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and guidance"]
  node_cli["Command workflow<br/>[jtc.cpp]"]
  node_options["Option parsing<br/>[getoptions.hpp]"]
  node_guides["Embedded usage guide<br/>[jtc_guide.hpp]"]
  node_walkguide["Walk-path guide<br/>[wp_guide.hpp]"]
end

subgraph group_json["JSON processing"]
  node_json["JSON tree and walk paths<br/>[Json.hpp]"]
  node_output["JSON output<br/>[jtc.cpp]"]
end

subgraph group_io["Input and execution"]
  node_input["Input streams<br/>[Streamstr.hpp]"]
  node_threads["Concurrent dispatch<br/>[ThreadMaster.hpp]"]
  node_signal["Signal handling<br/>[signals.hpp]"]
  node_shell["Shell evaluation<br/>[shell.hpp]"]
end

subgraph group_support["Runtime support"]
  node_outable["Object formatting<br/>[Outable.hpp]"]
  node_debug["Debugging<br/>[dbg.hpp]"]
  node_debugflow["Flow tracing<br/>[dbgflow.hpp]"]
  node_extensions["C++ extensions<br/>[extensions.hpp]"]
  node_macros["Macro utilities<br/>[macrolib.hpp]"]
end

node_user(("CLI user"))
node_result(("JSON result"))

node_user -->|"runs"| node_cli
node_cli -->|"parses options"| node_options
node_cli -->|"uses input"| node_input
node_cli -->|"processes JSON"| node_json
node_cli -->|"dispatches reads"| node_threads
node_cli -->|"uses signals"| node_signal
node_cli -->|"prints guidance"| node_guides
node_guides -->|"includes guide"| node_walkguide
node_cli -.->|"may evaluate commands"| node_shell
node_cli -->|"writes results"| node_output
node_output -->|"emits JSON"| node_result
node_json -->|"uses formatting"| node_outable
node_json -->|"uses stream abstraction"| node_input
node_json -->|"uses extensions"| node_extensions
node_outable -->|"uses extensions"| node_extensions
node_outable -->|"uses macros"| node_macros
node_input -->|"uses extensions"| node_extensions
node_threads -->|"uses debugging"| node_debug
node_threads -->|"uses extensions"| node_extensions
node_options -->|"uses extensions"| node_extensions
node_shell -->|"uses debugging"| node_debug
node_shell -->|"uses extensions"| node_extensions
node_debugflow -->|"uses debugging"| node_debug
node_debug -->|"uses macros"| node_macros
node_debug -->|"uses extensions"| node_extensions
node_extensions -->|"uses macros"| node_macros

click node_cli "https://github.com/ldn-softdev/jtc/blob/master/jtc.cpp"
click node_options "https://github.com/ldn-softdev/jtc/blob/master/lib/getoptions.hpp"
click node_guides "https://github.com/ldn-softdev/jtc/blob/master/lib/jtc_guide.hpp"
click node_walkguide "https://github.com/ldn-softdev/jtc/blob/master/lib/wp_guide.hpp"
click node_input "https://github.com/ldn-softdev/jtc/blob/master/lib/Streamstr.hpp"
click node_threads "https://github.com/ldn-softdev/jtc/blob/master/lib/ThreadMaster.hpp"
click node_signal "https://github.com/ldn-softdev/jtc/blob/master/lib/signals.hpp"
click node_json "https://github.com/ldn-softdev/jtc/blob/master/lib/Json.hpp"
click node_output "https://github.com/ldn-softdev/jtc/blob/master/jtc.cpp"
click node_shell "https://github.com/ldn-softdev/jtc/blob/master/lib/shell.hpp"
click node_outable "https://github.com/ldn-softdev/jtc/blob/master/lib/Outable.hpp"
click node_debug "https://github.com/ldn-softdev/jtc/blob/master/lib/dbg.hpp"
click node_debugflow "https://github.com/ldn-softdev/jtc/blob/master/lib/dbgflow.hpp"
click node_extensions "https://github.com/ldn-softdev/jtc/blob/master/lib/extensions.hpp"
click node_macros "https://github.com/ldn-softdev/jtc/blob/master/lib/macrolib.hpp"

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_cli,node_options,node_guides,node_walkguide,node_user toneBlue
class node_json,node_output toneAmber
class node_input,node_threads,node_signal,node_shell toneMint
class node_outable,node_debug,node_debugflow,node_extensions,node_macros toneRose
class node_result toneIndigo
```

## Components

### CLI and guidance

- [Command workflow](https://github.com/ldn-softdev/jtc/blob/master/jtc.cpp): `jtc.cpp`
- [Option parsing](https://github.com/ldn-softdev/jtc/blob/master/lib/getoptions.hpp): `lib/getoptions.hpp`
- [Embedded usage guide](https://github.com/ldn-softdev/jtc/blob/master/lib/jtc_guide.hpp): `lib/jtc_guide.hpp`
- [Walk-path guide](https://github.com/ldn-softdev/jtc/blob/master/lib/wp_guide.hpp): `lib/wp_guide.hpp`

### JSON processing

- [JSON tree and walk paths](https://github.com/ldn-softdev/jtc/blob/master/lib/Json.hpp): `lib/Json.hpp`
- [JSON output](https://github.com/ldn-softdev/jtc/blob/master/jtc.cpp): `jtc.cpp`

### Input and execution

- [Input streams](https://github.com/ldn-softdev/jtc/blob/master/lib/Streamstr.hpp): `lib/Streamstr.hpp`
- [Concurrent dispatch](https://github.com/ldn-softdev/jtc/blob/master/lib/ThreadMaster.hpp): `lib/ThreadMaster.hpp`
- [Signal handling](https://github.com/ldn-softdev/jtc/blob/master/lib/signals.hpp): `lib/signals.hpp`
- [Shell evaluation](https://github.com/ldn-softdev/jtc/blob/master/lib/shell.hpp): `lib/shell.hpp`

### Runtime support

- [Object formatting](https://github.com/ldn-softdev/jtc/blob/master/lib/Outable.hpp): `lib/Outable.hpp`
- [Debugging](https://github.com/ldn-softdev/jtc/blob/master/lib/dbg.hpp): `lib/dbg.hpp`
- [Flow tracing](https://github.com/ldn-softdev/jtc/blob/master/lib/dbgflow.hpp): `lib/dbgflow.hpp`
- [C++ extensions](https://github.com/ldn-softdev/jtc/blob/master/lib/extensions.hpp): `lib/extensions.hpp`
- [Macro utilities](https://github.com/ldn-softdev/jtc/blob/master/lib/macrolib.hpp): `lib/macrolib.hpp`

### Other components

- **CLI user**
- **JSON result**

## Connections

- CLI user → Command workflow: runs (evidence: `README.md`)
- Command workflow → Option parsing: parses options (evidence: `jtc.cpp`)
- Command workflow → Input streams: uses input (evidence: `jtc.cpp`)
- Command workflow → JSON tree and walk paths: processes JSON (evidence: `jtc.cpp`)
- Command workflow → Concurrent dispatch: dispatches reads (evidence: `jtc.cpp`)
- Command workflow → Signal handling: uses signals (evidence: `jtc.cpp`)
- Command workflow → Embedded usage guide: prints guidance (evidence: `lib/jtc_guide.hpp`)
- Embedded usage guide → Walk-path guide: includes guide (evidence: `lib/jtc_guide.hpp`)
- Command workflow → Shell evaluation: may evaluate commands (evidence: `README.md`)
- Command workflow → JSON output: writes results (evidence: `jtc.cpp`)
- JSON output → JSON result: emits JSON (evidence: `jtc.cpp`)
- JSON tree and walk paths → Object formatting: uses formatting (evidence: `lib/Json.hpp`)
- JSON tree and walk paths → Input streams: uses stream abstraction (evidence: `lib/Json.hpp`)
- JSON tree and walk paths → C++ extensions: uses extensions (evidence: `lib/Json.hpp`)
- Object formatting → C++ extensions: uses extensions (evidence: `lib/Outable.hpp`)
- Object formatting → Macro utilities: uses macros (evidence: `lib/Outable.hpp`)
- Input streams → C++ extensions: uses extensions (evidence: `lib/Streamstr.hpp`)
- Concurrent dispatch → Debugging: uses debugging (evidence: `lib/ThreadMaster.hpp`)
- Concurrent dispatch → C++ extensions: uses extensions (evidence: `lib/ThreadMaster.hpp`)
- Option parsing → C++ extensions: uses extensions (evidence: `lib/getoptions.hpp`)
- Shell evaluation → Debugging: uses debugging (evidence: `lib/shell.hpp`)
- Shell evaluation → C++ extensions: uses extensions (evidence: `lib/shell.hpp`)
- Flow tracing → Debugging: uses debugging (evidence: `lib/dbgflow.hpp`)
- Debugging → Macro utilities: uses macros (evidence: `lib/dbg.hpp`)
- Debugging → C++ extensions: uses extensions (evidence: `lib/dbg.hpp`)
- C++ extensions → Macro utilities: uses macros (evidence: `lib/extensions.hpp`)
