# bra1ndump/show-me-chatgpt-plugin architecture

> Architecture diagram of the GitHub repository bra1ndump/show-me-chatgpt-plugin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bra1ndump/show-me-chatgpt-plugin
- Repository: https://github.com/bra1ndump/show-me-chatgpt-plugin

## Overview

Show Me is a ChatGPT plugin for creating, rendering, editing, and sharing diagrams. The principal workflow sends a diagram request to the render endpoint, selects language-specific formatting, obtains SVG from Kroki, and returns render and editor links; valid results can be stored behind short links. The service also exposes plugin metadata and privacy pages, collects collaboration emails, and tracks usage. The README documents broad diagram-language support through Kroki; sampled implementation shows Mermaid and PlantUML-specific editor handling. Connections reflect shown calls or README statements; unsampled behavior is not inferred.

Main entry points: [`src/index.ts`](https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/index.ts) (Worker Router), [`src/routes/Diagram.ts`](https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/routes/Diagram.ts) (Render Endpoint), [`src/routes/diagrams/index.ts`](https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/routes/diagrams/index.ts) (Diagram Dispatcher), [`src/routes/Shorten.ts`](https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/routes/Shorten.ts) (Short Link Routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Plugin API"]
  node_router["Worker Router<br/>[index.ts]"]
  node_render_handler["Render Endpoint<br/>[Diagram.ts]"]
  node_manifest["Plugin Manifest<br/>[index.ts]"]
end

subgraph group_render["Diagram Rendering"]
  node_details["Diagram Dispatcher<br/>[index.ts]"]
  node_mermaid["Mermaid Formatting<br/>[mermaid.ts]"]
  node_plantuml["PlantUML Editor Link<br/>[plantuml.ts]"]
  node_render_utils["Encoding and Fetch<br/>[utils.ts]"]
end

subgraph group_share["Sharing and Editing"]
  node_short_links["Short Link Routes<br/>[Shorten.ts]"]
  node_kv[("Cloudflare KV")]
  node_editor_form["Editor Email Form<br/>[CollectEmail.ts]"]
end

subgraph group_support["Plugin Support"]
  node_privacy["Privacy Page<br/>[privacy-page.ts]"]
  node_logo["Plugin Logo<br/>[logo.ts]"]
  node_email_route["Join Email Route<br/>[CollectEmail.ts]"]
  node_analytics["Usage Tracking<br/>[mixpanel.ts]"]
end

node_chatgpt(("ChatGPT"))
node_kroki["Kroki Renderer"]
node_mermaid_editor["Mermaid Live"]
node_plantuml_editor["PlantUML Editor"]
node_mailchimp["Mailchimp"]
node_mixpanel["Mixpanel"]

node_chatgpt -->|"calls plugin"| node_router
node_router -->|"routes render"| node_render_handler
node_render_handler -->|"dispatches diagram"| node_details
node_details -->|"formats Mermaid"| node_mermaid
node_details -->|"builds editor link"| node_plantuml
node_details -->|"encodes and fetches"| node_render_utils
node_render_utils -->|"requests SVG"| node_kroki
node_mermaid -->|"encodes editor data"| node_render_utils
node_mermaid -->|"creates edit link"| node_mermaid_editor
node_plantuml -->|"creates edit link"| node_plantuml_editor
node_render_handler -->|"saves render links"| node_short_links
node_short_links -->|"writes and reads"| node_kv
node_router -->|"routes short links"| node_short_links
node_short_links -->|"renders editor"| node_editor_form
node_router -->|"routes email signup"| node_email_route
node_email_route -->|"subscribes email"| node_mailchimp
node_router -->|"serves manifest"| node_manifest
node_router -->|"serves policy"| node_privacy
node_router -->|"serves logo"| node_logo
node_render_handler -->|"tracks renders"| node_analytics
node_analytics -->|"sends events"| node_mixpanel

click node_router "https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/index.ts"
click node_render_handler "https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/routes/Diagram.ts"
click node_manifest "https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/index.ts"
click node_details "https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/routes/diagrams/index.ts"
click node_mermaid "https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/routes/diagrams/mermaid.ts"
click node_plantuml "https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/routes/diagrams/plantuml.ts"
click node_render_utils "https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/routes/diagrams/utils.ts"
click node_short_links "https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/routes/Shorten.ts"
click node_editor_form "https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/routes/CollectEmail.ts"
click node_privacy "https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/privacy-page.ts"
click node_logo "https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/logo.ts"
click node_email_route "https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/routes/CollectEmail.ts"
click node_analytics "https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/mixpanel.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_router,node_render_handler,node_manifest toneBlue
class node_details,node_mermaid,node_plantuml,node_render_utils toneAmber
class node_short_links,node_kv,node_editor_form toneMint
class node_privacy,node_logo,node_email_route,node_analytics toneRose
class node_chatgpt,node_kroki,node_mermaid_editor,node_plantuml_editor,node_mailchimp,node_mixpanel toneIndigo
```

## Components

### Plugin API

- [Worker Router](https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/index.ts): `src/index.ts`
- [Render Endpoint](https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/routes/Diagram.ts): `src/routes/Diagram.ts`
- [Plugin Manifest](https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/index.ts): `src/index.ts`

### Diagram Rendering

- [Diagram Dispatcher](https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/routes/diagrams/index.ts): `src/routes/diagrams/index.ts`
- [Mermaid Formatting](https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/routes/diagrams/mermaid.ts): `src/routes/diagrams/mermaid.ts`
- [PlantUML Editor Link](https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/routes/diagrams/plantuml.ts): `src/routes/diagrams/plantuml.ts`
- [Encoding and Fetch](https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/routes/diagrams/utils.ts): `src/routes/diagrams/utils.ts`

### Sharing and Editing

- [Short Link Routes](https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/routes/Shorten.ts): `src/routes/Shorten.ts`
- **Cloudflare KV**
- [Editor Email Form](https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/routes/CollectEmail.ts): `src/routes/CollectEmail.ts`

### Plugin Support

- [Privacy Page](https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/privacy-page.ts): `src/privacy-page.ts`
- [Plugin Logo](https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/logo.ts): `src/logo.ts`
- [Join Email Route](https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/routes/CollectEmail.ts): `src/routes/CollectEmail.ts`
- [Usage Tracking](https://github.com/bra1ndump/show-me-chatgpt-plugin/blob/main/src/mixpanel.ts): `src/mixpanel.ts`

### Other components

- **ChatGPT**
- **Kroki Renderer**
- **Mermaid Live**
- **PlantUML Editor**
- **Mailchimp**
- **Mixpanel**

## Connections

- ChatGPT → Worker Router: calls plugin (evidence: `README.md`)
- Worker Router → Render Endpoint: routes render (evidence: `src/index.ts`)
- Render Endpoint → Diagram Dispatcher: dispatches diagram (evidence: `src/routes/Diagram.ts`)
- Diagram Dispatcher → Mermaid Formatting: formats Mermaid (evidence: `src/routes/diagrams/index.ts`)
- Diagram Dispatcher → PlantUML Editor Link: builds editor link (evidence: `src/routes/diagrams/index.ts`)
- Diagram Dispatcher → Encoding and Fetch: encodes and fetches (evidence: `src/routes/diagrams/index.ts`)
- Encoding and Fetch → Kroki Renderer: requests SVG (evidence: `src/routes/diagrams/utils.ts`)
- Mermaid Formatting → Encoding and Fetch: encodes editor data (evidence: `src/routes/diagrams/mermaid.ts`)
- Mermaid Formatting → Mermaid Live: creates edit link (evidence: `src/routes/diagrams/mermaid.ts`)
- PlantUML Editor Link → PlantUML Editor: creates edit link (evidence: `src/routes/diagrams/plantuml.ts`)
- Render Endpoint → Short Link Routes: saves render links (evidence: `src/routes/Diagram.ts`)
- Short Link Routes → Cloudflare KV: writes and reads (evidence: `src/routes/Shorten.ts`)
- Worker Router → Short Link Routes: routes short links (evidence: `src/index.ts`)
- Short Link Routes → Editor Email Form: renders editor (evidence: `src/routes/Shorten.ts`)
- Worker Router → Join Email Route: routes email signup (evidence: `src/index.ts`)
- Join Email Route → Mailchimp: subscribes email (evidence: `src/routes/CollectEmail.ts`)
- Worker Router → Plugin Manifest: serves manifest (evidence: `src/index.ts`)
- Worker Router → Privacy Page: serves policy (evidence: `src/index.ts`)
- Worker Router → Plugin Logo: serves logo (evidence: `src/index.ts`)
- Render Endpoint → Usage Tracking: tracks renders (evidence: `src/routes/Diagram.ts`)
- Usage Tracking → Mixpanel: sends events (evidence: `src/mixpanel.ts`)
