# data-droid/scenenote architecture

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

- Interactive diagram: https://gitdiagram.com/data-droid/scenenote
- Repository: https://github.com/data-droid/scenenote

## Overview

Scene Note is a SwiftUI subtitle-learning app: learners browse or save shows, obtain episode subtitles, analyze transcript text with LLMs, then save and study expressions and vocabulary with speech playback. The graph preserves documented metadata search, subtitle acquisition, transcript processing, adaptive learning, settings, and backup capabilities. Source excerpts confirm analysis/provider and speech paths; broader UI and persistence connections rely on README statements, so unsampled implementation details are not asserted.

Main entry points: [`Sources/SubtitleCore/EpisodeDetailView.swift`](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/EpisodeDetailView.swift) (Episode Learning), [`Sources/SubtitleCore/FullTranscriptAnalysisPipeline.swift`](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/FullTranscriptAnalysisPipeline.swift) (Transcript Analysis), [`Sources/SubtitleCore/BrowseView.swift`](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/BrowseView.swift) (Browse Titles), [`Sources/SubtitleCore/OpenSubtitlesSubtitleService.swift`](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/OpenSubtitlesSubtitleService.swift) (Subtitle Fetch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browse["Browse and Ingest"]
  node_app["App Shell<br/>[MainTabView.swift]"]
  node_browseui["Browse Titles<br/>[BrowseView.swift]"]
  node_search["Title Search"]
  node_catalog["Show Catalog"]
  node_subtitles["Subtitle Fetch"]
end

subgraph group_analysis["Transcript Analysis"]
  node_srt["SRT Parsing"]
  node_transcript["Transcript Analysis"]
  node_chunking["Chunk and Prompt"]
  node_llmservice["LLM Routing<br/>[LLMService.swift]"]
  node_gemini["Gemini Provider"]
  node_groq["Groq Provider<br/>[GroqProvider.swift]"]
  node_parser["Result Parser"]
end

subgraph group_learning["Learning and Review"]
  node_episode["Episode Learning"]
  node_expressions["Expression Lists"]
  node_words["Vocabulary Lists<br/>[WordListView.swift]"]
  node_workbench["Sentence Workbench"]
  node_study[("Study Progress")]
  node_speech["Speech Playback"]
  node_geminitts["Gemini TTS"]
end

subgraph group_platform["Settings and Data"]
  node_voiceprefs[("Voice Preferences")]
  node_settings["Settings<br/>[SettingsView.swift]"]
  node_backup["Data Backup"]
end

node_learner(("Learner"))
node_tmdb(("TMDB"))
node_opensubtitles(("OpenSubtitles"))

node_learner -->|"opens"| node_app
node_app -->|"presents"| node_browseui
node_learner -->|"browses"| node_browseui
node_browseui -->|"searches titles"| node_search
node_search -->|"queries"| node_tmdb
node_browseui -->|"manages shows"| node_catalog
node_catalog -.->|"loads subtitles"| node_subtitles
node_subtitles -->|"fetches"| node_opensubtitles
node_subtitles -.->|"provides SRT"| node_srt
node_learner -->|"opens episode"| node_episode
node_episode -->|"analyzes transcript"| node_transcript
node_transcript -->|"builds prompts"| node_chunking
node_transcript -->|"routes analysis"| node_llmservice
node_llmservice -->|"tries Gemini"| node_gemini
node_llmservice -->|"falls back"| node_groq
node_transcript -->|"parses responses"| node_parser
node_parser -.->|"returns learning data"| node_episode
node_episode -->|"shows expressions"| node_expressions
node_episode -->|"shows vocabulary"| node_words
node_learner -->|"studies sentences"| node_workbench
node_workbench -->|"tracks progress"| node_study
node_workbench -->|"plays sentences"| node_speech
node_speech -->|"uses selected engine"| node_geminitts
node_speech -->|"reads settings"| node_voiceprefs
node_settings -->|"updates voice"| node_voiceprefs
node_learner -->|"configures app"| node_settings
node_settings -->|"exports data"| node_backup
node_backup -->|"backs up"| node_study

click node_app "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/MainTabView.swift"
click node_browseui "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/BrowseView.swift"
click node_search "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/TMDBSearchService.swift"
click node_catalog "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/ShowCatalogRefreshService.swift"
click node_subtitles "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/OpenSubtitlesSubtitleService.swift"
click node_srt "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/SRTSubtitleParser.swift"
click node_transcript "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/FullTranscriptAnalysisPipeline.swift"
click node_chunking "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/TranscriptChunkPrompt.swift"
click node_llmservice "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/LLMService.swift"
click node_gemini "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/GeminiProvider.swift"
click node_groq "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/GroqProvider.swift"
click node_parser "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/TranscriptChunkAnalysisParser.swift"
click node_episode "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/EpisodeDetailView.swift"
click node_expressions "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/ExpressionListView.swift"
click node_words "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/WordListView.swift"
click node_workbench "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/SentenceWorkbenchViewModel.swift"
click node_study "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/StudyProgressStore.swift"
click node_speech "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/EnglishSpeechSynthesizer.swift"
click node_geminitts "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/GeminiTTSSynthesizer.swift"
click node_voiceprefs "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/VoiceSettingsStore.swift"
click node_settings "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/SettingsView.swift"
click node_backup "https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/SceneNoteDataBackup.swift"

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_browseui,node_search,node_catalog,node_subtitles toneBlue
class node_srt,node_transcript,node_chunking,node_llmservice,node_gemini,node_groq,node_parser toneAmber
class node_episode,node_expressions,node_words,node_workbench,node_study,node_speech,node_geminitts toneMint
class node_voiceprefs,node_settings,node_backup toneRose
class node_learner,node_tmdb,node_opensubtitles toneIndigo
```

## Components

### Browse and Ingest

- [App Shell](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/MainTabView.swift): `Sources/SubtitleCore/MainTabView.swift`
- [Browse Titles](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/BrowseView.swift): `Sources/SubtitleCore/BrowseView.swift`
- [Title Search](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/TMDBSearchService.swift): `Sources/SubtitleCore/TMDBSearchService.swift`
- [Show Catalog](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/ShowCatalogRefreshService.swift): `Sources/SubtitleCore/ShowCatalogRefreshService.swift`
- [Subtitle Fetch](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/OpenSubtitlesSubtitleService.swift): `Sources/SubtitleCore/OpenSubtitlesSubtitleService.swift`

### Transcript Analysis

- [SRT Parsing](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/SRTSubtitleParser.swift): `Sources/SubtitleCore/SRTSubtitleParser.swift`
- [Transcript Analysis](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/FullTranscriptAnalysisPipeline.swift): `Sources/SubtitleCore/FullTranscriptAnalysisPipeline.swift`
- [Chunk and Prompt](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/TranscriptChunkPrompt.swift): `Sources/SubtitleCore/TranscriptChunkPrompt.swift`
- [LLM Routing](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/LLMService.swift): `Sources/SubtitleCore/LLMService.swift`
- [Gemini Provider](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/GeminiProvider.swift): `Sources/SubtitleCore/GeminiProvider.swift`
- [Groq Provider](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/GroqProvider.swift): `Sources/SubtitleCore/GroqProvider.swift`
- [Result Parser](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/TranscriptChunkAnalysisParser.swift): `Sources/SubtitleCore/TranscriptChunkAnalysisParser.swift`

### Learning and Review

- [Episode Learning](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/EpisodeDetailView.swift): `Sources/SubtitleCore/EpisodeDetailView.swift`
- [Expression Lists](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/ExpressionListView.swift): `Sources/SubtitleCore/ExpressionListView.swift`
- [Vocabulary Lists](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/WordListView.swift): `Sources/SubtitleCore/WordListView.swift`
- [Sentence Workbench](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/SentenceWorkbenchViewModel.swift): `Sources/SubtitleCore/SentenceWorkbenchViewModel.swift`
- [Study Progress](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/StudyProgressStore.swift): `Sources/SubtitleCore/StudyProgressStore.swift`
- [Speech Playback](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/EnglishSpeechSynthesizer.swift): `Sources/SubtitleCore/EnglishSpeechSynthesizer.swift`
- [Gemini TTS](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/GeminiTTSSynthesizer.swift): `Sources/SubtitleCore/GeminiTTSSynthesizer.swift`

### Settings and Data

- [Voice Preferences](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/VoiceSettingsStore.swift): `Sources/SubtitleCore/VoiceSettingsStore.swift`
- [Settings](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/SettingsView.swift): `Sources/SubtitleCore/SettingsView.swift`
- [Data Backup](https://github.com/data-droid/scenenote/blob/main/Sources/SubtitleCore/SceneNoteDataBackup.swift): `Sources/SubtitleCore/SceneNoteDataBackup.swift`

### Other components

- **Learner**
- **TMDB**
- **OpenSubtitles**

## Connections

- Learner → App Shell: opens (evidence: `README.md`)
- App Shell → Browse Titles: presents (evidence: `README.md`)
- Learner → Browse Titles: browses (evidence: `README.md`)
- Browse Titles → Title Search: searches titles
- Title Search → TMDB: queries (evidence: `Sources/SubtitleCore/TMDBSearchService.swift`)
- Browse Titles → Show Catalog: manages shows (evidence: `README.md`)
- Show Catalog → Subtitle Fetch: loads subtitles
- Subtitle Fetch → OpenSubtitles: fetches (evidence: `README.md`)
- Subtitle Fetch → SRT Parsing: provides SRT
- Learner → Episode Learning: opens episode (evidence: `README.md`)
- Episode Learning → Transcript Analysis: analyzes transcript (evidence: `README.md`)
- Transcript Analysis → Chunk and Prompt: builds prompts (evidence: `Sources/SubtitleCore/FullTranscriptAnalysisPipeline.swift`)
- Transcript Analysis → LLM Routing: routes analysis (evidence: `Sources/SubtitleCore/FullTranscriptAnalysisPipeline.swift`)
- LLM Routing → Gemini Provider: tries Gemini (evidence: `Sources/SubtitleCore/LLMService.swift`)
- LLM Routing → Groq Provider: falls back (evidence: `Sources/SubtitleCore/LLMService.swift`)
- Transcript Analysis → Result Parser: parses responses (evidence: `Sources/SubtitleCore/FullTranscriptAnalysisPipeline.swift`)
- Result Parser → Episode Learning: returns learning data
- Episode Learning → Expression Lists: shows expressions (evidence: `README.md`)
- Episode Learning → Vocabulary Lists: shows vocabulary (evidence: `README.md`)
- Learner → Sentence Workbench: studies sentences (evidence: `README.md`)
- Sentence Workbench → Study Progress: tracks progress (evidence: `Sources/SubtitleCore/SentenceWorkbenchViewModel.swift`)
- Sentence Workbench → Speech Playback: plays sentences (evidence: `Sources/SubtitleCore/SentenceWorkbenchViewModel.swift`)
- Speech Playback → Gemini TTS: uses selected engine (evidence: `Sources/SubtitleCore/EnglishSpeechSynthesizer.swift`)
- Speech Playback → Voice Preferences: reads settings (evidence: `Sources/SubtitleCore/EnglishSpeechSynthesizer.swift`)
- Settings → Voice Preferences: updates voice (evidence: `Sources/SubtitleCore/SettingsView.swift`)
- Learner → Settings: configures app (evidence: `README.md`)
- Settings → Data Backup: exports data (evidence: `Sources/SubtitleCore/SettingsView.swift`)
- Data Backup → Study Progress: backs up (evidence: `Sources/SubtitleCore/SceneNoteDataBackup.swift`)
