# closetgeekshow/gptpromptexperiments architecture

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

- Interactive diagram: https://gitdiagram.com/closetgeekshow/gptpromptexperiments
- Repository: https://github.com/closetgeekshow/gptpromptexperiments

## Overview

##### Project type and purpose
- From the README (“a collection of prompts I’ve tried for various purposes”) and file tree, this is an open-source “prompt experiments” repository. It is essentially a knowledge-base and interactive demo collection, not a traditional full-stack application. Its primary purpose is to store, organize, and run prompt-engineering experiments (markdown files) and small browser-based demos (the flems subfolder).

##### File structure
- Top-level directories:
- Approaches – curated prompt workflows (Story→Charts→Code, Story→Tasks→Code, etc.)
- Generic – general prompting recipes (code repair, doc comments, refactor, etc.)
- flems – a mini front-end code sandbox using flems-sfc.js & HTML, hosting live examples
- scratchpad – ad-hoc prompt/testing notes
- Root files: LICENSE, README.md describe the project
- No backend or database; the only “runtime” component is the flems client (JavaScript in browser).
- No build scripts or CI present; mostly static markdown and static HTML/JS.

##### Extract additional insights from the README
- Emphasis on breaking down prompts into stages (Story→Tasks→Code, etc.)

a. Main components
1) Prompt Repository
– A collection of Markdown files organized under Approaches, Generic, scratchpad
2) Interactive Demo Runner (flems)
– flems-sfc.js + index.html in flems/src loads Single File Components (.flems files)
3) User Environment
– Local Editor (VSCode, etc.) reading/editing markdown & HTML/JS
– Web Browser rendering flems demos
4) Source Control / Host
– GitHub (repo storage, versioning)
b. Relationships & Data Flow
– User edits markdown prompts in local editor → commits to GitHub
– flems HTML/JS reads .flems files → browser renders interactive components
– User interacts with demos in browser → tests prompt outputs live
c. Architectural Patterns
– Static content repository (markdown + static site assets)
– Modular folder structure by purpose (Approaches vs. Generic vs. scratchpad vs. demos)
– Single-page demo runner pattern (flems)
d. Key technologies
– Markdown (prompt definitions)
– flems-sfc.js, HTML, CSS, Vanilla JS (interactive demo)
– Git/GitHub (source control)

##### Detail
- That flems is the only runtime component.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User Environment
    subgraph "User Environment"
        Editor["Local Editor (VSCode, etc.)"]:::editor
        Browser["Web Browser (flems Runner)"]:::runner
    end

    %% Content Repositories
    subgraph "Content Repositories"
        subgraph "Prompt Repository (Markdown)"
            Approaches["Approaches/*.md"]:::content
            Generic["Generic/*.md"]:::content
            Scratch["scratchpad/*.md"]:::content
        end
        subgraph "Interactive Demo Runner (flems)"
            index["index.html"]:::content
            flemsjs["flems-sfc.js"]:::content
            subgraph "SFC Components"
                hello["hello-world.flems"]:::content
                excali["excalidraw.flems"]:::content
                mtg["mtg-card-viewer.flems"]:::content
            end
        end
        subgraph "flems Documentation"
            fdoc1["README.md"]:::content
            fdoc2["convert to flems format.md"]:::content
        end
        subgraph "Project Metadata & Overview"
            readme["README.md"]:::content
            license["LICENSE"]:::content
        end
    end

    %% Source Control / Hosting
    GitHub["GitHub (Repo Storage)"]:::source

    %% Relationships
    Editor -->|"edit files"| Approaches
    Editor -->|"edit files"| Generic
    Editor -->|"edit files"| Scratch
    Editor -->|"edit demos"| index
    Editor -->|"edit demos"| flemsjs
    Editor -->|"edit demos"| hello
    Editor -->|"edit demos"| excali
    Editor -->|"edit demos"| mtg
    Editor -->|"edit docs"| fdoc1
    Editor -->|"edit docs"| fdoc2
    Editor -->|"edit metadata"| readme
    Editor -->|"edit metadata"| license

    Approaches -->|"push/pull"| GitHub
    Generic -->|"push/pull"| GitHub
    Scratch -->|"push/pull"| GitHub
    index -->|"push/pull"| GitHub
    flemsjs -->|"push/pull"| GitHub
    hello -->|"push/pull"| GitHub
    excali -->|"push/pull"| GitHub
    mtg -->|"push/pull"| GitHub
    fdoc1 -->|"push/pull"| GitHub
    fdoc2 -->|"push/pull"| GitHub
    readme -->|"push/pull"| GitHub
    license -->|"push/pull"| GitHub

    GitHub -->|"clone/pull"| Editor

    index -->|"serve static HTML/JS"| Browser
    flemsjs -->|"execute JS"| Browser
    Browser -->|"load component"| hello
    Browser -->|"load component"| excali
    Browser -->|"load component"| mtg
    Browser -->|"render UI"| Browser
    Browser -->|"test prompts"| Editor

    %% Click Events
    click Approaches "https://github.com/closetgeekshow/gptpromptexperiments/tree/main/Approaches/"
    click Generic "https://github.com/closetgeekshow/gptpromptexperiments/tree/main/Generic/"
    click Scratch "https://github.com/closetgeekshow/gptpromptexperiments/tree/main/scratchpad/"
    click index "https://github.com/closetgeekshow/gptpromptexperiments/blob/main/flems/src/index.html"
    click flemsjs "https://github.com/closetgeekshow/gptpromptexperiments/blob/main/flems/src/flems-sfc.js"
    click hello "https://github.com/closetgeekshow/gptpromptexperiments/blob/main/flems/src/sfc/hello-world.flems"
    click excali "https://github.com/closetgeekshow/gptpromptexperiments/blob/main/flems/src/sfc/excalidraw.flems"
    click mtg "https://github.com/closetgeekshow/gptpromptexperiments/blob/main/flems/src/sfc/mtg-card-viewer.flems"
    click fdoc1 "https://github.com/closetgeekshow/gptpromptexperiments/blob/main/flems/README.md"
    click fdoc2 "https://github.com/closetgeekshow/gptpromptexperiments/blob/main/flems/convert to flems format.md"
    click readme "https://github.com/closetgeekshow/gptpromptexperiments/blob/main/README.md"
    click license "https://github.com/closetgeekshow/gptpromptexperiments/tree/main/LICENSE"

    %% Styles
    classDef content fill:#B3CDE3,stroke:#333,stroke-width:1px,font-weight:bold
    classDef source fill:#CCEBC5,stroke:#333,stroke-width:1px,font-weight:bold
    classDef runner fill:#FBB4AE,stroke:#333,stroke-width:1px,font-weight:bold
    classDef editor fill:#E5E5E5,stroke:#333,stroke-width:1px,font-weight:bold
```
