# sarthakray26/sentiment-tracker-fds architecture

> Architecture diagram of the GitHub repository sarthakray26/sentiment-tracker-fds, 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/sarthakray26/sentiment-tracker-fds
- Repository: https://github.com/sarthakray26/sentiment-tracker-fds

## Overview

Sentiment Tracker turns product queries or submitted reviews into sentiment, topic, and summary insights, presented through Gradio interfaces. The README documents dataset selection, bulk and single-review analysis, visual results, and Kaggle-backed product review search; the tree also shows scraping, persistent review storage, and a browser extension for extracting reviews. The sampled backend excerpts support the analysis components and database operations, but do not expose every importer, scraper, or UI call, so uncertain wiring is omitted.

Main entry points: [`customer-sentiment-summarizer/backend/main_simple.py`](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/backend/main_simple.py) (Analysis orchestrator), [`customer-sentiment-summarizer/frontend/app_product_search.py`](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/frontend/app_product_search.py) (Product search UI), [`customer-sentiment-summarizer/frontend/app.py`](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/frontend/app.py) (Review chatbot UI), [`customer-sentiment-summarizer/frontend/app_simple.py`](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/frontend/app_simple.py) (Single and bulk UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Review collection"]
  node_extension_content["Page extractor<br/>[content.js]"]
  node_dataset_match["Dataset selection"]
  node_kaggle_import["Dataset import<br/>[kaggle_importer.py]"]
  node_scraper["Review scraping<br/>[scraper.py]"]
end

subgraph group_analysis["Analysis engine"]
  node_orchestrator["Analysis orchestrator<br/>[main_simple.py]"]
  node_sentiment["Sentiment classification<br/>[sentiment.py]"]
  node_multilingual["Multilingual sentiment"]
  node_topics["Topic extraction<br/>[topics.py]"]
  node_summary["Text summarization<br/>[summarizer.py]"]
end

subgraph group_persistence["Review storage"]
  node_database_api["Review database<br/>[database.py]"]
  node_review_store[("Review records<br/>[database.py]")]
end

subgraph group_interfaces["User interfaces"]
  node_product_ui["Product search UI"]
  node_simple_ui["Single and bulk UI<br/>[app_simple.py]"]
  node_chat_ui["Review chatbot UI<br/>[app.py]"]
  node_spaces_entry["Spaces entry<br/>[app.py]"]
  node_extension_popup["Extension popup<br/>[popup.js]"]
  node_results["Charts and insights"]
end

node_user(("Product analyst"))
node_web(("Review website"))
node_kaggle(("Kaggle datasets"))

node_user -->|"searches"| node_product_ui
node_user -->|"submits reviews"| node_simple_ui
node_user -->|"submits reviews"| node_chat_ui
node_product_ui -->|"matches query"| node_dataset_match
node_dataset_match -->|"selects dataset"| node_kaggle_import
node_kaggle -.->|"provides datasets"| node_kaggle_import
node_extension_popup -->|"requests extraction"| node_extension_content
node_web -->|"provides page"| node_extension_content
node_extension_content -->|"returns reviews"| node_extension_popup
node_extension_popup -->|"copies reviews"| node_user
node_user -->|"requests collection"| node_scraper
node_scraper -->|"collects reviews"| node_web
node_product_ui -->|"requests analysis"| node_orchestrator
node_simple_ui -->|"requests analysis"| node_orchestrator
node_chat_ui -->|"requests analysis"| node_orchestrator
node_orchestrator -->|"classifies reviews"| node_sentiment
node_orchestrator -->|"extracts topics"| node_topics
node_orchestrator -->|"summarizes reviews"| node_summary
node_orchestrator -->|"stores and retrieves"| node_database_api
node_database_api -->|"reads and writes"| node_review_store
node_product_ui -->|"formats analysis"| node_results
node_simple_ui -->|"formats analysis"| node_results
node_chat_ui -->|"formats analysis"| node_results
node_results -->|"shows insights"| node_user
node_spaces_entry -->|"launches interface"| node_chat_ui

click node_product_ui "https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/frontend/app_product_search.py"
click node_simple_ui "https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/frontend/app_simple.py"
click node_chat_ui "https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/frontend/app.py"
click node_spaces_entry "https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/app.py"
click node_extension_popup "https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/browser_extension/popup.js"
click node_extension_content "https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/browser_extension/content.js"
click node_dataset_match "https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/frontend/app_product_search.py"
click node_kaggle_import "https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/backend/kaggle_importer.py"
click node_scraper "https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/backend/scraper.py"
click node_orchestrator "https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/backend/main_simple.py"
click node_sentiment "https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/backend/sentiment.py"
click node_multilingual "https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/backend/multilingual_sentiment.py"
click node_topics "https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/backend/topics.py"
click node_summary "https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/backend/summarizer.py"
click node_database_api "https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/backend/database.py"
click node_review_store "https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/backend/database.py"
click node_results "https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/frontend/app_product_search.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_extension_content,node_dataset_match,node_kaggle_import,node_scraper,node_web toneBlue
class node_orchestrator,node_sentiment,node_multilingual,node_topics,node_summary toneAmber
class node_database_api,node_review_store toneMint
class node_product_ui,node_simple_ui,node_chat_ui,node_spaces_entry,node_extension_popup,node_results toneRose
class node_user,node_kaggle toneIndigo
```

## Components

### Review collection

- [Page extractor](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/browser_extension/content.js): `customer-sentiment-summarizer/browser_extension/content.js`
- [Dataset selection](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/frontend/app_product_search.py): `customer-sentiment-summarizer/frontend/app_product_search.py`
- [Dataset import](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/backend/kaggle_importer.py): `customer-sentiment-summarizer/backend/kaggle_importer.py`
- [Review scraping](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/backend/scraper.py): `customer-sentiment-summarizer/backend/scraper.py`

### Analysis engine

- [Analysis orchestrator](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/backend/main_simple.py): `customer-sentiment-summarizer/backend/main_simple.py`
- [Sentiment classification](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/backend/sentiment.py): `customer-sentiment-summarizer/backend/sentiment.py`
- [Multilingual sentiment](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/backend/multilingual_sentiment.py): `customer-sentiment-summarizer/backend/multilingual_sentiment.py`
- [Topic extraction](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/backend/topics.py): `customer-sentiment-summarizer/backend/topics.py`
- [Text summarization](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/backend/summarizer.py): `customer-sentiment-summarizer/backend/summarizer.py`

### Review storage

- [Review database](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/backend/database.py): `customer-sentiment-summarizer/backend/database.py`
- [Review records](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/backend/database.py): `customer-sentiment-summarizer/backend/database.py`

### User interfaces

- [Product search UI](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/frontend/app_product_search.py): `customer-sentiment-summarizer/frontend/app_product_search.py`
- [Single and bulk UI](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/frontend/app_simple.py): `customer-sentiment-summarizer/frontend/app_simple.py`
- [Review chatbot UI](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/frontend/app.py): `customer-sentiment-summarizer/frontend/app.py`
- [Spaces entry](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/app.py): `customer-sentiment-summarizer/app.py`
- [Extension popup](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/browser_extension/popup.js): `customer-sentiment-summarizer/browser_extension/popup.js`
- [Charts and insights](https://github.com/sarthakray26/sentiment-tracker-fds/blob/main/customer-sentiment-summarizer/frontend/app_product_search.py): `customer-sentiment-summarizer/frontend/app_product_search.py`

### Other components

- **Product analyst**
- **Review website**
- **Kaggle datasets**

## Connections

- Product analyst → Product search UI: searches
- Product analyst → Single and bulk UI: submits reviews
- Product analyst → Review chatbot UI: submits reviews
- Product search UI → Dataset selection: matches query
- Dataset selection → Dataset import: selects dataset
- Kaggle datasets → Dataset import: provides datasets
- Extension popup → Page extractor: requests extraction
- Review website → Page extractor: provides page
- Page extractor → Extension popup: returns reviews
- Extension popup → Product analyst: copies reviews
- Product analyst → Review scraping: requests collection
- Review scraping → Review website: collects reviews
- Product search UI → Analysis orchestrator: requests analysis
- Single and bulk UI → Analysis orchestrator: requests analysis
- Review chatbot UI → Analysis orchestrator: requests analysis
- Analysis orchestrator → Sentiment classification: classifies reviews
- Analysis orchestrator → Topic extraction: extracts topics
- Analysis orchestrator → Text summarization: summarizes reviews
- Analysis orchestrator → Review database: stores and retrieves
- Review database → Review records: reads and writes
- Product search UI → Charts and insights: formats analysis
- Single and bulk UI → Charts and insights: formats analysis
- Review chatbot UI → Charts and insights: formats analysis
- Charts and insights → Product analyst: shows insights
- Spaces entry → Review chatbot UI: launches interface
