# anriudh/sports-sentiment-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/anriudh/sports-sentiment-tracker
- Repository: https://github.com/anriudh/sports-sentiment-tracker

## Overview

Sports Sentiment Tracker is a small football-news pipeline with a Streamlit dashboard. Users view sentiment summaries and filtered articles; refreshing fetches recent NewsAPI articles, analyzes headline and description text with VADER, writes scored data, and reloads it for display. A separate charting script also reads the scored CSV and saves static plots. The README documents distribution, trend, histogram, article-table, and refresh capabilities. The graph follows the supplied source; the NewsAPI integration is explicit, while no additional runtime services are evident.

Main entry points: [`app.py`](https://github.com/anriudh/sports-sentiment-tracker/blob/main/app.py) (Streamlit dashboard), [`src/sentiment.py`](https://github.com/anriudh/sports-sentiment-tracker/blob/main/src/sentiment.py) (VADER analysis), [`src/scraper.py`](https://github.com/anriudh/sports-sentiment-tracker/blob/main/src/scraper.py) (Article fetcher), [`data/csv/articles_with_sentiment.csv`](https://github.com/anriudh/sports-sentiment-tracker/blob/main/data/csv/articles_with_sentiment.csv) (Scored articles CSV)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_app["Streamlit dashboard<br/>[app.py]"]
end

subgraph group_pipeline["News Pipeline"]
  node_scraper["Article fetcher<br/>[scraper.py]"]
  node_sentiment["VADER analysis<br/>[sentiment.py]"]
end

subgraph group_data["Stored Data"]
  node_raw[("Raw articles CSV<br/>[raw_articles.csv]")]
  node_scored[("Scored articles CSV")]
end

subgraph group_charts["Static Charts"]
  node_visualizer["Static chart generator<br/>[visualizer.py]"]
  node_plots["Generated plots"]
end

node_user(("Dashboard user"))
node_newsapi["NewsAPI"]
node_vader["VADER library"]

node_user -->|"views and refreshes"| node_app
node_app -->|"displays dashboard"| node_user
node_app -->|"refresh calls"| node_scraper
node_scraper -->|"requests articles"| node_newsapi
node_scraper -->|"writes articles"| node_raw
node_app -->|"analyzes fetched data"| node_sentiment
node_sentiment -->|"scores text"| node_vader
node_sentiment -->|"reads standalone input"| node_raw
node_sentiment -->|"writes scores"| node_scored
node_app -->|"loads dashboard data"| node_scored
node_visualizer -->|"reads scored data"| node_scored
node_visualizer -->|"saves charts"| node_plots

click node_app "https://github.com/anriudh/sports-sentiment-tracker/blob/main/app.py"
click node_scraper "https://github.com/anriudh/sports-sentiment-tracker/blob/main/src/scraper.py"
click node_sentiment "https://github.com/anriudh/sports-sentiment-tracker/blob/main/src/sentiment.py"
click node_raw "https://github.com/anriudh/sports-sentiment-tracker/blob/main/data/csv/raw_articles.csv"
click node_scored "https://github.com/anriudh/sports-sentiment-tracker/blob/main/data/csv/articles_with_sentiment.csv"
click node_visualizer "https://github.com/anriudh/sports-sentiment-tracker/blob/main/src/visualizer.py"
click node_plots "https://github.com/anriudh/sports-sentiment-tracker/tree/main/data/plots"

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_app,node_user toneBlue
class node_scraper,node_sentiment toneAmber
class node_raw,node_scored,node_newsapi toneMint
class node_visualizer,node_plots toneRose
class node_vader toneIndigo
```

## Components

### Dashboard

- [Streamlit dashboard](https://github.com/anriudh/sports-sentiment-tracker/blob/main/app.py): `app.py`

### News Pipeline

- [Article fetcher](https://github.com/anriudh/sports-sentiment-tracker/blob/main/src/scraper.py): `src/scraper.py`
- [VADER analysis](https://github.com/anriudh/sports-sentiment-tracker/blob/main/src/sentiment.py): `src/sentiment.py`

### Stored Data

- [Raw articles CSV](https://github.com/anriudh/sports-sentiment-tracker/blob/main/data/csv/raw_articles.csv): `data/csv/raw_articles.csv`
- [Scored articles CSV](https://github.com/anriudh/sports-sentiment-tracker/blob/main/data/csv/articles_with_sentiment.csv): `data/csv/articles_with_sentiment.csv`

### Static Charts

- [Static chart generator](https://github.com/anriudh/sports-sentiment-tracker/blob/main/src/visualizer.py): `src/visualizer.py`
- [Generated plots](https://github.com/anriudh/sports-sentiment-tracker/tree/main/data/plots): `data/plots`

### Other components

- **Dashboard user**
- **NewsAPI**
- **VADER library**

## Connections

- Dashboard user → Streamlit dashboard: views and refreshes
- Streamlit dashboard → Dashboard user: displays dashboard
- Streamlit dashboard → Article fetcher: refresh calls
- Article fetcher → NewsAPI: requests articles
- Article fetcher → Raw articles CSV: writes articles
- Streamlit dashboard → VADER analysis: analyzes fetched data
- VADER analysis → VADER library: scores text
- VADER analysis → Raw articles CSV: reads standalone input
- VADER analysis → Scored articles CSV: writes scores
- Streamlit dashboard → Scored articles CSV: loads dashboard data
- Static chart generator → Scored articles CSV: reads scored data
- Static chart generator → Generated plots: saves charts
