# suren2787/app-sentiment architecture

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

- Interactive diagram: https://gitdiagram.com/suren2787/app-sentiment
- Repository: https://github.com/suren2787/app-sentiment

## Overview

#### Purpose and execution model
Sentimeter is a Python batch pipeline that collects mobile-app reviews, normalizes them, derives sentiment/category insights, and emits report artifacts. It is run manually in three stages from the README:
1. `sentimeter/datacollection/generate-data.py`
2. `sentimeter/insights/senti.py`
3. `sentimeter/insights/report.py`

There is no indicated server or web-app runtime; filesystem JSON/CSV/HTML artifacts are the integration contract between stages.

#### Review acquisition
The collection stage orchestrates separate App Store and Google Play Store sources:
- `sentimeter/datacollection/generate-data.py`
- `modules/appstore/asreviews.py`
- `modules/playstore/psreviews.py`

Source adapters are isolated under `modules/`, allowing store-specific retrieval behavior to remain outside the pipeline orchestration. Collection configuration is expected from `sentimeter/datacollection/config_Template.py`.

#### Normalization and persisted collection boundary
Collected reviews are prepared into a shared normalized representation through store-specific preparation scripts:
- `sentimeter/datacollection/prepareappstorereviews.py`
- `sentimeter/datacollection/prepareplaystorereviews.py`
- `sentimeter/datacollection/results/reviews-normalized.json`

`reviews-normalized.json` is the primary handoff from data collection to insight processing. File handling utilities are centralized in `modules/utility/fileops.py`.

#### Language processing
The pipeline includes language detection and translation modules before or during analysis:
- `modules/translate/langdetect.py`
- `modules/translate/langtranslate.py`
- `sentimeter/insights/getdataforinsights.py`

These create a boundary between raw multilingual review text and analysis-ready review content. Translation is an external-service-sensitive concern, though the specific provider is not identified in the repository tree.

#### Insight derivation
The main analysis entry point is `sentimeter/insights/senti.py`, which coordinates sentiment processing and likely filtering/category assignment:
- `sentimeter/insights/senti.py`
- `sentimeter/insights/category.py`
- `sentimeter/insights/getdataforinsights.py`

Intermediate and final machine-readable outputs include filtered reviews, sentiment-enriched reviews, category-enriched reviews, and summaries:
- `sentimeter/insights/results/reviews-filtered.json`
- `sentimeter/insights/results/reviews-sentiments.json`
- `sentimeter/insights/results/reviews-category.json`

#### Summarization and reporting
Insight results are condensed and rendered by the reporting stage:
- `sentimeter/insights/summarization.py`
- `sentimeter/insights/report.py`
- `sentimeter/insights/display.py`

The reporting boundary produces both structured and presentation artifacts:
- `sentimeter/insights/results/summary.json`
- `sentimeter/insights/results/summary.csv`
- `sentimeter/insights/results/summary.html`
- `sentimeter/insights/results/diagrams`

#### Primary control flow
Control is sequential and file-backed: store adapters → preparation/normalization → normalized JSON → language/insight processing → filtered/sentiment/category JSON → summarization → CSV/JSON/HTML/diagram reports. The key operational risk is that each command depends on artifacts from prior stages; reruns should preserve schema compatibility at `reviews-normalized.json` and the `sentimeter/insights/results/` outputs.

