# shaiknawazshareef/promptstudio-ai-prompt-engineering architecture

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

- Interactive diagram: https://gitdiagram.com/shaiknawazshareef/promptstudio-ai-prompt-engineering
- Repository: https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering

## Overview

PromptStudio-AI is a prompt-engineering platform with a FastAPI dashboard and terminal demonstrations. Users submit prompts or select demonstrations; the web controller routes requests to analysis, optimization, comparison, template, and injection-guardrail capabilities, then returns results for display. The CLI invokes the same engines for terminal output. Self-consistency is part of the reasoning engine, not a separate sampled module. The README documents the optimizer and dashboard capabilities; unsampled template and frontend details are represented only where the shown source supports them.

Main entry points: [`Prompt_Studio_Live_Project/app.py`](https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/app.py) (Web Controller), [`Prompt_Studio_Live_Project/demo_cli.py`](https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/demo_cli.py) (Demo CLI), [`Prompt_Studio_Live_Project/templates/index.html`](https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/templates/index.html) (Web Dashboard), [`Prompt_Studio_Live_Project/static/js/main.js`](https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/static/js/main.js) (Dashboard Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_dashboard["Web Dashboard<br/>[index.html]"]
  node_web_client["Dashboard Client<br/>[main.js]"]
  node_cli["Demo CLI<br/>[demo_cli.py]"]
end

subgraph group_service["Application Service"]
  node_web_controller["Web Controller<br/>[app.py]"]
end

subgraph group_engineering["Prompt Engineering"]
  node_analyzer["Anatomy Linter<br/>[anatomy_linter.py]"]
  node_templates["Template Library"]
  node_guardrails["Injection Guardrails<br/>[guardrails.py]"]
end

subgraph group_reasoning["Reasoning Demonstrations"]
  node_few_shot["Few-Shot Comparisons<br/>[few_shot.py]"]
  node_cot["CoT and Self-Consistency<br/>[cot_reasoning.py]"]
end

node_web_user(("Web User"))
node_terminal_user(("Terminal User"))

node_web_user -->|"uses"| node_dashboard
node_dashboard -->|"served by"| node_web_controller
node_web_user -.->|"interacts"| node_web_client
node_web_client -->|"requests API"| node_web_controller
node_web_controller -->|"analyzes and optimizes"| node_analyzer
node_web_controller -->|"compares examples"| node_few_shot
node_web_controller -->|"runs reasoning"| node_cot
node_web_controller -->|"lists and renders"| node_templates
node_web_controller -->|"scans and sandboxes"| node_guardrails
node_terminal_user -->|"runs demos"| node_cli
node_cli -->|"analyzes and optimizes"| node_analyzer
node_cli -->|"compares examples"| node_few_shot
node_cli -->|"runs reasoning"| node_cot
node_cli -->|"scans input"| node_guardrails

click node_dashboard "https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/templates/index.html"
click node_web_controller "https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/app.py"
click node_web_client "https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/static/js/main.js"
click node_cli "https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/demo_cli.py"
click node_analyzer "https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/prompt_engine/anatomy_linter.py"
click node_few_shot "https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/prompt_engine/few_shot.py"
click node_cot "https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/prompt_engine/cot_reasoning.py"
click node_templates "https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/prompt_engine/template_library.py"
click node_guardrails "https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/prompt_engine/guardrails.py"

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_web_client,node_cli,node_web_user,node_terminal_user toneBlue
class node_web_controller toneAmber
class node_analyzer,node_templates,node_guardrails toneMint
class node_few_shot,node_cot toneRose
```

## Components

### User Interfaces

- [Web Dashboard](https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/templates/index.html): `Prompt_Studio_Live_Project/templates/index.html`
- [Dashboard Client](https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/static/js/main.js): `Prompt_Studio_Live_Project/static/js/main.js`
- [Demo CLI](https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/demo_cli.py): `Prompt_Studio_Live_Project/demo_cli.py`

### Application Service

- [Web Controller](https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/app.py): `Prompt_Studio_Live_Project/app.py`

### Prompt Engineering

- [Anatomy Linter](https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/prompt_engine/anatomy_linter.py): `Prompt_Studio_Live_Project/prompt_engine/anatomy_linter.py`
- [Template Library](https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/prompt_engine/template_library.py): `Prompt_Studio_Live_Project/prompt_engine/template_library.py`
- [Injection Guardrails](https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/prompt_engine/guardrails.py): `Prompt_Studio_Live_Project/prompt_engine/guardrails.py`

### Reasoning Demonstrations

- [Few-Shot Comparisons](https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/prompt_engine/few_shot.py): `Prompt_Studio_Live_Project/prompt_engine/few_shot.py`
- [CoT and Self-Consistency](https://github.com/shaiknawazshareef/promptstudio-ai-prompt-engineering/blob/main/Prompt_Studio_Live_Project/prompt_engine/cot_reasoning.py): `Prompt_Studio_Live_Project/prompt_engine/cot_reasoning.py`

### Other components

- **Web User**
- **Terminal User**

## Connections

- Web User → Web Dashboard: uses (evidence: `README.md`)
- Web Dashboard → Web Controller: served by (evidence: `Prompt_Studio_Live_Project/app.py`)
- Web User → Dashboard Client: interacts
- Dashboard Client → Web Controller: requests API (evidence: `Prompt_Studio_Live_Project/static/js/main.js`)
- Web Controller → Anatomy Linter: analyzes and optimizes (evidence: `Prompt_Studio_Live_Project/app.py`)
- Web Controller → Few-Shot Comparisons: compares examples (evidence: `Prompt_Studio_Live_Project/app.py`)
- Web Controller → CoT and Self-Consistency: runs reasoning (evidence: `Prompt_Studio_Live_Project/app.py`)
- Web Controller → Template Library: lists and renders (evidence: `Prompt_Studio_Live_Project/app.py`)
- Web Controller → Injection Guardrails: scans and sandboxes (evidence: `Prompt_Studio_Live_Project/app.py`)
- Terminal User → Demo CLI: runs demos (evidence: `README.md`)
- Demo CLI → Anatomy Linter: analyzes and optimizes (evidence: `Prompt_Studio_Live_Project/demo_cli.py`)
- Demo CLI → Few-Shot Comparisons: compares examples (evidence: `Prompt_Studio_Live_Project/demo_cli.py`)
- Demo CLI → CoT and Self-Consistency: runs reasoning (evidence: `Prompt_Studio_Live_Project/demo_cli.py`)
- Demo CLI → Injection Guardrails: scans input (evidence: `Prompt_Studio_Live_Project/demo_cli.py`)
