# Style Atlas Prompt Builder — Flask Web App for Code-Drawn Claude Video Prompts

## PURPOSE
This project builds a small Flask web app that serves a searchable "style atlas" of code-drawn video styles and assembles a copy-ready Claude prompt. In the source video, the creator catalogued **86 styles** (glassmorphism, 16-bit pixel, chalkboard, cut paper diorama, flat vector science, and many more) and shipped each as a long prompt that embeds the *actual JavaScript source code* used to render the example. The app solves the copy-paste pain: a student picks a style, toggles a voiceover on/off, types a topic, and the server returns one prompt block ready to paste into Claude.

## WHY THIS MATTERS
The transcript's core insight is that Claude has no video generator — it draws **every frame in plain JavaScript**, and results stay consistent only because the prompt carries the working code as a base instead of a screenshot. A style catalog plus a deterministic prompt template is exactly the infrastructure that makes "much more consistent" output reproducible. The web app teaches prompt templating, structured catalogs, and server-side string assembly.

## HOW TO BUILD
Use Flask with a lightweight Jinja template. Store styles as dicts in a JSON/CSV loadable catalog. Assemble the prompt with an f-string that injects topic, the style name, an optional voiceover/SRT slot, and the embedded JS reference.

```python
@app.post("/build")
def build():
    data = request.get_json(force=True)
    style = load_catalog()[data["style_id"]]
    prompt = PROMPT_TEMPLATE.format(
        style=style["name"], code=style["reference_js"],
        topic=data["topic"], voiceover="ON" if data.get("voiceover") else "OFF")
    return jsonify(prompt=prompt, chars=len(prompt))
```

Add `GET /styles?q=` with substring/category filtering and a `POST /voiceover` route that accepts a pasted word-level SRT and re-timings the prompt.

## WHEN TO USE IN PRODUCTION
Use it as a self-hosted internal tool for a content team producing explainer videos, or as a public style-explorer page like the video's free database. Do **not** use it when you need real rendering: this app only builds prompts, not pixels. Skip it for one-off jobs where pasting directly into Claude is faster.

## HOW IT HELPS STUDENTS
Students learn Flask routing, JSON I/O, HTML templating, prompt engineering as data, and how to design a catalog-driven UI — all directly tied to a real creator workflow rather than a toy.

## STARTER CODE
See `starter/main.py` for a runnable Flask skeleton with a seeded catalog, prompt template, and TODO markers where the real JS payload and SRT parsing hook in.
