# ayinaladhorasatyamurthy/social_media_analysis architecture

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

- Interactive diagram: https://gitdiagram.com/ayinaladhorasatyamurthy/social_media_analysis
- Repository: https://github.com/ayinaladhorasatyamurthy/social_media_analysis

## Overview

InsightSphere STUDIO is a YouTube intelligence and creator-analytics platform. Users enter through the React app, authenticate for protected tools, then request dashboard, sentiment, topology, influencer, or creator-discovery results; they can also export or email reports. Flask blueprints serve those capabilities, with channel ingestion, curated datasets, serialization, and resilient MongoDB/local persistence supporting them. README documents the feature-to-API workflows; sampled source and the SOURCE INDEX support the backend registrations and selected service/storage links, while unsampled implementation details are not inferred.

Main entry points: [`src/App.js`](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/App.js) (App routing), [`app.py`](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/app.py) (Flask application), [`src/apiConfig.js`](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/apiConfig.js) (API fetch client), [`blueprints/sentiment.py`](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/blueprints/sentiment.py) (Sentiment endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["App routing<br/>[App.js]"]
  node_auth_ui["Authentication UI<br/>[AuthContext.js]"]
  node_dashboard_ui["Regional dashboard"]
  node_sentiment_ui["Sentiment analysis"]
  node_topology_ui["Semantic topology"]
  node_influencer_ui["Influencer benchmark"]
  node_map_ui["World map"]
  node_recommend_ui["Creator recommendations<br/>[Recommendations.js]"]
  node_reports_ui["Report studio<br/>[Reports.js]"]
  node_api_client["API fetch client<br/>[apiConfig.js]"]
end

subgraph group_backend["Flask API"]
  node_api["Flask application<br/>[app.py]"]
  node_auth_api["Auth endpoints<br/>[auth.py]"]
  node_dashboard_api["Dashboard endpoints<br/>[dash.py]"]
  node_sentiment_api["Sentiment endpoints<br/>[sentiment.py]"]
  node_network_api["Network endpoints<br/>[network.py]"]
  node_influencer_api["Influencer endpoints<br/>[influencer.py]"]
  node_recommend_api["Recommendation endpoints<br/>[recom.py]"]
  node_send_api["Report endpoints<br/>[send.py]"]
end

subgraph group_analytics["Analytics and discovery"]
  node_ingest["Channel ingestion<br/>[channel_ingest.py]"]
  node_regional["Regional trends"]
  node_creator_catalog["Category creators"]
  node_influencer_catalog["Influencer catalog"]
  node_serializer["JSON serialization<br/>[serialize.py]"]
end

subgraph group_persistence["Persistence"]
  node_mongo_layer["Resilient collections<br/>[mongo.py]"]
  node_database[("MongoDB / local store")]
end

subgraph group_integrations["External services"]
  node_youtube{{"YouTube Data API"}}
  node_smtp{{"Gmail SMTP"}}
end

node_visitor(("Browser user"))

node_visitor -->|"uses"| node_app
node_app -->|"provides auth"| node_auth_ui
node_app -->|"routes to"| node_dashboard_ui
node_app -->|"routes to"| node_sentiment_ui
node_app -->|"routes to"| node_topology_ui
node_app -->|"routes to"| node_influencer_ui
node_app -->|"routes to"| node_recommend_ui
node_app -->|"routes to"| node_reports_ui
node_dashboard_ui -->|"fetches through"| node_api_client
node_sentiment_ui -->|"fetches through"| node_api_client
node_topology_ui -->|"fetches through"| node_api_client
node_influencer_ui -->|"fetches through"| node_api_client
node_recommend_ui -->|"fetches through"| node_api_client
node_reports_ui -->|"fetches through"| node_api_client
node_api_client -->|"sends API requests"| node_api
node_api -->|"registers"| node_auth_api
node_api -->|"registers"| node_dashboard_api
node_api -->|"registers"| node_sentiment_api
node_api -->|"registers"| node_network_api
node_api -->|"registers"| node_influencer_api
node_api -->|"registers"| node_recommend_api
node_api -->|"registers"| node_send_api
node_auth_api -->|"sends OTP"| node_smtp
node_dashboard_api -->|"loads trends"| node_regional
node_sentiment_api -->|"uses channel data"| node_ingest
node_network_api -->|"uses channel data"| node_ingest
node_influencer_api -->|"ingests channel"| node_ingest
node_influencer_api -->|"filters creators"| node_influencer_catalog
node_recommend_api -->|"loads creators"| node_creator_catalog
node_sentiment_api -->|"serializes results"| node_serializer
node_network_api -->|"serializes results"| node_serializer
node_influencer_api -->|"serializes results"| node_serializer
node_ingest -->|"caches snapshots"| node_mongo_layer
node_mongo_layer -->|"reads and writes"| node_database
node_ingest -->|"fetches channel data"| node_youtube
node_sentiment_api -->|"fetches video data"| node_youtube
node_sentiment_api -->|"uses persistence"| node_mongo_layer
node_network_api -->|"uses persistence"| node_mongo_layer
node_send_api -->|"emails reports"| node_smtp
node_map_ui -->|"renders map"| node_influencer_ui

click node_app "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/App.js"
click node_auth_ui "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/context/AuthContext.js"
click node_dashboard_ui "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/components/DashboardAnalytics.js"
click node_sentiment_ui "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/components/SentimentAnalysis.js"
click node_topology_ui "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/components/NetworkVisualization.js"
click node_influencer_ui "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/components/InfluencerDetection.js"
click node_map_ui "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/components/InteractiveWorldMap.js"
click node_recommend_ui "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/components/Recommendations.js"
click node_reports_ui "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/components/Reports.js"
click node_api_client "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/apiConfig.js"
click node_api "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/app.py"
click node_auth_api "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/blueprints/auth.py"
click node_dashboard_api "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/blueprints/dash.py"
click node_sentiment_api "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/blueprints/sentiment.py"
click node_network_api "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/blueprints/network.py"
click node_influencer_api "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/blueprints/influencer.py"
click node_recommend_api "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/blueprints/recom.py"
click node_send_api "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/blueprints/send.py"
click node_ingest "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/services/channel_ingest.py"
click node_regional "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/services/regional_trending.py"
click node_creator_catalog "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/services/category_creators.py"
click node_influencer_catalog "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/services/influencer_catalog.py"
click node_serializer "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/services/serialize.py"
click node_mongo_layer "https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/db/mongo.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_app,node_auth_ui,node_dashboard_ui,node_sentiment_ui,node_topology_ui,node_influencer_ui,node_map_ui,node_recommend_ui,node_reports_ui,node_api_client,node_visitor toneBlue
class node_api,node_auth_api,node_dashboard_api,node_sentiment_api,node_network_api,node_influencer_api,node_recommend_api,node_send_api toneAmber
class node_ingest,node_regional,node_creator_catalog,node_influencer_catalog,node_serializer toneMint
class node_mongo_layer,node_database toneRose
class node_youtube,node_smtp toneIndigo
```

## Components

### Web application

- [App routing](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/App.js): `src/App.js`
- [Authentication UI](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/context/AuthContext.js): `src/context/AuthContext.js`
- [Regional dashboard](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/components/DashboardAnalytics.js): `src/components/DashboardAnalytics.js`
- [Sentiment analysis](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/components/SentimentAnalysis.js): `src/components/SentimentAnalysis.js`
- [Semantic topology](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/components/NetworkVisualization.js): `src/components/NetworkVisualization.js`
- [Influencer benchmark](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/components/InfluencerDetection.js): `src/components/InfluencerDetection.js`
- [World map](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/components/InteractiveWorldMap.js): `src/components/InteractiveWorldMap.js`
- [Creator recommendations](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/components/Recommendations.js): `src/components/Recommendations.js`
- [Report studio](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/components/Reports.js): `src/components/Reports.js`
- [API fetch client](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/src/apiConfig.js): `src/apiConfig.js`

### Flask API

- [Flask application](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/app.py): `app.py`
- [Auth endpoints](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/blueprints/auth.py): `blueprints/auth.py`
- [Dashboard endpoints](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/blueprints/dash.py): `blueprints/dash.py`
- [Sentiment endpoints](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/blueprints/sentiment.py): `blueprints/sentiment.py`
- [Network endpoints](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/blueprints/network.py): `blueprints/network.py`
- [Influencer endpoints](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/blueprints/influencer.py): `blueprints/influencer.py`
- [Recommendation endpoints](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/blueprints/recom.py): `blueprints/recom.py`
- [Report endpoints](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/blueprints/send.py): `blueprints/send.py`

### Analytics and discovery

- [Channel ingestion](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/services/channel_ingest.py): `services/channel_ingest.py`
- [Regional trends](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/services/regional_trending.py): `services/regional_trending.py`
- [Category creators](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/services/category_creators.py): `services/category_creators.py`
- [Influencer catalog](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/services/influencer_catalog.py): `services/influencer_catalog.py`
- [JSON serialization](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/services/serialize.py): `services/serialize.py`

### Persistence

- [Resilient collections](https://github.com/ayinaladhorasatyamurthy/social_media_analysis/blob/main/db/mongo.py): `db/mongo.py`
- **MongoDB / local store**

### External services

- **YouTube Data API**
- **Gmail SMTP**

### Other components

- **Browser user**

## Connections

- Browser user → App routing: uses
- App routing → Authentication UI: provides auth (evidence: `src/App.js`)
- App routing → Regional dashboard: routes to (evidence: `src/App.js`)
- App routing → Sentiment analysis: routes to (evidence: `src/App.js`)
- App routing → Semantic topology: routes to (evidence: `src/App.js`)
- App routing → Influencer benchmark: routes to (evidence: `src/App.js`)
- App routing → Creator recommendations: routes to (evidence: `src/App.js`)
- App routing → Report studio: routes to (evidence: `src/App.js`)
- Regional dashboard → API fetch client: fetches through (evidence: `src/components/DashboardAnalytics.js`)
- Sentiment analysis → API fetch client: fetches through (evidence: `src/components/SentimentAnalysis.js`)
- Semantic topology → API fetch client: fetches through (evidence: `src/components/NetworkVisualization.js`)
- Influencer benchmark → API fetch client: fetches through (evidence: `src/components/InfluencerDetection.js`)
- Creator recommendations → API fetch client: fetches through (evidence: `src/components/Recommendations.js`)
- Report studio → API fetch client: fetches through (evidence: `src/components/Reports.js`)
- API fetch client → Flask application: sends API requests
- Flask application → Auth endpoints: registers (evidence: `app.py`)
- Flask application → Dashboard endpoints: registers (evidence: `app.py`)
- Flask application → Sentiment endpoints: registers (evidence: `app.py`)
- Flask application → Network endpoints: registers (evidence: `app.py`)
- Flask application → Influencer endpoints: registers (evidence: `app.py`)
- Flask application → Recommendation endpoints: registers (evidence: `app.py`)
- Flask application → Report endpoints: registers (evidence: `app.py`)
- Auth endpoints → Gmail SMTP: sends OTP (evidence: `blueprints/auth.py`)
- Dashboard endpoints → Regional trends: loads trends (evidence: `blueprints/dash.py`)
- Sentiment endpoints → Channel ingestion: uses channel data (evidence: `blueprints/sentiment.py`)
- Network endpoints → Channel ingestion: uses channel data (evidence: `blueprints/network.py`)
- Influencer endpoints → Channel ingestion: ingests channel (evidence: `blueprints/influencer.py`)
- Influencer endpoints → Influencer catalog: filters creators (evidence: `blueprints/influencer.py`)
- Recommendation endpoints → Category creators: loads creators (evidence: `blueprints/recom.py`)
- Sentiment endpoints → JSON serialization: serializes results (evidence: `blueprints/sentiment.py`)
- Network endpoints → JSON serialization: serializes results (evidence: `blueprints/network.py`)
- Influencer endpoints → JSON serialization: serializes results (evidence: `blueprints/influencer.py`)
- Channel ingestion → Resilient collections: caches snapshots (evidence: `services/channel_ingest.py`)
- Resilient collections → MongoDB / local store: reads and writes (evidence: `db/mongo.py`)
- Channel ingestion → YouTube Data API: fetches channel data (evidence: `services/channel_ingest.py`)
- Sentiment endpoints → YouTube Data API: fetches video data (evidence: `blueprints/sentiment.py`)
- Sentiment endpoints → Resilient collections: uses persistence (evidence: `blueprints/sentiment.py`)
- Network endpoints → Resilient collections: uses persistence (evidence: `blueprints/network.py`)
- Report endpoints → Gmail SMTP: emails reports
- World map → Influencer benchmark: renders map (evidence: `src/components/InfluencerDetection.js`)
