# aad1tshah1/strudel-ai architecture

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

- Interactive diagram: https://gitdiagram.com/aad1tshah1/strudel-ai
- Repository: https://github.com/aad1tshah1/strudel-ai
- Video tour (about a minute): https://gitdiagram.com/aad1tshah1/strudel-ai/video

## Overview

Strudel AI is a command-line music-code generator: a user describes music, the app classifies its genre, generates and reviews Strudel code, optionally regenerates with review feedback, then opens it in Strudel. The sampled source shows these stages and their direct calls. Genre profiles and prompt files are documented by their read paths; the README was empty, so no additional product capabilities could be confirmed.

Main entry points: [`backend/main.py`](https://github.com/aad1tshah1/strudel-ai/blob/main/backend/main.py) (CLI workflow), [`backend/services/generator.py`](https://github.com/aad1tshah1/strudel-ai/blob/main/backend/services/generator.py) (Code generator), [`backend/services/reviewer.py`](https://github.com/aad1tshah1/strudel-ai/blob/main/backend/services/reviewer.py) (Code reviewer), [`backend/services/llm.py`](https://github.com/aad1tshah1/strudel-ai/blob/main/backend/services/llm.py) (LLM client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["CLI interaction"]
  node_cli["CLI workflow<br/>[main.py]"]
end

subgraph group_music_workflow["Music generation workflow"]
  node_classifier["Genre classifier<br/>[classifier.py]"]
  node_generator["Code generator<br/>[generator.py]"]
  node_reviewer["Code reviewer<br/>[reviewer.py]"]
end

subgraph group_model_support["Model and genre support"]
  node_genre_profiles["Genre profiles"]
  node_classifier_prompt["Classifier prompt<br/>[classifier.txt]"]
  node_generator_prompt["Generator prompt<br/>[generator.txt]"]
  node_reviewer_prompt["Reviewer prompt<br/>[reviewer.txt]"]
  node_llm_client["LLM client<br/>[llm.py]"]
end

subgraph group_output["Strudel output"]
  node_url_encoder["Strudel URL encoder<br/>[strudel_url.py]"]
end

node_user(("Music requester"))
node_anthropic{{"Anthropic API"}}
node_browser{{"Web browser"}}
node_strudel{{"Strudel editor"}}

node_user -->|"enters prompt"| node_cli
node_cli -->|"classifies request"| node_classifier
node_classifier -->|"reads prompt"| node_classifier_prompt
node_classifier -->|"requests classification"| node_llm_client
node_llm_client -->|"sends model request"| node_anthropic
node_cli -->|"requests code"| node_generator
node_generator -->|"reads prompt"| node_generator_prompt
node_generator -->|"loads profile"| node_genre_profiles
node_generator -->|"requests generation"| node_llm_client
node_cli -->|"requests review"| node_reviewer
node_reviewer -->|"reads prompt"| node_reviewer_prompt
node_reviewer -->|"loads genre profile"| node_generator
node_reviewer -->|"requests review"| node_llm_client
node_reviewer -->|"returns review"| node_cli
node_cli -.->|"regenerates with fixes"| node_generator
node_cli -->|"encodes generated code"| node_url_encoder
node_url_encoder -->|"returns encoded URL"| node_browser
node_cli -->|"opens URL"| node_browser
node_browser -->|"loads editor"| node_strudel

click node_cli "https://github.com/aad1tshah1/strudel-ai/blob/main/backend/main.py"
click node_classifier "https://github.com/aad1tshah1/strudel-ai/blob/main/backend/services/classifier.py"
click node_generator "https://github.com/aad1tshah1/strudel-ai/blob/main/backend/services/generator.py"
click node_reviewer "https://github.com/aad1tshah1/strudel-ai/blob/main/backend/services/reviewer.py"
click node_genre_profiles "https://github.com/aad1tshah1/strudel-ai/tree/main/backend/genres"
click node_classifier_prompt "https://github.com/aad1tshah1/strudel-ai/blob/main/backend/prompts/classifier.txt"
click node_generator_prompt "https://github.com/aad1tshah1/strudel-ai/blob/main/backend/prompts/generator.txt"
click node_reviewer_prompt "https://github.com/aad1tshah1/strudel-ai/blob/main/backend/prompts/reviewer.txt"
click node_llm_client "https://github.com/aad1tshah1/strudel-ai/blob/main/backend/services/llm.py"
click node_url_encoder "https://github.com/aad1tshah1/strudel-ai/blob/main/backend/services/strudel_url.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_cli,node_browser toneBlue
class node_classifier,node_generator,node_reviewer toneAmber
class node_genre_profiles,node_classifier_prompt,node_generator_prompt,node_reviewer_prompt,node_llm_client,node_user,node_anthropic toneMint
class node_url_encoder toneRose
class node_strudel toneIndigo
```

## Components

### CLI interaction

- [CLI workflow](https://github.com/aad1tshah1/strudel-ai/blob/main/backend/main.py): `backend/main.py`

### Music generation workflow

- [Genre classifier](https://github.com/aad1tshah1/strudel-ai/blob/main/backend/services/classifier.py): `backend/services/classifier.py`
- [Code generator](https://github.com/aad1tshah1/strudel-ai/blob/main/backend/services/generator.py): `backend/services/generator.py`
- [Code reviewer](https://github.com/aad1tshah1/strudel-ai/blob/main/backend/services/reviewer.py): `backend/services/reviewer.py`

### Model and genre support

- [Genre profiles](https://github.com/aad1tshah1/strudel-ai/tree/main/backend/genres): `backend/genres`
- [Classifier prompt](https://github.com/aad1tshah1/strudel-ai/blob/main/backend/prompts/classifier.txt): `backend/prompts/classifier.txt`
- [Generator prompt](https://github.com/aad1tshah1/strudel-ai/blob/main/backend/prompts/generator.txt): `backend/prompts/generator.txt`
- [Reviewer prompt](https://github.com/aad1tshah1/strudel-ai/blob/main/backend/prompts/reviewer.txt): `backend/prompts/reviewer.txt`
- [LLM client](https://github.com/aad1tshah1/strudel-ai/blob/main/backend/services/llm.py): `backend/services/llm.py`

### Strudel output

- [Strudel URL encoder](https://github.com/aad1tshah1/strudel-ai/blob/main/backend/services/strudel_url.py): `backend/services/strudel_url.py`

### Other components

- **Music requester**
- **Anthropic API**
- **Web browser**
- **Strudel editor**

## Connections

- Music requester → CLI workflow: enters prompt
- CLI workflow → Genre classifier: classifies request
- Genre classifier → Classifier prompt: reads prompt
- Genre classifier → LLM client: requests classification
- LLM client → Anthropic API: sends model request
- CLI workflow → Code generator: requests code
- Code generator → Generator prompt: reads prompt
- Code generator → Genre profiles: loads profile
- Code generator → LLM client: requests generation
- CLI workflow → Code reviewer: requests review
- Code reviewer → Reviewer prompt: reads prompt
- Code reviewer → Code generator: loads genre profile
- Code reviewer → LLM client: requests review
- Code reviewer → CLI workflow: returns review
- CLI workflow → Code generator: regenerates with fixes
- CLI workflow → Strudel URL encoder: encodes generated code
- Strudel URL encoder → Web browser: returns encoded URL
- CLI workflow → Web browser: opens URL
- Web browser → Strudel editor: loads editor