Main entry points: [`sentimeter/insights/senti.py`](https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/senti.py) (Sentiment pipeline), [`sentimeter/datacollection/results/reviews-normalized.json`](https://github.com/suren2787/app-sentiment/blob/master/sentimeter/datacollection/results/reviews-normalized.json) (Normalized reviews), [`sentimeter/insights/summarization.py`](https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/summarization.py) (Summarization), [`sentimeter/datacollection/generate-data.py`](https://github.com/suren2787/app-sentiment/blob/master/sentimeter/datacollection/generate-data.py) (Generate data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Data collection"]
  node_collection_config["Collection config<br/>Python config<br/>[config_Template.py]"]
  node_generate_data["Generate data<br/>Python entry point<br/>[generate-data.py]"]
  node_appstore_adapter["App Store reviews<br/>Source adapter<br/>[asreviews.py]"]
  node_playstore_adapter["Google Play reviews<br/>Source adapter<br/>[psreviews.py]"]
  node_prepare_appstore["Prepare App Store reviews<br/>Normalizer"]
  node_prepare_playstore["Prepare Play reviews<br/>Normalizer"]
  node_fileops["File operations<br/>Shared utility<br/>[fileops.py]"]
  node_normalized_reviews["Normalized reviews<br/>JSON artifact"]
end

subgraph group_processing["Insight processing"]
  node_senti["Sentiment pipeline<br/>Python entry point<br/>[senti.py]"]
  node_analysis_data["Analysis-ready reviews<br/>Processing stage"]
  node_language_detection["Language detection<br/>Language module<br/>[langdetect.py]"]
  node_translation["Translation<br/>External-service adapter<br/>[langtranslate.py]"]
  node_filtered_reviews["Filtered reviews<br/>JSON artifact"]
  node_sentiment_reviews["Sentiment reviews<br/>JSON artifact"]
  node_category_assignment["Category assignment<br/>Insight module<br/>[category.py]"]
  node_category_reviews["Category reviews<br/>JSON artifact"]
end

subgraph group_reporting["Reporting"]
  node_summarization["Summarization<br/>Insight module<br/>[summarization.py]"]
  node_report["Report generation<br/>Python entry point<br/>[report.py]"]
  node_display["Report display<br/>Renderer<br/>[display.py]"]
  node_summary_artifacts["Summary artifacts<br/>JSON, CSV, HTML, diagrams<br/>[summary.json]"]
end

node_collection_config -.->|"configures"| node_generate_data
node_generate_data -->|"collects from"| node_appstore_adapter
node_generate_data -->|"collects from"| node_playstore_adapter
node_appstore_adapter -->|"reviews"| node_prepare_appstore
node_playstore_adapter -->|"reviews"| node_prepare_playstore
node_prepare_appstore -->|"normalizes"| node_normalized_reviews
node_prepare_playstore -->|"normalizes"| node_normalized_reviews
node_fileops -.->|"persists"| node_normalized_reviews
node_normalized_reviews -->|"input contract"| node_senti
node_senti -->|"coordinates"| node_analysis_data
node_analysis_data -->|"detects language"| node_language_detection
node_language_detection -->|"non-default text"| node_translation
node_analysis_data -->|"filters"| node_filtered_reviews
node_senti -->|"derives sentiment"| node_sentiment_reviews
node_senti -->|"assigns categories"| node_category_assignment
node_category_assignment -->|"writes"| node_category_reviews
node_filtered_reviews -->|"input"| node_summarization
node_sentiment_reviews -->|"input"| node_summarization
node_category_reviews -->|"input"| node_summarization
node_summarization -->|"summary data"| node_report
node_report -->|"renders with"| node_display
node_display -->|"emits"| node_summary_artifacts

click node_collection_config "https://github.com/suren2787/app-sentiment/blob/master/sentimeter/datacollection/config_Template.py"
click node_generate_data "https://github.com/suren2787/app-sentiment/blob/master/sentimeter/datacollection/generate-data.py"
click node_appstore_adapter "https://github.com/suren2787/app-sentiment/blob/master/modules/appstore/asreviews.py"
click node_playstore_adapter "https://github.com/suren2787/app-sentiment/blob/master/modules/playstore/psreviews.py"
click node_prepare_appstore "https://github.com/suren2787/app-sentiment/blob/master/sentimeter/datacollection/prepareappstorereviews.py"
click node_prepare_playstore "https://github.com/suren2787/app-sentiment/blob/master/sentimeter/datacollection/prepareplaystorereviews.py"
click node_fileops "https://github.com/suren2787/app-sentiment/blob/master/modules/utility/fileops.py"
click node_normalized_reviews "https://github.com/suren2787/app-sentiment/blob/master/sentimeter/datacollection/results/reviews-normalized.json"
click node_senti "https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/senti.py"
click node_analysis_data "https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/getdataforinsights.py"
click node_language_detection "https://github.com/suren2787/app-sentiment/blob/master/modules/translate/langdetect.py"
click node_translation "https://github.com/suren2787/app-sentiment/blob/master/modules/translate/langtranslate.py"
click node_filtered_reviews "https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/results/reviews-filtered.json"
click node_sentiment_reviews "https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/results/reviews-sentiments.json"
click node_category_assignment "https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/category.py"
click node_category_reviews "https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/results/reviews-category.json"
click node_summarization "https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/summarization.py"
click node_report "https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/report.py"
click node_display "https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/display.py"
click node_summary_artifacts "https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/results/summary.json"

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_collection_config,node_generate_data,node_appstore_adapter,node_playstore_adapter,node_prepare_appstore,node_prepare_playstore,node_fileops,node_normalized_reviews toneBlue
class node_senti,node_analysis_data,node_language_detection,node_translation,node_filtered_reviews,node_sentiment_reviews,node_category_assignment,node_category_reviews toneAmber
class node_summarization,node_report,node_display,node_summary_artifacts toneMint
```

## Components

### Data collection

- [Collection config](https://github.com/suren2787/app-sentiment/blob/master/sentimeter/datacollection/config_Template.py): Python config · `sentimeter/datacollection/config_Template.py`
- [Generate data](https://github.com/suren2787/app-sentiment/blob/master/sentimeter/datacollection/generate-data.py): Python entry point · Manual collection-stage command. · `sentimeter/datacollection/generate-data.py`
- [App Store reviews](https://github.com/suren2787/app-sentiment/blob/master/modules/appstore/asreviews.py): Source adapter · `modules/appstore/asreviews.py`
- [Google Play reviews](https://github.com/suren2787/app-sentiment/blob/master/modules/playstore/psreviews.py): Source adapter · `modules/playstore/psreviews.py`
- [Prepare App Store reviews](https://github.com/suren2787/app-sentiment/blob/master/sentimeter/datacollection/prepareappstorereviews.py): Normalizer · `sentimeter/datacollection/prepareappstorereviews.py`
- [Prepare Play reviews](https://github.com/suren2787/app-sentiment/blob/master/sentimeter/datacollection/prepareplaystorereviews.py): Normalizer · `sentimeter/datacollection/prepareplaystorereviews.py`
- [File operations](https://github.com/suren2787/app-sentiment/blob/master/modules/utility/fileops.py): Shared utility · Centralizes artifact file handling. · `modules/utility/fileops.py`
- [Normalized reviews](https://github.com/suren2787/app-sentiment/blob/master/sentimeter/datacollection/results/reviews-normalized.json): JSON artifact · Primary collection-to-insights handoff. · `sentimeter/datacollection/results/reviews-normalized.json`

### Insight processing

- [Sentiment pipeline](https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/senti.py): Python entry point · Manual insight-stage command. · `sentimeter/insights/senti.py`
- [Analysis-ready reviews](https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/getdataforinsights.py): Processing stage · Prepares multilingual reviews for analysis. · `sentimeter/insights/getdataforinsights.py`
- [Language detection](https://github.com/suren2787/app-sentiment/blob/master/modules/translate/langdetect.py): Language module · `modules/translate/langdetect.py`
- [Translation](https://github.com/suren2787/app-sentiment/blob/master/modules/translate/langtranslate.py): External-service adapter · Provider-sensitive multilingual text translation. · `modules/translate/langtranslate.py`
- [Filtered reviews](https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/results/reviews-filtered.json): JSON artifact · `sentimeter/insights/results/reviews-filtered.json`
- [Sentiment reviews](https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/results/reviews-sentiments.json): JSON artifact · `sentimeter/insights/results/reviews-sentiments.json`
- [Category assignment](https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/category.py): Insight module · `sentimeter/insights/category.py`
- [Category reviews](https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/results/reviews-category.json): JSON artifact · `sentimeter/insights/results/reviews-category.json`

### Reporting

- [Summarization](https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/summarization.py): Insight module · `sentimeter/insights/summarization.py`
- [Report generation](https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/report.py): Python entry point · Manual reporting-stage command. · `sentimeter/insights/report.py`
- [Report display](https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/display.py): Renderer · `sentimeter/insights/display.py`
- [Summary artifacts](https://github.com/suren2787/app-sentiment/blob/master/sentimeter/insights/results/summary.json): JSON, CSV, HTML, diagrams · Structured summaries and rendered report outputs. · `sentimeter/insights/results/summary.json`

## Connections

- Collection config → Generate data: configures
- Generate data → App Store reviews: collects from
- Generate data → Google Play reviews: collects from
- App Store reviews → Prepare App Store reviews: reviews
- Google Play reviews → Prepare Play reviews: reviews
- Prepare App Store reviews → Normalized reviews: normalizes
- Prepare Play reviews → Normalized reviews: normalizes
- File operations → Normalized reviews: persists
- Normalized reviews → Sentiment pipeline: input contract
- Sentiment pipeline → Analysis-ready reviews: coordinates
- Analysis-ready reviews → Language detection: detects language
- Language detection → Translation: non-default text
- Analysis-ready reviews → Filtered reviews: filters
- Sentiment pipeline → Sentiment reviews: derives sentiment
- Sentiment pipeline → Category assignment: assigns categories
- Category assignment → Category reviews: writes
- Filtered reviews → Summarization: input
- Sentiment reviews → Summarization: input
- Category reviews → Summarization: input
- Summarization → Report generation: summary data
- Report generation → Report display: renders with
- Report display → Summary artifacts: emits
