# apple-pie-h/followpulse architecture

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

- Interactive diagram: https://gitdiagram.com/apple-pie-h/followpulse
- Repository: https://github.com/apple-pie-h/followpulse

## Overview

FollowPulse is a React/Flask dashboard that accepts Instagram follower and following exports, compares them, and presents downloadable results. The primary flow runs from file selection through the frontend API client to Flask parsing, comparison, and session storage, then back to result tabs and exports. A separate optional scan checks non-reciprocal accounts using headless Chrome and reports job progress. The README documents search, sorting, pagination, clipboard, CSV/TXT downloads, and validation; the sampled files do not show every UI detail. The graph omits uncertain parser internals and labels only evidenced relationships.

Main entry points: [`frontend/src/App.jsx`](https://github.com/apple-pie-h/followpulse/blob/main/frontend/src/App.jsx) (Dashboard flow), [`backend/app.py`](https://github.com/apple-pie-h/followpulse/blob/main/backend/app.py) (HTTP endpoints), [`backend/services/inactive_checker.py`](https://github.com/apple-pie-h/followpulse/blob/main/backend/services/inactive_checker.py) (Inactive checker), [`frontend/src/lib/api.js`](https://github.com/apple-pie-h/followpulse/blob/main/frontend/src/lib/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Dashboard"]
  node_upload["File upload<br/>[FileDropZone.jsx]"]
  node_dashboard["Dashboard flow<br/>[App.jsx]"]
  node_stats["Result counts<br/>[StatCard.jsx]"]
  node_table["Result tables<br/>[ResultsTable.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_analytics["Analytics<br/>[App.jsx]"]
end

subgraph group_api["Backend API"]
  node_flask["HTTP endpoints<br/>[app.py]"]
  node_inactive_api["Scan job API<br/>[app.py]"]
end

subgraph group_analysis["Export Analysis"]
  node_parser["Export parser"]
  node_comparison["Result comparison"]
  node_file_exports["CSV/TXT writers"]
end

subgraph group_scan["Inactive Scan"]
  node_checker["Inactive checker"]
  node_chrome(("Instagram profiles"))
end

subgraph group_state["Session State"]
  node_session_store[("Session and job store<br/>[store.py]")]
end

node_user(("Instagram user"))

node_user -->|"chooses files"| node_upload
node_upload -->|"selects files"| node_dashboard
node_dashboard -->|"submits upload"| node_api_client
node_api_client -.->|"HTTP requests"| node_flask
node_flask -->|"detects and extracts"| node_parser
node_flask -->|"builds result sets"| node_comparison
node_flask -->|"creates session"| node_session_store
node_flask -->|"writes result files"| node_file_exports
node_flask -.->|"returns results"| node_dashboard
node_dashboard -->|"renders counts"| node_stats
node_dashboard -->|"renders results"| node_table
node_dashboard -->|"requests downloads"| node_api_client
node_dashboard -->|"starts and polls"| node_inactive_api
node_inactive_api -->|"reads session"| node_session_store
node_inactive_api -->|"starts scan"| node_checker
node_inactive_api -->|"reads job snapshot"| node_checker
node_checker -->|"checks profiles"| node_chrome
node_checker -->|"updates jobs and session"| node_session_store
node_checker -->|"writes scan exports"| node_file_exports
node_dashboard -->|"renders analytics"| node_analytics

click node_upload "https://github.com/apple-pie-h/followpulse/blob/main/frontend/src/components/FileDropZone.jsx"
click node_dashboard "https://github.com/apple-pie-h/followpulse/blob/main/frontend/src/App.jsx"
click node_stats "https://github.com/apple-pie-h/followpulse/blob/main/frontend/src/components/StatCard.jsx"
click node_table "https://github.com/apple-pie-h/followpulse/blob/main/frontend/src/components/ResultsTable.jsx"
click node_api_client "https://github.com/apple-pie-h/followpulse/blob/main/frontend/src/lib/api.js"
click node_flask "https://github.com/apple-pie-h/followpulse/blob/main/backend/app.py"
click node_parser "https://github.com/apple-pie-h/followpulse/blob/main/backend/services/instagram_parser.py"
click node_comparison "https://github.com/apple-pie-h/followpulse/blob/main/backend/services/instagram_parser.py"
click node_file_exports "https://github.com/apple-pie-h/followpulse/blob/main/backend/services/instagram_parser.py"
click node_session_store "https://github.com/apple-pie-h/followpulse/blob/main/backend/storage/store.py"
click node_inactive_api "https://github.com/apple-pie-h/followpulse/blob/main/backend/app.py"
click node_checker "https://github.com/apple-pie-h/followpulse/blob/main/backend/services/inactive_checker.py"
click node_analytics "https://github.com/apple-pie-h/followpulse/blob/main/frontend/src/App.jsx"

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_upload,node_dashboard,node_stats,node_table,node_api_client,node_analytics,node_user toneBlue
class node_flask,node_inactive_api toneAmber
class node_parser,node_comparison,node_file_exports toneMint
class node_checker,node_chrome toneRose
class node_session_store toneIndigo
```

## Components

### Dashboard

- [File upload](https://github.com/apple-pie-h/followpulse/blob/main/frontend/src/components/FileDropZone.jsx): `frontend/src/components/FileDropZone.jsx`
- [Dashboard flow](https://github.com/apple-pie-h/followpulse/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Result counts](https://github.com/apple-pie-h/followpulse/blob/main/frontend/src/components/StatCard.jsx): `frontend/src/components/StatCard.jsx`
- [Result tables](https://github.com/apple-pie-h/followpulse/blob/main/frontend/src/components/ResultsTable.jsx): `frontend/src/components/ResultsTable.jsx`
- [API client](https://github.com/apple-pie-h/followpulse/blob/main/frontend/src/lib/api.js): `frontend/src/lib/api.js`
- [Analytics](https://github.com/apple-pie-h/followpulse/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`

### Backend API

- [HTTP endpoints](https://github.com/apple-pie-h/followpulse/blob/main/backend/app.py): `backend/app.py`
- [Scan job API](https://github.com/apple-pie-h/followpulse/blob/main/backend/app.py): `backend/app.py`

### Export Analysis

- [Export parser](https://github.com/apple-pie-h/followpulse/blob/main/backend/services/instagram_parser.py): `backend/services/instagram_parser.py`
- [Result comparison](https://github.com/apple-pie-h/followpulse/blob/main/backend/services/instagram_parser.py): `backend/services/instagram_parser.py`
- [CSV/TXT writers](https://github.com/apple-pie-h/followpulse/blob/main/backend/services/instagram_parser.py): `backend/services/instagram_parser.py`

### Inactive Scan

- [Inactive checker](https://github.com/apple-pie-h/followpulse/blob/main/backend/services/inactive_checker.py): `backend/services/inactive_checker.py`
- **Instagram profiles**

### Session State

- [Session and job store](https://github.com/apple-pie-h/followpulse/blob/main/backend/storage/store.py): `backend/storage/store.py`

### Other components

- **Instagram user**

## Connections

- Instagram user → File upload: chooses files (evidence: `frontend/src/components/FileDropZone.jsx`)
- File upload → Dashboard flow: selects files (evidence: `frontend/src/App.jsx`)
- Dashboard flow → API client: submits upload (evidence: `frontend/src/App.jsx`)
- API client → HTTP endpoints: HTTP requests
- HTTP endpoints → Export parser: detects and extracts (evidence: `backend/app.py`)
- HTTP endpoints → Result comparison: builds result sets (evidence: `backend/app.py`)
- HTTP endpoints → Session and job store: creates session (evidence: `backend/app.py`)
- HTTP endpoints → CSV/TXT writers: writes result files (evidence: `backend/app.py`)
- HTTP endpoints → Dashboard flow: returns results
- Dashboard flow → Result counts: renders counts (evidence: `frontend/src/App.jsx`)
- Dashboard flow → Result tables: renders results (evidence: `frontend/src/App.jsx`)
- Dashboard flow → API client: requests downloads (evidence: `frontend/src/App.jsx`)
- Dashboard flow → Scan job API: starts and polls (evidence: `frontend/src/App.jsx`)
- Scan job API → Session and job store: reads session (evidence: `backend/app.py`)
- Scan job API → Inactive checker: starts scan (evidence: `backend/app.py`)
- Scan job API → Inactive checker: reads job snapshot (evidence: `backend/app.py`)
- Inactive checker → Instagram profiles: checks profiles (evidence: `backend/services/inactive_checker.py`)
- Inactive checker → Session and job store: updates jobs and session (evidence: `backend/services/inactive_checker.py`)
- Inactive checker → CSV/TXT writers: writes scan exports (evidence: `backend/services/inactive_checker.py`)
- Dashboard flow → Analytics: renders analytics (evidence: `frontend/src/App.jsx`)
