# cuber7649/shakespeare-repriser architecture

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

- Interactive diagram: https://gitdiagram.com/cuber7649/shakespeare-repriser
- Repository: https://github.com/cuber7649/shakespeare-repriser

## Overview

Text Repriser Collection is a client-side set of six literary-style English rewriting pages plus an all-styles dashboard. Users enter text in a style page or dashboard and receive rewritten output; documented companion features include settings, seeded reproducibility, sharing, comparison, quote cards, saved quotes, and offline installation. The tree supplied here contains only tools and the service worker, not the HTML pages or their runtime scripts, so core UI and feature nodes use only paths supported by the README/tree; their internal calls cannot be verified. The browser cache relationship is documented, while other feature wiring is not inferred.

Main entry points: [`index.html`](https://github.com/cuber7649/shakespeare-repriser/blob/main/index.html) (All-style dashboard), [`sw.js`](https://github.com/cuber7649/shakespeare-repriser/blob/main/sw.js) (Offline cache), [`tools/surprise.js`](https://github.com/cuber7649/shakespeare-repriser/blob/main/tools/surprise.js) (Surprise Me), [`tools/compare.js`](https://github.com/cuber7649/shakespeare-repriser/blob/main/tools/compare.js) (Output comparison)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Rewrite experience"]
  node_dashboard["All-style dashboard<br/>[index.html]"]
  node_stylepages["Six style pages"]
  node_rewrite["Text rewriting"]
  node_settings["Transform settings"]
  node_seed["Seeded variation"]
  node_navigation["Style navigation"]
  node_surprise["Surprise Me<br/>[surprise.js]"]
end

subgraph group_features["Quote features"]
  node_compare["Output comparison<br/>[compare.js]"]
  node_share["Shareable links<br/>[sharelink.js]"]
  node_cards["Quote card export<br/>[quotecard.js]"]
  node_saved[("Saved quotes<br/>[savedquotes.js]")]
end

subgraph group_offline["Offline app"]
  node_offlineuser["Installable app"]
  node_serviceworker["Offline cache<br/>[sw.js]"]
end

node_visitor(("Text author"))
node_browser[("Browser storage")]

node_visitor -->|"enters text"| node_dashboard
node_visitor -->|"enters text"| node_stylepages
node_dashboard -->|"rewrites six styles"| node_rewrite
node_stylepages -->|"rewrites selected style"| node_rewrite
node_settings -->|"configures transforms"| node_rewrite
node_seed -->|"pins choices"| node_rewrite
node_surprise -->|"runs sample"| node_rewrite
node_rewrite -->|"supplies output"| node_compare
node_rewrite -->|"supplies output"| node_cards
node_rewrite -->|"saves result"| node_saved
node_rewrite -->|"encodes run"| node_share
node_visitor -->|"installs app"| node_offlineuser
node_offlineuser -.->|"registers worker"| node_serviceworker
node_serviceworker -->|"caches pages"| node_browser

click node_dashboard "https://github.com/cuber7649/shakespeare-repriser/blob/main/index.html"
click node_surprise "https://github.com/cuber7649/shakespeare-repriser/blob/main/tools/surprise.js"
click node_compare "https://github.com/cuber7649/shakespeare-repriser/blob/main/tools/compare.js"
click node_share "https://github.com/cuber7649/shakespeare-repriser/blob/main/tools/sharelink.js"
click node_cards "https://github.com/cuber7649/shakespeare-repriser/blob/main/tools/quotecard.js"
click node_saved "https://github.com/cuber7649/shakespeare-repriser/blob/main/tools/savedquotes.js"
click node_serviceworker "https://github.com/cuber7649/shakespeare-repriser/blob/main/sw.js"

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_dashboard,node_stylepages,node_rewrite,node_settings,node_seed,node_navigation,node_surprise toneBlue
class node_compare,node_share,node_cards,node_saved,node_browser toneAmber
class node_offlineuser,node_serviceworker toneMint
class node_visitor toneIndigo
```

## Components

### Rewrite experience

- [All-style dashboard](https://github.com/cuber7649/shakespeare-repriser/blob/main/index.html): `index.html`
- **Six style pages**
- **Text rewriting**
- **Transform settings**
- **Seeded variation**
- **Style navigation**
- [Surprise Me](https://github.com/cuber7649/shakespeare-repriser/blob/main/tools/surprise.js): `tools/surprise.js`

### Quote features

- [Output comparison](https://github.com/cuber7649/shakespeare-repriser/blob/main/tools/compare.js): `tools/compare.js`
- [Shareable links](https://github.com/cuber7649/shakespeare-repriser/blob/main/tools/sharelink.js): `tools/sharelink.js`
- [Quote card export](https://github.com/cuber7649/shakespeare-repriser/blob/main/tools/quotecard.js): `tools/quotecard.js`
- [Saved quotes](https://github.com/cuber7649/shakespeare-repriser/blob/main/tools/savedquotes.js): `tools/savedquotes.js`

### Offline app

- **Installable app**
- [Offline cache](https://github.com/cuber7649/shakespeare-repriser/blob/main/sw.js): `sw.js`

### Other components

- **Text author**
- **Browser storage**

## Connections

- Text author → All-style dashboard: enters text (evidence: `README.md`)
- Text author → Six style pages: enters text (evidence: `README.md`)
- All-style dashboard → Text rewriting: rewrites six styles (evidence: `README.md`)
- Six style pages → Text rewriting: rewrites selected style (evidence: `README.md`)
- Transform settings → Text rewriting: configures transforms (evidence: `README.md`)
- Seeded variation → Text rewriting: pins choices (evidence: `README.md`)
- Surprise Me → Text rewriting: runs sample (evidence: `README.md`)
- Text rewriting → Output comparison: supplies output (evidence: `README.md`)
- Text rewriting → Quote card export: supplies output (evidence: `README.md`)
- Text rewriting → Saved quotes: saves result (evidence: `README.md`)
- Text rewriting → Shareable links: encodes run (evidence: `README.md`)
- Text author → Installable app: installs app (evidence: `README.md`)
- Installable app → Offline cache: registers worker
- Offline cache → Browser storage: caches pages (evidence: `sw.js`)
