# shraf2004/polyglot-note-taker architecture

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

- Interactive diagram: https://gitdiagram.com/shraf2004/polyglot-note-taker
- Repository: https://github.com/shraf2004/polyglot-note-taker

## Overview

Polyglot Note-Taker is a Chrome side-panel extension for transforming pasted text into study aids and finding related references, with a separate live proofreading feature for editable fields on webpages. The main workflow runs from the side-panel controls through local summarization, translation, notes, quizzes, or source lookup, then saves results and history in Chrome storage. The README documents these capabilities, while excerpts show key implementations. Options-page behavior and manifest wiring were not sampled, so they are not mapped.

Main entry points: [`popup.js`](https://github.com/shraf2004/polyglot-note-taker/blob/main/popup.js) (Study actions), [`background.js`](https://github.com/shraf2004/polyglot-note-taker/blob/main/background.js) (Panel activation), [`popup.html`](https://github.com/shraf2004/polyglot-note-taker/blob/main/popup.html) (Study controls), [`content_script.js`](https://github.com/shraf2004/polyglot-note-taker/blob/main/content_script.js) (Proofreading and suggestions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_panel["Side-panel study workspace"]
  node_background["Panel activation<br/>[background.js]"]
  node_panel_ui["Study controls<br/>[popup.html]"]
  node_study["Study actions<br/>[popup.js]"]
  node_summary["Summarization<br/>[popup.js]"]
  node_translation["Translation<br/>[popup.js]"]
  node_notes["Study notes<br/>[popup.js]"]
  node_quiz["Recall quiz<br/>[popup.js]"]
  node_state[("Saved state and history<br/>[popup.js]")]
end

subgraph group_references["Reference lookup"]
  node_source_lookup["Source lookup<br/>[popup.js]"]
  node_crossref["Crossref API"]
  node_wikipedia["Wikipedia API"]
end

subgraph group_proofreading["Page proofreading"]
  node_proofreader["Proofreading and suggestions<br/>[content_script.js]"]
end

node_user(("Extension user"))
node_chrome["Chrome side panel"]
node_local_models["Browser language models"]
node_editable_page["Editable webpage fields"]

node_user -->|"opens extension"| node_chrome
node_chrome -->|"activates panel"| node_background
node_background -->|"configures panel"| node_chrome
node_user -->|"enters text"| node_panel_ui
node_panel_ui -->|"triggers actions"| node_study
node_study -->|"summarizes text"| node_summary
node_study -->|"translates text"| node_translation
node_study -->|"creates notes"| node_notes
node_study -->|"creates quiz"| node_quiz
node_summary -.->|"uses when available"| node_local_models
node_translation -.->|"uses when available"| node_local_models
node_notes -.->|"uses when available"| node_local_models
node_quiz -.->|"uses when available"| node_local_models
node_study -->|"saves and restores"| node_state
node_study -->|"finds references"| node_source_lookup
node_source_lookup -->|"fetches papers"| node_crossref
node_source_lookup -->|"fetches articles"| node_wikipedia
node_editable_page -->|"checks editable text"| node_proofreader

click node_background "https://github.com/shraf2004/polyglot-note-taker/blob/main/background.js"
click node_panel_ui "https://github.com/shraf2004/polyglot-note-taker/blob/main/popup.html"
click node_study "https://github.com/shraf2004/polyglot-note-taker/blob/main/popup.js"
click node_summary "https://github.com/shraf2004/polyglot-note-taker/blob/main/popup.js"
click node_translation "https://github.com/shraf2004/polyglot-note-taker/blob/main/popup.js"
click node_notes "https://github.com/shraf2004/polyglot-note-taker/blob/main/popup.js"
click node_quiz "https://github.com/shraf2004/polyglot-note-taker/blob/main/popup.js"
click node_state "https://github.com/shraf2004/polyglot-note-taker/blob/main/popup.js"
click node_source_lookup "https://github.com/shraf2004/polyglot-note-taker/blob/main/popup.js"
click node_proofreader "https://github.com/shraf2004/polyglot-note-taker/blob/main/content_script.js"

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_background,node_panel_ui,node_study,node_summary,node_translation,node_notes,node_quiz,node_state,node_user,node_local_models toneBlue
class node_source_lookup,node_crossref,node_wikipedia toneAmber
class node_proofreader toneMint
class node_chrome,node_editable_page toneIndigo
```

## Components

### Side-panel study workspace

- [Panel activation](https://github.com/shraf2004/polyglot-note-taker/blob/main/background.js): `background.js`
- [Study controls](https://github.com/shraf2004/polyglot-note-taker/blob/main/popup.html): `popup.html`
- [Study actions](https://github.com/shraf2004/polyglot-note-taker/blob/main/popup.js): `popup.js`
- [Summarization](https://github.com/shraf2004/polyglot-note-taker/blob/main/popup.js): `popup.js`
- [Translation](https://github.com/shraf2004/polyglot-note-taker/blob/main/popup.js): `popup.js`
- [Study notes](https://github.com/shraf2004/polyglot-note-taker/blob/main/popup.js): `popup.js`
- [Recall quiz](https://github.com/shraf2004/polyglot-note-taker/blob/main/popup.js): `popup.js`
- [Saved state and history](https://github.com/shraf2004/polyglot-note-taker/blob/main/popup.js): `popup.js`

### Reference lookup

- [Source lookup](https://github.com/shraf2004/polyglot-note-taker/blob/main/popup.js): `popup.js`
- **Crossref API**
- **Wikipedia API**

### Page proofreading

- [Proofreading and suggestions](https://github.com/shraf2004/polyglot-note-taker/blob/main/content_script.js): `content_script.js`

### Other components

- **Extension user**
- **Chrome side panel**
- **Browser language models**
- **Editable webpage fields**

## Connections

- Extension user → Chrome side panel: opens extension (evidence: `README.md`)
- Chrome side panel → Panel activation: activates panel (evidence: `background.js`)
- Panel activation → Chrome side panel: configures panel (evidence: `background.js`)
- Extension user → Study controls: enters text (evidence: `README.md`)
- Study controls → Study actions: triggers actions (evidence: `popup.js`)
- Study actions → Summarization: summarizes text (evidence: `popup.js`)
- Study actions → Translation: translates text (evidence: `popup.js`)
- Study actions → Study notes: creates notes (evidence: `README.md`)
- Study actions → Recall quiz: creates quiz (evidence: `README.md`)
- Summarization → Browser language models: uses when available (evidence: `popup.js`)
- Translation → Browser language models: uses when available (evidence: `popup.js`)
- Study notes → Browser language models: uses when available (evidence: `README.md`)
- Recall quiz → Browser language models: uses when available (evidence: `README.md`)
- Study actions → Saved state and history: saves and restores (evidence: `popup.js`)
- Study actions → Source lookup: finds references (evidence: `popup.js`)
- Source lookup → Crossref API: fetches papers (evidence: `popup.js`)
- Source lookup → Wikipedia API: fetches articles (evidence: `popup.js`)
- Editable webpage fields → Proofreading and suggestions: checks editable text (evidence: `content_script.js`)
