# harshil-2008/feedback_agent architecture

> Architecture diagram of the GitHub repository harshil-2008/feedback_agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harshil-2008/feedback_agent
- Repository: https://github.com/harshil-2008/feedback_agent

## Overview

This repository combines feedback collection and analysis with a multi-platform product/social search dashboard. The primary workflow accepts feedback, stores it, and processes it into sentiment scores and themes; a separate search workflow aggregates platform results and returns normalized results with insights. The tree also contains a second FastAPI entry point with placeholder search and analytics routes. Relationships below follow shown calls and imports; adapter behavior beyond the indexed references and the frontend’s wiring are not inferred.

Main entry points: [`data_ingestion_service/search/orchestrator.py`](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/orchestrator.py) (Search orchestrator), [`storage/database.py`](https://github.com/harshil-2008/feedback_agent/blob/main/storage/database.py) (Database access), [`data_ingestion_service/scheduler/job_runner.py`](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/scheduler/job_runner.py) (Feedback processor), [`storage/models.py`](https://github.com/harshil-2008/feedback_agent/blob/main/storage/models.py) (Feedback and analysis records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["API and UI"]
  node_service_app["Service application<br/>[main.py]"]
  node_dashboard["Dashboard frontend<br/>[app.js]"]
  node_feedback_api["Feedback intake<br/>[main.py]"]
  node_analytics_api["Theme and sentiment API<br/>[routes.py]"]
  node_search_api["Search API<br/>[search_routes.py]"]
  node_legacy_app["Legacy API application<br/>[main.py]"]
  node_legacy_routes["Legacy analytics and search<br/>[routes.py]"]
  node_scheduler_trigger["Scheduler trigger<br/>[routes.py]"]
end

subgraph group_feedback["Feedback analytics"]
  node_processor["Feedback processor<br/>[job_runner.py]"]
  node_sentiment["Sentiment analysis"]
  node_themes["Theme extraction<br/>[theme_extractor.py]"]
end

subgraph group_search["Search aggregation"]
  node_search_orch["Search orchestrator<br/>[orchestrator.py]"]
  node_serpapi["SerpAPI adapter<br/>[serpapi.py]"]
  node_google["Google Shopping adapter<br/>[google_shopping.py]"]
  node_ebay["eBay adapter<br/>[ebay.py]"]
  node_discord["Discord adapter<br/>[discord.py]"]
  node_twitter["Twitter adapter<br/>[twitter.py]"]
  node_instagram["Instagram adapter<br/>[instagram.py]"]
  node_facebook["Facebook adapter<br/>[facebook.py]"]
  node_amazon["Amazon adapter<br/>[amazon.py]"]
  node_insights["Search insights<br/>[insights.py]"]
end

subgraph group_storage["Persistence"]
  node_db["Database access<br/>[database.py]"]
  node_models["Feedback and analysis records<br/>[models.py]"]
  node_postgres[("PostgreSQL")]
end

node_user(("Dashboard user"))

node_user -.->|"uses"| node_dashboard
node_service_app -->|"registers routes"| node_analytics_api
node_service_app -->|"registers routes"| node_search_api
node_service_app -->|"serves static files"| node_dashboard
node_service_app -->|"accepts feedback"| node_feedback_api
node_feedback_api -->|"opens session"| node_db
node_feedback_api -->|"creates feedback"| node_models
node_analytics_api -->|"queries via"| node_db
node_analytics_api -->|"queries records"| node_models
node_scheduler_trigger -->|"runs"| node_processor
node_processor -->|"opens session"| node_db
node_processor -->|"reads and writes"| node_models
node_processor -->|"analyzes text"| node_sentiment
node_processor -->|"extracts themes"| node_themes
node_legacy_app -->|"registers routes"| node_legacy_routes
node_legacy_routes -->|"queries via"| node_db
node_legacy_routes -->|"queries records"| node_models
node_search_api -->|"aggregates query"| node_search_orch
node_search_orch -->|"dispatches"| node_serpapi
node_search_orch -->|"dispatches"| node_google
node_search_orch -->|"dispatches"| node_ebay
node_search_orch -->|"dispatches"| node_discord
node_search_orch -->|"dispatches"| node_twitter
node_search_orch -->|"dispatches"| node_instagram
node_search_orch -->|"dispatches"| node_facebook
node_search_orch -->|"dispatches"| node_amazon
node_search_orch -->|"computes insights"| node_insights
node_db -->|"connects to"| node_postgres
node_db -->|"creates tables from"| node_models

click node_service_app "https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/main.py"
click node_dashboard "https://github.com/harshil-2008/feedback_agent/blob/main/frontend/app.js"
click node_feedback_api "https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/main.py"
click node_analytics_api "https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/api/routes.py"
click node_search_api "https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/api/search_routes.py"
click node_legacy_app "https://github.com/harshil-2008/feedback_agent/blob/main/main.py"
click node_legacy_routes "https://github.com/harshil-2008/feedback_agent/blob/main/api/routes.py"
click node_scheduler_trigger "https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/api/routes.py"
click node_processor "https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/scheduler/job_runner.py"
click node_sentiment "https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/nlp/sentiment_analyzer.py"
click node_themes "https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/nlp/theme_extractor.py"
click node_search_orch "https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/orchestrator.py"
click node_serpapi "https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/adapters/serpapi.py"
click node_google "https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/adapters/google_shopping.py"
click node_ebay "https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/adapters/ebay.py"
click node_discord "https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/adapters/discord.py"
click node_twitter "https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/adapters/twitter.py"
click node_instagram "https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/adapters/instagram.py"
click node_facebook "https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/adapters/facebook.py"
click node_amazon "https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/adapters/amazon.py"
click node_insights "https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/insights.py"
click node_db "https://github.com/harshil-2008/feedback_agent/blob/main/storage/database.py"
click node_models "https://github.com/harshil-2008/feedback_agent/blob/main/storage/models.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_service_app,node_dashboard,node_feedback_api,node_analytics_api,node_search_api,node_legacy_app,node_legacy_routes,node_scheduler_trigger,node_user toneBlue
class node_processor,node_sentiment,node_themes toneAmber
class node_search_orch,node_serpapi,node_google,node_ebay,node_discord,node_twitter,node_instagram,node_facebook,node_amazon,node_insights toneMint
class node_db,node_models,node_postgres toneRose
```

## Components

### API and UI

- [Service application](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/main.py): `data_ingestion_service/main.py`
- [Dashboard frontend](https://github.com/harshil-2008/feedback_agent/blob/main/frontend/app.js): `frontend/app.js`
- [Feedback intake](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/main.py): `data_ingestion_service/main.py`
- [Theme and sentiment API](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/api/routes.py): `data_ingestion_service/api/routes.py`
- [Search API](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/api/search_routes.py): `data_ingestion_service/api/search_routes.py`
- [Legacy API application](https://github.com/harshil-2008/feedback_agent/blob/main/main.py): `main.py`
- [Legacy analytics and search](https://github.com/harshil-2008/feedback_agent/blob/main/api/routes.py): `api/routes.py`
- [Scheduler trigger](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/api/routes.py): `data_ingestion_service/api/routes.py`

### Feedback analytics

- [Feedback processor](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/scheduler/job_runner.py): `data_ingestion_service/scheduler/job_runner.py`
- [Sentiment analysis](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/nlp/sentiment_analyzer.py): `data_ingestion_service/nlp/sentiment_analyzer.py`
- [Theme extraction](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/nlp/theme_extractor.py): `data_ingestion_service/nlp/theme_extractor.py`

### Search aggregation

- [Search orchestrator](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/orchestrator.py): `data_ingestion_service/search/orchestrator.py`
- [SerpAPI adapter](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/adapters/serpapi.py): `data_ingestion_service/search/adapters/serpapi.py`
- [Google Shopping adapter](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/adapters/google_shopping.py): `data_ingestion_service/search/adapters/google_shopping.py`
- [eBay adapter](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/adapters/ebay.py): `data_ingestion_service/search/adapters/ebay.py`
- [Discord adapter](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/adapters/discord.py): `data_ingestion_service/search/adapters/discord.py`
- [Twitter adapter](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/adapters/twitter.py): `data_ingestion_service/search/adapters/twitter.py`
- [Instagram adapter](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/adapters/instagram.py): `data_ingestion_service/search/adapters/instagram.py`
- [Facebook adapter](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/adapters/facebook.py): `data_ingestion_service/search/adapters/facebook.py`
- [Amazon adapter](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/adapters/amazon.py): `data_ingestion_service/search/adapters/amazon.py`
- [Search insights](https://github.com/harshil-2008/feedback_agent/blob/main/data_ingestion_service/search/insights.py): `data_ingestion_service/search/insights.py`

### Persistence

- [Database access](https://github.com/harshil-2008/feedback_agent/blob/main/storage/database.py): `storage/database.py`
- [Feedback and analysis records](https://github.com/harshil-2008/feedback_agent/blob/main/storage/models.py): `storage/models.py`
- **PostgreSQL**

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Dashboard frontend: uses
- Service application → Theme and sentiment API: registers routes (evidence: `data_ingestion_service/main.py`)
- Service application → Search API: registers routes (evidence: `data_ingestion_service/main.py`)
- Service application → Dashboard frontend: serves static files (evidence: `data_ingestion_service/main.py`)
- Service application → Feedback intake: accepts feedback (evidence: `data_ingestion_service/main.py`)
- Feedback intake → Database access: opens session (evidence: `data_ingestion_service/main.py`)
- Feedback intake → Feedback and analysis records: creates feedback (evidence: `data_ingestion_service/main.py`)
- Theme and sentiment API → Database access: queries via (evidence: `data_ingestion_service/api/routes.py`)
- Theme and sentiment API → Feedback and analysis records: queries records (evidence: `data_ingestion_service/api/routes.py`)
- Scheduler trigger → Feedback processor: runs (evidence: `data_ingestion_service/api/routes.py`)
- Feedback processor → Database access: opens session (evidence: `data_ingestion_service/scheduler/job_runner.py`)
- Feedback processor → Feedback and analysis records: reads and writes (evidence: `data_ingestion_service/scheduler/job_runner.py`)
- Feedback processor → Sentiment analysis: analyzes text (evidence: `data_ingestion_service/scheduler/job_runner.py`)
- Feedback processor → Theme extraction: extracts themes (evidence: `data_ingestion_service/scheduler/job_runner.py`)
- Legacy API application → Legacy analytics and search: registers routes (evidence: `main.py`)
- Legacy analytics and search → Database access: queries via (evidence: `api/routes.py`)
- Legacy analytics and search → Feedback and analysis records: queries records (evidence: `api/routes.py`)
- Search API → Search orchestrator: aggregates query (evidence: `data_ingestion_service/api/search_routes.py`)
- Search orchestrator → SerpAPI adapter: dispatches (evidence: `data_ingestion_service/search/orchestrator.py`)
- Search orchestrator → Google Shopping adapter: dispatches (evidence: `data_ingestion_service/search/orchestrator.py`)
- Search orchestrator → eBay adapter: dispatches (evidence: `data_ingestion_service/search/orchestrator.py`)
- Search orchestrator → Discord adapter: dispatches (evidence: `data_ingestion_service/search/orchestrator.py`)
- Search orchestrator → Twitter adapter: dispatches (evidence: `data_ingestion_service/search/orchestrator.py`)
- Search orchestrator → Instagram adapter: dispatches (evidence: `data_ingestion_service/search/orchestrator.py`)
- Search orchestrator → Facebook adapter: dispatches (evidence: `data_ingestion_service/search/orchestrator.py`)
- Search orchestrator → Amazon adapter: dispatches (evidence: `data_ingestion_service/search/orchestrator.py`)
- Search orchestrator → Search insights: computes insights (evidence: `data_ingestion_service/search/orchestrator.py`)
- Database access → PostgreSQL: connects to (evidence: `storage/database.py`)
- Database access → Feedback and analysis records: creates tables from (evidence: `storage/database.py`)
