# jakeb144/reel-watcher architecture

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

- Interactive diagram: https://gitdiagram.com/jakeb144/reel-watcher
- Repository: https://github.com/jakeb144/reel-watcher

## Overview

reel-watcher turns saved Instagram posts or local videos into structured reel studies using local media and AI analysis; Apify is the documented network exception. Users can first convert Instagram exports into URL lists, then run the study workflow and receive per-reel JSON, hook images, and optional archives. A separate optional command renders an advice library from JSON. The sampled sources show CLI dispatch, URL parsing, media helpers, and model wrappers; detailed internal orchestration is only partially excerpted, so some documented analysis stages are represented without asserting unsampled call links.

Main entry points: [`src/reel_watcher/study.py`](https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/study.py) (Study workflow), [`src/reel_watcher/cli.py`](https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/cli.py) (Command router), [`src/reel_watcher/ig_export.py`](https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/ig_export.py) (Instagram export parser), [`src/reel_watcher/media.py`](https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/media.py) (Media and URL helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Input and ingestion"]
  node_cli["Command router<br/>[cli.py]"]
  node_exporter["Instagram export parser<br/>[ig_export.py]"]
  node_url_list["Reel URL list"]
end

subgraph group_analysis["Local reel analysis"]
  node_study_runner["Study workflow<br/>[study.py]"]
  node_apify["Apify scraper"]
  node_media_helpers["Media and URL helpers<br/>[media.py]"]
  node_ffmpeg["Video tools"]
  node_frame_text["Frame OCR<br/>[study.py]"]
  node_frame_analysis["Frame analysis<br/>[study.py]"]
  node_vision_model["Local vision model<br/>[model.py]"]
  node_transcription["Speech transcription<br/>[study.py]"]
  node_synthesis["Study synthesis<br/>[study.py]"]
end

subgraph group_results["Study results"]
  node_study_json["Per-reel study JSON<br/>[study.py]"]
  node_archive["Media and frame archive<br/>[study.py]"]
  node_indexes["Study and cost logs<br/>[study.py]"]
end

subgraph group_advice["Advice library"]
  node_advice_json["Advice library JSON"]
  node_advice_renderer["Advice page renderer<br/>[advice_library.py]"]
  node_advice_page["Searchable advice page<br/>[advice_library.py]"]
end

node_user(("User"))

node_user -->|"runs command"| node_cli
node_cli -->|"dispatches export"| node_exporter
node_cli -->|"dispatches study"| node_study_runner
node_cli -->|"dispatches advice"| node_advice_renderer
node_exporter -->|"parses reel IDs"| node_media_helpers
node_exporter -->|"writes URLs"| node_url_list
node_url_list -->|"provides input"| node_study_runner
node_study_runner -->|"fetches media"| node_apify
node_study_runner -->|"uses media helpers"| node_media_helpers
node_media_helpers -->|"runs video tools"| node_ffmpeg
node_study_runner -->|"reads on-screen text"| node_frame_text
node_study_runner -->|"analyzes frames"| node_frame_analysis
node_study_runner -->|"requests vision analysis"| node_vision_model
node_study_runner -->|"transcribes speech"| node_transcription
node_study_runner -->|"detects giveaways and synthesizes"| node_synthesis
node_synthesis -->|"writes study"| node_study_json
node_study_runner -->|"keeps optional files"| node_archive
node_study_runner -->|"writes summaries and costs"| node_indexes
node_user -->|"provides library"| node_advice_json
node_advice_json -->|"loads JSON"| node_advice_renderer
node_advice_renderer -->|"renders HTML"| node_advice_page

click node_cli "https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/cli.py"
click node_exporter "https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/ig_export.py"
click node_study_runner "https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/study.py"
click node_media_helpers "https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/media.py"
click node_frame_text "https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/study.py"
click node_frame_analysis "https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/study.py"
click node_vision_model "https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/model.py"
click node_transcription "https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/study.py"
click node_synthesis "https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/study.py"
click node_study_json "https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/study.py"
click node_archive "https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/study.py"
click node_indexes "https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/study.py"
click node_advice_renderer "https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/advice_library.py"
click node_advice_page "https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/advice_library.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_cli,node_exporter,node_url_list,node_user toneBlue
class node_study_runner,node_apify,node_media_helpers,node_ffmpeg,node_frame_text,node_frame_analysis,node_vision_model,node_transcription,node_synthesis toneAmber
class node_study_json,node_archive,node_indexes toneMint
class node_advice_json,node_advice_renderer,node_advice_page toneRose
```

## Components

### Input and ingestion

- [Command router](https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/cli.py): `src/reel_watcher/cli.py`
- [Instagram export parser](https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/ig_export.py): `src/reel_watcher/ig_export.py`
- **Reel URL list**

### Local reel analysis

- [Study workflow](https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/study.py): `src/reel_watcher/study.py`
- **Apify scraper**
- [Media and URL helpers](https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/media.py): `src/reel_watcher/media.py`
- **Video tools**
- [Frame OCR](https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/study.py): `src/reel_watcher/study.py`
- [Frame analysis](https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/study.py): `src/reel_watcher/study.py`
- [Local vision model](https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/model.py): `src/reel_watcher/model.py`
- [Speech transcription](https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/study.py): `src/reel_watcher/study.py`
- [Study synthesis](https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/study.py): `src/reel_watcher/study.py`

### Study results

- [Per-reel study JSON](https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/study.py): `src/reel_watcher/study.py`
- [Media and frame archive](https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/study.py): `src/reel_watcher/study.py`
- [Study and cost logs](https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/study.py): `src/reel_watcher/study.py`

### Advice library

- **Advice library JSON**
- [Advice page renderer](https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/advice_library.py): `src/reel_watcher/advice_library.py`
- [Searchable advice page](https://github.com/jakeb144/reel-watcher/blob/main/src/reel_watcher/advice_library.py): `src/reel_watcher/advice_library.py`

### Other components

- **User**

## Connections

- User → Command router: runs command (evidence: `README.md`)
- Command router → Instagram export parser: dispatches export (evidence: `src/reel_watcher/cli.py`)
- Command router → Study workflow: dispatches study (evidence: `src/reel_watcher/cli.py`)
- Command router → Advice page renderer: dispatches advice (evidence: `src/reel_watcher/cli.py`)
- Instagram export parser → Media and URL helpers: parses reel IDs (evidence: `src/reel_watcher/ig_export.py`)
- Instagram export parser → Reel URL list: writes URLs (evidence: `src/reel_watcher/ig_export.py`)
- Reel URL list → Study workflow: provides input (evidence: `README.md`)
- Study workflow → Apify scraper: fetches media (evidence: `README.md`)
- Study workflow → Media and URL helpers: uses media helpers (evidence: `src/reel_watcher/study.py`)
- Media and URL helpers → Video tools: runs video tools (evidence: `src/reel_watcher/media.py`)
- Study workflow → Frame OCR: reads on-screen text (evidence: `README.md`)
- Study workflow → Frame analysis: analyzes frames (evidence: `README.md`)
- Study workflow → Local vision model: requests vision analysis (evidence: `src/reel_watcher/study.py`)
- Study workflow → Speech transcription: transcribes speech (evidence: `README.md`)
- Study workflow → Study synthesis: detects giveaways and synthesizes (evidence: `src/reel_watcher/study.py`)
- Study synthesis → Per-reel study JSON: writes study (evidence: `src/reel_watcher/study.py`)
- Study workflow → Media and frame archive: keeps optional files (evidence: `README.md`)
- Study workflow → Study and cost logs: writes summaries and costs (evidence: `README.md`)
- User → Advice library JSON: provides library (evidence: `README.md`)
- Advice library JSON → Advice page renderer: loads JSON (evidence: `src/reel_watcher/advice_library.py`)
- Advice page renderer → Searchable advice page: renders HTML (evidence: `src/reel_watcher/advice_library.py`)
