# mc-cya2014/qr-fault architecture

> Architecture diagram of the GitHub repository mc-cya2014/qr-fault, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mc-cya2014/qr-fault
- Repository: https://github.com/mc-cya2014/qr-fault

## Overview

QR//FAULT is an intentionally broken, offline QR-code prank/demo. The documented workflow accepts text only to count its characters, discards it, then selects a non-recent error message, generates a QR code containing that error, and displays it with failure metadata and a log; users can download the PNG or try again. The README describes these responsibilities as inline in `index.html`, but no source excerpts were provided, so edges reflect documented behavior only; the README’s alternate filename is not in the supplied tree.

Main entry points: [`index.html`](https://github.com/mc-cya2014/qr-fault/blob/main/index.html) (Failure progress)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_input["Input and discard<br/>[index.html]"]
  node_progress["Failure progress<br/>[index.html]"]
  node_result["Result and metadata<br/>[index.html]"]
  node_settings["Ignored settings<br/>[index.html]"]
end

subgraph group_failure["Failure generation"]
  node_errorpool["Error text pool<br/>[index.html]"]
  node_chooser["Avoid-repeat chooser<br/>[index.html]"]
  node_errorcode["Error code<br/>[index.html]"]
end

subgraph group_output["QR output"]
  node_qrencoder["QR encoder<br/>[index.html]"]
  node_canvas["Canvas QR rendering<br/>[index.html]"]
  node_history[("Failure history<br/>[index.html]")]
  node_download["PNG download<br/>[index.html]"]
end

node_user(("User"))

node_user -->|"enters text"| node_input
node_input -->|"shows count"| node_result
node_user -->|"starts generation"| node_progress
node_progress -->|"runs selection"| node_chooser
node_chooser -->|"selects text"| node_errorpool
node_chooser -->|"creates code"| node_errorcode
node_errorcode -->|"fills placeholder"| node_errorpool
node_progress -->|"generates QR"| node_qrencoder
node_qrencoder -->|"draws matrix"| node_canvas
node_canvas -->|"displays QR"| node_result
node_progress -->|"updates metadata"| node_result
node_progress -->|"records failure"| node_history
node_history -->|"renders log"| node_result
node_user -->|"requests PNG"| node_download
node_canvas -->|"exports PNG"| node_download
node_user -->|"selects setting"| node_settings

click node_input "https://github.com/mc-cya2014/qr-fault/blob/main/index.html"
click node_progress "https://github.com/mc-cya2014/qr-fault/blob/main/index.html"
click node_result "https://github.com/mc-cya2014/qr-fault/blob/main/index.html"
click node_settings "https://github.com/mc-cya2014/qr-fault/blob/main/index.html"
click node_errorpool "https://github.com/mc-cya2014/qr-fault/blob/main/index.html"
click node_chooser "https://github.com/mc-cya2014/qr-fault/blob/main/index.html"
click node_errorcode "https://github.com/mc-cya2014/qr-fault/blob/main/index.html"
click node_qrencoder "https://github.com/mc-cya2014/qr-fault/blob/main/index.html"
click node_canvas "https://github.com/mc-cya2014/qr-fault/blob/main/index.html"
click node_history "https://github.com/mc-cya2014/qr-fault/blob/main/index.html"
click node_download "https://github.com/mc-cya2014/qr-fault/blob/main/index.html"

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_input,node_progress,node_result,node_settings,node_user toneBlue
class node_errorpool,node_chooser,node_errorcode toneAmber
class node_qrencoder,node_canvas,node_history,node_download toneMint
```

## Components

### User interface

- [Input and discard](https://github.com/mc-cya2014/qr-fault/blob/main/index.html): `index.html`
- [Failure progress](https://github.com/mc-cya2014/qr-fault/blob/main/index.html): `index.html`
- [Result and metadata](https://github.com/mc-cya2014/qr-fault/blob/main/index.html): `index.html`
- [Ignored settings](https://github.com/mc-cya2014/qr-fault/blob/main/index.html): `index.html`

### Failure generation

- [Error text pool](https://github.com/mc-cya2014/qr-fault/blob/main/index.html): `index.html`
- [Avoid-repeat chooser](https://github.com/mc-cya2014/qr-fault/blob/main/index.html): `index.html`
- [Error code](https://github.com/mc-cya2014/qr-fault/blob/main/index.html): `index.html`

### QR output

- [QR encoder](https://github.com/mc-cya2014/qr-fault/blob/main/index.html): `index.html`
- [Canvas QR rendering](https://github.com/mc-cya2014/qr-fault/blob/main/index.html): `index.html`
- [Failure history](https://github.com/mc-cya2014/qr-fault/blob/main/index.html): `index.html`
- [PNG download](https://github.com/mc-cya2014/qr-fault/blob/main/index.html): `index.html`

### Other components

- **User**

## Connections

- User → Input and discard: enters text (evidence: `README.md`)
- Input and discard → Result and metadata: shows count (evidence: `README.md`)
- User → Failure progress: starts generation (evidence: `README.md`)
- Failure progress → Avoid-repeat chooser: runs selection (evidence: `README.md`)
- Avoid-repeat chooser → Error text pool: selects text (evidence: `README.md`)
- Avoid-repeat chooser → Error code: creates code (evidence: `README.md`)
- Error code → Error text pool: fills placeholder (evidence: `README.md`)
- Failure progress → QR encoder: generates QR (evidence: `README.md`)
- QR encoder → Canvas QR rendering: draws matrix (evidence: `README.md`)
- Canvas QR rendering → Result and metadata: displays QR (evidence: `README.md`)
- Failure progress → Result and metadata: updates metadata (evidence: `README.md`)
- Failure progress → Failure history: records failure (evidence: `README.md`)
- Failure history → Result and metadata: renders log (evidence: `README.md`)
- User → PNG download: requests PNG (evidence: `README.md`)
- Canvas QR rendering → PNG download: exports PNG (evidence: `README.md`)
- User → Ignored settings: selects setting (evidence: `README.md`)
