# Cooked or Undercooked: Community Builds Dashboard

## PURPOSE
Near the end of the episode the hosts run a community segment: "we've been watching all the builds that you guys had on Twitter, LinkedIn, and Instagram. So today we're going to bring a few of these community builds and see what you think about it. Is it cooked or is it undercooked?" They score each build with printed cards — "It's cooked just right", "Double cooked", "Cooked" — and pick a winner in the **catch of the day** ("Napoleon wins … again"). This project is a Streamlit + Plotly dashboard that turns that ritual into a working review system: ingested build submissions, per-judge verdicts, view counts, and a computed leaderboard.

## WHY THIS MATTERS
The builds the panel actually discusses are the dataset: a retro space shooter built with a GPT model, Carter Church's decode of an **unsolved Napoleon-era letter using Astra** ("Almost 5 million views"), and an RL-driven horse-racing game where "depending on how you draw it" the horse runs faster or slower — plus the hosts' own 8-bit Mod Retro ramen game. A dashboard makes the difference between a fun segment and a repeatable evaluation process.

## HOW TO BUILD
1. `pip install -r requirements.txt` (Streamlit, Plotly, Pandas).
2. Define a submissions table: `build`, `author`, `source` (Twitter/LinkedIn/Instagram), `tool`, `views`, `judge`, `verdict`.
3. Map verdicts to a numeric scale: `undercooked=0`, `cooked=1`, `cooked just right=1.5`, `double cooked=2`.
4. `st.sidebar` filters by source and tool; a verdict button lets a student play judge.
5. Render (a) a Plotly horizontal bar of votes by build and (b) a scatter of views vs. average verdict.
6. Compute a leaderboard with Pandas `groupby`, then a "catch of the day" `idxmax`.

Key snippet — the scoring model:

```python
VERDICT_SCORE = {"undercooked": 0.0, "cooked": 1.0,
                 "cooked just right": 1.5, "double cooked": 2.0}

def leaderboard(df: pd.DataFrame, min_votes: int = 1) -> pd.DataFrame:
    df = df.assign(score=df["verdict"].map(VERDICT_SCORE))
    out = (df.groupby(["build", "author", "tool", "views"], as_index=False)
             .agg(votes=("score", "size"), avg=("score", "mean")))
    out = out[out["votes"] >= min_votes]
    return out.sort_values(["avg", "votes"], ascending=False)
```

## WHEN TO USE IN PRODUCTION
Use it as an internal review cockpit for submissions, model evals, hackathon entries, or design critique — anywhere qualitative verdicts and quantitative signals (views, cost, latency) must be read together. It is the natural human-facing layer over the CLI auditor in this set. **Do not** use Streamlit for a public, high-traffic, authenticated app; it reruns the whole script on interaction and is not a request/response web framework. Do not store the verdicts only in the script — write them to a database.

## HOW IT HELPS STUDENTS
Students practise Pandas aggregation, Plotly chart construction, Streamlit state and layout, and qualitative-to-quantitative scoring. It also teaches honest judging: separate the artifact from its popularity, then say why.

## STARTER CODE
See `starter/main.py`: sample submission rows mirroring the episode's builds, sidebar filters, Plotly bar and scatter, and the computed catch of the day.
