# sudhanshupal123/promptstudio architecture

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

- Interactive diagram: https://gitdiagram.com/sudhanshupal123/promptstudio
- Repository: https://github.com/sudhanshupal123/promptstudio

## Overview

This is a browser-based Gemini prompt gallery and studio. Users browse category cards, open a selected category in the studio, view its prompts, and copy prompt text. The main page also supports feedback submission and theme switching; the studio shares theme behavior. The tree also includes a legal page and image assets. The README is empty, so relationships and workflows below are limited to the sampled JavaScript; the HTML pages and JSON data were not inspected.

Main entry points: [`scripts/index.js`](https://github.com/sudhanshupal123/promptstudio/blob/main/scripts/index.js) (Gallery Renderer), [`scripts/GeminiPrompt.js`](https://github.com/sudhanshupal123/promptstudio/blob/main/scripts/GeminiPrompt.js) (Prompt Renderer), [`gemini_prompt/PromptStudio.html`](https://github.com/sudhanshupal123/promptstudio/blob/main/gemini_prompt/PromptStudio.html) (Studio Page), [`scripts/ThemeMode.js`](https://github.com/sudhanshupal123/promptstudio/blob/main/scripts/ThemeMode.js) (Theme Toggle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pages["Web Pages"]
  node_home["Gallery Page<br/>[index.html]"]
  node_studio_page["Studio Page<br/>[PromptStudio.html]"]
  node_legal["Legal Page<br/>[legal.html]"]
end

subgraph group_catalog["Prompt Catalog"]
  node_main_data["Category Data<br/>[main.json]"]
  node_gallery["Gallery Renderer<br/>[index.js]"]
  node_image_assets["Prompt Images"]
end

subgraph group_studio["Prompt Studio"]
  node_prompt_data["Prompt Data<br/>[Prompt.json]"]
  node_prompt_loader["Prompt Renderer<br/>[GeminiPrompt.js]"]
  node_copy["Copy Interaction<br/>[copyEmail.js]"]
end

subgraph group_shared["Shared Interactions"]
  node_theme["Theme Toggle<br/>[ThemeMode.js]"]
  node_browser_state[("Browser Storage")]
  node_mail_service["FormSubmit Service"]
end

node_visitor(("Visitor"))

node_visitor -->|"browses"| node_home
node_home -.->|"loads script"| node_gallery
node_gallery -->|"calls"| node_theme
node_gallery -->|"fetches"| node_main_data
node_gallery -->|"renders image paths"| node_image_assets
node_gallery -->|"navigates with selection"| node_studio_page
node_gallery -->|"stores selection and count"| node_browser_state
node_visitor -.->|"opens selection"| node_studio_page
node_studio_page -.->|"loads script"| node_prompt_loader
node_prompt_loader -->|"fetches"| node_prompt_data
node_prompt_loader -->|"enables copying"| node_copy
node_prompt_loader -->|"calls"| node_theme
node_prompt_loader -->|"reads and stores"| node_browser_state
node_copy -.->|"writes clipboard"| node_browser_state
node_visitor -.->|"toggles theme"| node_theme
node_visitor -->|"submits feedback"| node_mail_service
node_visitor -.->|"views legal information"| node_legal

click node_home "https://github.com/sudhanshupal123/promptstudio/blob/main/index.html"
click node_studio_page "https://github.com/sudhanshupal123/promptstudio/blob/main/gemini_prompt/PromptStudio.html"
click node_legal "https://github.com/sudhanshupal123/promptstudio/blob/main/legal.html"
click node_main_data "https://github.com/sudhanshupal123/promptstudio/blob/main/json/main.json"
click node_gallery "https://github.com/sudhanshupal123/promptstudio/blob/main/scripts/index.js"
click node_prompt_data "https://github.com/sudhanshupal123/promptstudio/blob/main/json/Prompt.json"
click node_prompt_loader "https://github.com/sudhanshupal123/promptstudio/blob/main/scripts/GeminiPrompt.js"
click node_copy "https://github.com/sudhanshupal123/promptstudio/blob/main/scripts/copyEmail.js"
click node_theme "https://github.com/sudhanshupal123/promptstudio/blob/main/scripts/ThemeMode.js"
click node_image_assets "https://github.com/sudhanshupal123/promptstudio/tree/main/gemini_img"

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_home,node_studio_page,node_legal toneBlue
class node_main_data,node_gallery,node_image_assets toneAmber
class node_prompt_data,node_prompt_loader,node_copy toneMint
class node_theme,node_browser_state,node_mail_service toneRose
class node_visitor toneIndigo
```

## Components

### Web Pages

- [Gallery Page](https://github.com/sudhanshupal123/promptstudio/blob/main/index.html): `index.html`
- [Studio Page](https://github.com/sudhanshupal123/promptstudio/blob/main/gemini_prompt/PromptStudio.html): `gemini_prompt/PromptStudio.html`
- [Legal Page](https://github.com/sudhanshupal123/promptstudio/blob/main/legal.html): `legal.html`

### Prompt Catalog

- [Category Data](https://github.com/sudhanshupal123/promptstudio/blob/main/json/main.json): `json/main.json`
- [Gallery Renderer](https://github.com/sudhanshupal123/promptstudio/blob/main/scripts/index.js): `scripts/index.js`
- [Prompt Images](https://github.com/sudhanshupal123/promptstudio/tree/main/gemini_img): `gemini_img`

### Prompt Studio

- [Prompt Data](https://github.com/sudhanshupal123/promptstudio/blob/main/json/Prompt.json): `json/Prompt.json`
- [Prompt Renderer](https://github.com/sudhanshupal123/promptstudio/blob/main/scripts/GeminiPrompt.js): `scripts/GeminiPrompt.js`
- [Copy Interaction](https://github.com/sudhanshupal123/promptstudio/blob/main/scripts/copyEmail.js): `scripts/copyEmail.js`

### Shared Interactions

- [Theme Toggle](https://github.com/sudhanshupal123/promptstudio/blob/main/scripts/ThemeMode.js): `scripts/ThemeMode.js`
- **Browser Storage**
- **FormSubmit Service**

### Other components

- **Visitor**

## Connections

- Visitor → Gallery Page: browses
- Gallery Page → Gallery Renderer: loads script
- Gallery Renderer → Theme Toggle: calls (evidence: `scripts/index.js`)
- Gallery Renderer → Category Data: fetches (evidence: `scripts/index.js`)
- Gallery Renderer → Prompt Images: renders image paths (evidence: `scripts/index.js`)
- Gallery Renderer → Studio Page: navigates with selection (evidence: `scripts/index.js`)
- Gallery Renderer → Browser Storage: stores selection and count (evidence: `scripts/index.js`)
- Visitor → Studio Page: opens selection
- Studio Page → Prompt Renderer: loads script
- Prompt Renderer → Prompt Data: fetches (evidence: `scripts/GeminiPrompt.js`)
- Prompt Renderer → Copy Interaction: enables copying (evidence: `scripts/GeminiPrompt.js`)
- Prompt Renderer → Theme Toggle: calls (evidence: `scripts/GeminiPrompt.js`)
- Prompt Renderer → Browser Storage: reads and stores (evidence: `scripts/GeminiPrompt.js`)
- Copy Interaction → Browser Storage: writes clipboard
- Visitor → Theme Toggle: toggles theme
- Visitor → FormSubmit Service: submits feedback
- Visitor → Legal Page: views legal information
