# Fan 360 Profile Quality Dashboard (Streamlit + Plotly)

## PURPOSE
A Streamlit dashboard that visualizes the Fan 360 identity-resolution program from the
demo: unified-profile totals per project (the walkthrough shows 4.2 million after
integrating sources), match-rule performance for the recommended exact-address +
fuzzy-name rule, a preview of raw vs normalized records, and the borderline review queue
routed to an agent, a human, or both.

## WHY THIS MATTERS
Once profile agents run at scale, humans cannot read log files to answer "did the new
reseller source improve our fan 360?". The demo's real value is the loop of
propose -> preview -> approve -> run, and every step of it needs a surface a data steward
can inspect. This dashboard is that surface and turns identity-resolution results into
something auditable.

## HOW TO BUILD
1. `pip install streamlit plotly pandas`
2. Build a synthetic dataset in Pandas: per-project profile counts across days, rule
   match/ borderline/ no-match counts, and raw-vs-normalized phone samples.
3. Add `st.sidebar` filters for project and date range.
4. Render a Plotly line chart for unified profiles over time.
5. Render a Plotly bar chart of match verdicts per rule.
6. Show a `st.dataframe` of raw vs normalized rows and a review-queue table with accept
   / reject widgets.

Key snippet:
```python
import plotly.express as px

fig = px.line(profiles_df, x="date", y="unified_profiles", color="project",
              title="Unified profiles over time")
st.plotly_chart(fig, use_container_width=True)
```

## WHEN TO USE IN PRODUCTION
Use it for data-steward consoles, weekly identity-quality reviews, and post-run
validation after onboarding a new source. Ideal when non-engineers own matching-rule
approval. Do **not** use it for real-time alerting (use a metrics stack) or as the
execution engine for matching runs.

## HOW IT HELPS STUDENTS
Students learn Streamlit layout and state, Plotly chart construction, and turning
pipeline outputs into decision-ready visuals. They practice the analyst-facing half of
data engineering: making quality, coverage and review load legible to stakeholders.

## STARTER CODE
`starter/main.py` generates the synthetic metrics frames and lays out the sidebar
filters, the unified-profile trend chart, the rule-performance bar chart and the
review-queue table with `# TODO` markers for connecting a real database.
