# pavitraseelam/iphone-sentiment-analysis architecture

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

- Interactive diagram: https://gitdiagram.com/pavitraseelam/iphone-sentiment-analysis
- Repository: https://github.com/pavitraseelam/iphone-sentiment-analysis

## Overview

This Flask application analyzes product reviews individually or from CSV, returning sentiment, confidence, and issue-specific suggestions for a browser dashboard. The main flow runs from browser input through Flask orchestration to sentiment and suggestion processing, then displays results and aggregate charts. The README is empty, so capabilities are based on the sampled source and file tree; template details and other unsampled implementation are not inferred.

Main entry points: [`app.py`](https://github.com/pavitraseelam/iphone-sentiment-analysis/blob/main/app.py) (Flask application), [`static/script.js`](https://github.com/pavitraseelam/iphone-sentiment-analysis/blob/main/static/script.js) (UI interactions), [`templates/index.html`](https://github.com/pavitraseelam/iphone-sentiment-analysis/blob/main/templates/index.html) (Review dashboard), [`sentiment_model.py`](https://github.com/pavitraseelam/iphone-sentiment-analysis/blob/main/sentiment_model.py) (Sentiment analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Browser interface"]
  node_browser["Review dashboard<br/>[index.html]"]
  node_ui["UI interactions<br/>[script.js]"]
end

subgraph group_api["Flask endpoints"]
  node_flask["Flask application<br/>[app.py]"]
end

subgraph group_analysis["Review analysis"]
  node_sentiment["Sentiment analysis<br/>[sentiment_model.py]"]
  node_suggestions["Issue suggestions"]
end

subgraph group_integrations["External libraries"]
  node_csv_reader["CSV parsing"]
  node_hf_model["Hugging Face model"]
  node_charts["Chart.js"]
end

node_user(("Reviewer"))
node_csv["CSV file"]

node_user -->|"uses"| node_browser
node_csv -->|"selects for upload"| node_ui
node_browser -->|"hosts interface"| node_ui
node_ui -->|"posts reviews"| node_flask
node_flask -->|"serves template"| node_browser
node_flask -->|"parses upload"| node_csv_reader
node_flask -->|"analyzes text"| node_sentiment
node_flask -->|"requests suggestion"| node_suggestions
node_sentiment -->|"predicts with"| node_hf_model
node_flask -->|"returns results"| node_ui
node_ui -.->|"renders charts"| node_charts

click node_browser "https://github.com/pavitraseelam/iphone-sentiment-analysis/blob/main/templates/index.html"
click node_ui "https://github.com/pavitraseelam/iphone-sentiment-analysis/blob/main/static/script.js"
click node_flask "https://github.com/pavitraseelam/iphone-sentiment-analysis/blob/main/app.py"
click node_sentiment "https://github.com/pavitraseelam/iphone-sentiment-analysis/blob/main/sentiment_model.py"
click node_suggestions "https://github.com/pavitraseelam/iphone-sentiment-analysis/blob/main/suggestion_engine.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_browser,node_ui,node_user toneBlue
class node_flask toneAmber
class node_sentiment,node_suggestions toneMint
class node_csv_reader,node_hf_model,node_charts toneRose
class node_csv toneIndigo
```

## Components

### Browser interface

- [Review dashboard](https://github.com/pavitraseelam/iphone-sentiment-analysis/blob/main/templates/index.html): `templates/index.html`
- [UI interactions](https://github.com/pavitraseelam/iphone-sentiment-analysis/blob/main/static/script.js): `static/script.js`

### Flask endpoints

- [Flask application](https://github.com/pavitraseelam/iphone-sentiment-analysis/blob/main/app.py): `app.py`

### Review analysis

- [Sentiment analysis](https://github.com/pavitraseelam/iphone-sentiment-analysis/blob/main/sentiment_model.py): `sentiment_model.py`
- [Issue suggestions](https://github.com/pavitraseelam/iphone-sentiment-analysis/blob/main/suggestion_engine.py): `suggestion_engine.py`

### External libraries

- **CSV parsing**
- **Hugging Face model**
- **Chart.js**

### Other components

- **Reviewer**
- **CSV file**

## Connections

- Reviewer → Review dashboard: uses
- CSV file → UI interactions: selects for upload
- Review dashboard → UI interactions: hosts interface
- UI interactions → Flask application: posts reviews
- Flask application → Review dashboard: serves template
- Flask application → CSV parsing: parses upload
- Flask application → Sentiment analysis: analyzes text
- Flask application → Issue suggestions: requests suggestion
- Sentiment analysis → Hugging Face model: predicts with
- Flask application → UI interactions: returns results
- UI interactions → Chart.js: renders charts
