# muzanxdem/video-summarizer architecture

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

- Interactive diagram: https://gitdiagram.com/muzanxdem/video-summarizer
- Repository: https://github.com/muzanxdem/video-summarizer

## Overview

##### Project Type & Purpose
- Type: Single-page Streamlit app (monolithic full-stack), primarily Python.
- Purpose: Let users supply a YouTube URL or upload video files, then transcribe (Whisper), analyze (keywords/word cloud), summarize (Ollama Llama3.2), and answer questions.

##### File Structure
- Top-level scripts:
- app.py / app01.py – Streamlit front end and orchestrator
- pipeline.py / pipeline1.py – Core processing logic (audio extraction, transcription, keyword analysis, summarization, Q&A)
- requirements.txt – Dependencies (streamlit, openai, pytube/youtube-dl, matplotlib/wordcloud, ollama SDK)
- No dedicated “frontend” or “backend” folders – logic is co-located in Python scripts.
- No persistent database – intermediate data held in memory or temp files.

##### Extract Insights from README
- Architecture is not explicitly documented but implied:
- UI Component (Streamlit)
- Processing Pipeline
- External AI Services (OpenAI Whisper API, Ollama Llama3.2)
- Visualization modules (matplotlib, wordcloud)
- No on-premise services beyond local Python runtime.

##### Diagramming Recommendations
- UI components (e.g., blue)
- Processing modules (e.g., green)
- External services (e.g., orange)
- Storage buffers (e.g., gray)
- Rectangles for modules
- Clouds for external APIs

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User and UI Layer
    User["User"]:::ui
    UI["Streamlit UI\n(app.py)"]:::ui
    User -->|"interacts with"| UI
    click UI "https://github.com/muzanxdem/video-summarizer/blob/main/app.py"

    %% Input Handler
    VideoFetcher["Video Fetcher\n(pytube/ffmpeg)"]:::process
    UI -->|"provides URL/file"| VideoFetcher
    click VideoFetcher "https://github.com/muzanxdem/video-summarizer/blob/main/pipeline.py"

    %% Temporary Storage
    Storage["In-Memory Buffers\n/ Temp Files"]:::storage

    %% Processing Pipeline
    Transcription["Transcription Module\n(OpenAI Whisper)"]:::process
    VideoFetcher -->|"audio stream"| Transcription
    click Transcription "https://github.com/muzanxdem/video-summarizer/blob/main/pipeline.py"

    NLP["NLP Module\n(keyword extraction & stopword filtering)"]:::process
    Transcription -->|"transcription text"| NLP
    click NLP "https://github.com/muzanxdem/video-summarizer/blob/main/pipeline.py"

    Visualization["Visualization Module\n(bar chart & word cloud)"]:::process
    NLP -->|"keywords"| Visualization
    click Visualization "https://github.com/muzanxdem/video-summarizer/blob/main/pipeline.py"

    Summarization["Summarization Module\n(Ollama Llama3.2)"]:::process
    Transcription -->|"transcription text"| Summarization
    click Summarization "https://github.com/muzanxdem/video-summarizer/blob/main/pipeline.py"

    QA["Q&A Module\n(context window + LLM)"]:::process
    Transcription -->|"text context"| QA
    User -->|"query"| QA
    click QA "https://github.com/muzanxdem/video-summarizer/blob/main/pipeline.py"

    %% External Services
    WhisperAPI["OpenAI Whisper API"]:::external
    OllamaAPI["Ollama Llama3.2"]:::external
    Transcription -->|"API call"| WhisperAPI
    Summarization -->|"API call"| OllamaAPI
    QA -->|"API call"| OllamaAPI

    %% Presentation Layer Outputs
    Visualization -->|"charts/word cloud"| UI
    Summarization -->|"summary text"| UI
    QA -->|"answers"| UI

    %% Dependencies
    Requirements["requirements.txt"]:::storage
    click Requirements "https://github.com/muzanxdem/video-summarizer/blob/main/requirements.txt"

    %% Storage usage
    VideoFetcher --> Storage
    Transcription --> Storage

    classDef ui fill:#D6EAF8,stroke:#2E86C1,color:#1B4F72
    classDef process fill:#D5F5E3,stroke:#27AE60,color:#145A32
    classDef external fill:#F9E79F,stroke:#D68910,color:#7D6608
    classDef storage fill:#E5E7E9,stroke:#ABB2B9,color:#566573
```
