# samu4803/pesu_slides_extractor architecture

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

- Interactive diagram: https://gitdiagram.com/samu4803/pesu_slides_extractor
- Repository: https://github.com/samu4803/pesu_slides_extractor

## Overview

This Chrome extension finds slide documents on the active PES Academy course page, then lets the user download them individually or together, or merge PDFs into one file. The principal flow runs from the popup through the content script’s page scan and link lookup, back to popup actions. The README documents the download-and-merge goal; source excerpts clarify these stages and their ownership.

Main entry points: [`popup.js`](https://github.com/samu4803/pesu_slides_extractor/blob/main/popup.js) (Popup controller), [`content.js`](https://github.com/samu4803/pesu_slides_extractor/blob/main/content.js) (Page scanner), [`index.html`](https://github.com/samu4803/pesu_slides_extractor/blob/main/index.html) (Popup UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_page["Page discovery"]
  node_content_script["Page scanner<br/>[content.js]"]
  node_slide_links["Extracted slide links<br/>[content.js]"]
end

subgraph group_popup["Popup workflow"]
  node_popup_ui["Popup UI<br/>[index.html]"]
  node_popup_logic["Popup controller<br/>[popup.js]"]
  node_link_list["Download list<br/>[popup.js]"]
end

subgraph group_output["File output"]
  node_pdf_lib["PDFLib"]
  node_merged_pdf["Merged PDF<br/>[popup.js]"]
end

node_student(("Student"))
node_course_page["PES course page"]
node_pes_portal["PES document service"]
node_download_service["Browser downloads"]

node_student -->|"opens"| node_popup_ui
node_popup_logic -->|"messages"| node_content_script
node_content_script -->|"reads page"| node_course_page
node_content_script -->|"requests links"| node_pes_portal
node_content_script -->|"extracts"| node_slide_links
node_content_script -->|"returns links"| node_popup_logic
node_popup_logic -->|"renders"| node_link_list
node_popup_logic -->|"fetches files"| node_pes_portal
node_popup_logic -->|"triggers downloads"| node_download_service
node_popup_logic -->|"loads and merges"| node_pdf_lib
node_pdf_lib -->|"serializes"| node_merged_pdf
node_popup_logic -->|"downloads merged PDF"| node_download_service

click node_popup_ui "https://github.com/samu4803/pesu_slides_extractor/blob/main/index.html"
click node_popup_logic "https://github.com/samu4803/pesu_slides_extractor/blob/main/popup.js"
click node_content_script "https://github.com/samu4803/pesu_slides_extractor/blob/main/content.js"
click node_slide_links "https://github.com/samu4803/pesu_slides_extractor/blob/main/content.js"
click node_link_list "https://github.com/samu4803/pesu_slides_extractor/blob/main/popup.js"
click node_merged_pdf "https://github.com/samu4803/pesu_slides_extractor/blob/main/popup.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_content_script,node_slide_links,node_download_service toneBlue
class node_popup_ui,node_popup_logic,node_link_list toneAmber
class node_pdf_lib,node_merged_pdf toneMint
class node_student,node_course_page,node_pes_portal toneIndigo
```

## Components

### Page discovery

- [Page scanner](https://github.com/samu4803/pesu_slides_extractor/blob/main/content.js): `content.js`
- [Extracted slide links](https://github.com/samu4803/pesu_slides_extractor/blob/main/content.js): `content.js`

### Popup workflow

- [Popup UI](https://github.com/samu4803/pesu_slides_extractor/blob/main/index.html): `index.html`
- [Popup controller](https://github.com/samu4803/pesu_slides_extractor/blob/main/popup.js): `popup.js`
- [Download list](https://github.com/samu4803/pesu_slides_extractor/blob/main/popup.js): `popup.js`

### File output

- **PDFLib**
- [Merged PDF](https://github.com/samu4803/pesu_slides_extractor/blob/main/popup.js): `popup.js`

### Other components

- **Student**
- **PES course page**
- **PES document service**
- **Browser downloads**

## Connections

- Student → Popup UI: opens
- Popup controller → Page scanner: messages
- Page scanner → PES course page: reads page
- Page scanner → PES document service: requests links
- Page scanner → Extracted slide links: extracts
- Page scanner → Popup controller: returns links
- Popup controller → Download list: renders
- Popup controller → PES document service: fetches files
- Popup controller → Browser downloads: triggers downloads
- Popup controller → PDFLib: loads and merges
- PDFLib → Merged PDF: serializes
- Popup controller → Browser downloads: downloads merged PDF
