# harry3602/youtube-transcript-summarizer architecture

> Architecture diagram of the GitHub repository harry3602/youtube-transcript-summarizer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harry3602/youtube-transcript-summarizer
- Repository: https://github.com/harry3602/youtube-transcript-summarizer

## Overview

##### Project type and purpose
- From the file tree and README, this is a two-part system:
- A browser extension (“extension/” directory with manifest.json, popup.html/css/js)
- A lightweight Python web service (app.py + requirements.txt)
- Purpose: let a user click the extension’s popup on any YouTube page, send the current video’s transcript to the Python service for summarization, then display the summary back in the popup.

##### File structure
- Top-level files:
- README.md – project name/description
- app.py – the Flask (or similar) server entry point
- requirements.txt – Python dependencies (Flask, YouTube API client, NLP libraries, etc.)
- “extension/” directory:
- manifest.json – Chrome extension metadata
- popup.html, popup.css, popup.js – UI and logic for the extension’s popup window
- No database directory suggests a stateless service; likely uses external APIs or in-memory processing.

##### README for additional insights
- The title “Youtube-transcript-summarizer” implies workflow:
1. Fetch transcript (via YouTube API or scraping)
2. Summarize (via local NLP library or external service like OpenAI)
- No further architecture details provided, so infer based on code layout.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Extension Layer
    subgraph "Chrome Extension"
        direction TB
        Manifest["Manifest (manifest.json)"]:::frontend
        PopupUI["Popup UI (popup.html)"]:::frontend
        PopupStyle["Popup Styles (popup.css)"]:::frontend
        PopupCtrl["Popup Controller (popup.js)"]:::frontend
        StaticAssets["Static Assets (images/)"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Service"
        direction TB
        FlaskApp["Flask App (app.py)"]:::backend
        Fetcher["Transcript Fetcher"]:::backend
        SummarizerModule["Summarizer Module"]:::backend
        Requirements["requirements.txt"]:::backend
    end

    %% External Services
    subgraph "External Services"
        direction TB
        YouTubeAPI["YouTube Data API"]:::external
        NLPService["NLP/Summarizer Engine"]:::external
    end

    %% Documentation
    README["README.md"]:::documentation

    %% Interactions
    PopupUI -->|"user click"| PopupCtrl
    PopupCtrl -->|"POST video ID JSON"| FlaskApp
    FlaskApp -->|"invoke fetcher"| Fetcher
    Fetcher -->|"GET transcript JSON"| YouTubeAPI
    YouTubeAPI -->|"transcript text"| Fetcher
    Fetcher -->|"return transcript text"| FlaskApp
    FlaskApp -->|"invoke summarizer"| SummarizerModule
    SummarizerModule -->|"summarize"| NLPService
    NLPService -->|"summary text"| SummarizerModule
    SummarizerModule -->|"return summary text"| FlaskApp
    FlaskApp -->|"200 OK + summary JSON"| PopupCtrl
    PopupCtrl -->|"render summary"| PopupUI

    %% Click Events
    click Manifest "https://github.com/harry3602/youtube-transcript-summarizer/blob/main/extension/manifest.json"
    click PopupUI "https://github.com/harry3602/youtube-transcript-summarizer/blob/main/extension/popup.html"
    click PopupStyle "https://github.com/harry3602/youtube-transcript-summarizer/blob/main/extension/popup.css"
    click PopupCtrl "https://github.com/harry3602/youtube-transcript-summarizer/blob/main/extension/popup.js"
    click StaticAssets "https://github.com/harry3602/youtube-transcript-summarizer/tree/main/extension/images/"
    click FlaskApp "https://github.com/harry3602/youtube-transcript-summarizer/blob/main/app.py"
    click Requirements "https://github.com/harry3602/youtube-transcript-summarizer/blob/main/requirements.txt"
    click README "https://github.com/harry3602/youtube-transcript-summarizer/blob/main/README.md"

    %% Styles
    classDef frontend fill:#7FB3D5,stroke:#1F618D,stroke-width:1px
    classDef backend fill:#82E0AA,stroke:#196F3D,stroke-width:1px
    classDef external fill:#F5B041,stroke:#B9770E,stroke-width:1px
    classDef documentation fill:#D5DBDB,stroke:#7D7D7D,stroke-width:1px
```
