# programmerbnd/draftscope architecture

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

- Interactive diagram: https://gitdiagram.com/programmerbnd/draftscope
- Repository: https://github.com/programmerbnd/draftscope

## Overview

DraftScope’s sampled Rust runtime is a command-line batch processor: it builds configuration, creates an App, processes generated integers sequentially or in parallel, and can write a JSON summary. The README describes real-time collaborative-document feedback, but the sampled implementation shows no document watching, collaboration, or feedback workflow; the CLI’s input argument is not used. The graph reflects the implemented workflow, not those unverified product claims.

Main entry points: [`src/lib.rs`](https://github.com/programmerbnd/draftscope/blob/main/src/lib.rs) (App orchestrator), [`src/main.rs`](https://github.com/programmerbnd/draftscope/blob/main/src/main.rs) (Command-line entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry"]
  node_cli["Command-line entry<br/>[main.rs]"]
  node_config["Runtime configuration<br/>[lib.rs]"]
end

subgraph group_runtime["Processing runtime"]
  node_app["App orchestrator<br/>[lib.rs]"]
  node_generated["Generated input data<br/>[lib.rs]"]
  node_sequential["Sequential processing<br/>[lib.rs]"]
  node_parallel["Parallel processing<br/>[lib.rs]"]
  node_stats["Processing stats<br/>[lib.rs]"]
end

subgraph group_output["Results output"]
  node_result["JSON result<br/>[lib.rs]"]
end

node_user(("CLI user"))
node_filesystem["Output filesystem"]

node_user -->|"invokes"| node_cli
node_cli -->|"builds"| node_config
node_cli -->|"runs"| node_app
node_app -->|"updates"| node_stats
node_app -->|"generates"| node_generated
node_app -->|"calls when sequential"| node_sequential
node_app -->|"calls when parallel"| node_parallel
node_app -->|"serializes when requested"| node_result
node_app -->|"writes when requested"| node_filesystem

click node_cli "https://github.com/programmerbnd/draftscope/blob/main/src/main.rs"
click node_config "https://github.com/programmerbnd/draftscope/blob/main/src/lib.rs"
click node_app "https://github.com/programmerbnd/draftscope/blob/main/src/lib.rs"
click node_generated "https://github.com/programmerbnd/draftscope/blob/main/src/lib.rs"
click node_sequential "https://github.com/programmerbnd/draftscope/blob/main/src/lib.rs"
click node_parallel "https://github.com/programmerbnd/draftscope/blob/main/src/lib.rs"
click node_stats "https://github.com/programmerbnd/draftscope/blob/main/src/lib.rs"
click node_result "https://github.com/programmerbnd/draftscope/blob/main/src/lib.rs"

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_config,node_user toneBlue
class node_app,node_generated,node_sequential,node_parallel,node_stats toneAmber
class node_result toneMint
class node_filesystem toneIndigo
```

## Components

### CLI entry

- [Command-line entry](https://github.com/programmerbnd/draftscope/blob/main/src/main.rs): `src/main.rs`
- [Runtime configuration](https://github.com/programmerbnd/draftscope/blob/main/src/lib.rs): `src/lib.rs`

### Processing runtime

- [App orchestrator](https://github.com/programmerbnd/draftscope/blob/main/src/lib.rs): `src/lib.rs`
- [Generated input data](https://github.com/programmerbnd/draftscope/blob/main/src/lib.rs): `src/lib.rs`
- [Sequential processing](https://github.com/programmerbnd/draftscope/blob/main/src/lib.rs): `src/lib.rs`
- [Parallel processing](https://github.com/programmerbnd/draftscope/blob/main/src/lib.rs): `src/lib.rs`
- [Processing stats](https://github.com/programmerbnd/draftscope/blob/main/src/lib.rs): `src/lib.rs`

### Results output

- [JSON result](https://github.com/programmerbnd/draftscope/blob/main/src/lib.rs): `src/lib.rs`

### Other components

- **CLI user**
- **Output filesystem**

## Connections

- CLI user → Command-line entry: invokes (evidence: `src/main.rs`)
- Command-line entry → Runtime configuration: builds (evidence: `src/main.rs`)
- Command-line entry → App orchestrator: runs (evidence: `src/main.rs`)
- App orchestrator → Processing stats: updates (evidence: `src/lib.rs`)
- App orchestrator → Generated input data: generates (evidence: `src/lib.rs`)
- App orchestrator → Sequential processing: calls when sequential (evidence: `src/lib.rs`)
- App orchestrator → Parallel processing: calls when parallel (evidence: `src/lib.rs`)
- App orchestrator → JSON result: serializes when requested (evidence: `src/lib.rs`)
- App orchestrator → Output filesystem: writes when requested (evidence: `src/lib.rs`)
