# srinivas26k/zoom_poll_demo architecture

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

- Interactive diagram: https://gitdiagram.com/srinivas26k/zoom_poll_demo
- Repository: https://github.com/srinivas26k/zoom_poll_demo

## Overview

##### Project type and purpose
- This is a full-stack Python application (“Zoom Poll Automator”) combining:
- A Flask-based web interface (setup wizard and status pages)
- A CLI/daemon for continuous audio polling
- A modular “backend” that captures audio, transcribes it with Whisper, generates polls via LLaMA, and posts them to Zoom
- Purpose: Keep Zoom meetings engaging by automatically generating and posting context-aware polls in real time.

##### File structure
- Top-level scripts:
- app.py – Flask web server
- run.py / run_loop.py / cli.py – CLI entry-points for automated polling
- audio_capture.py – Captures live Zoom audio
- transcribe_whisper.py – Wrapper around OpenAI Whisper transcription
- poll_prompt.py – Constructs prompt for LLaMA
- poller.py – Orchestrates the end-to-end flow (capture → transcribe → prompt → Zoom API)
- config.py – Loads .env and centralizes configuration
- Assets & templates:
- templates/*.html – Frontend pages (setup, status, error)
- Tests & CI:
- tests/ – Unit, integration, performance, security tests
- pytest.ini, test-reports/ – Test configuration and output
- Setup & deployment:
- setup.sh/.bat, start.sh/.ps1/.bat – Installation and launch scripts
- requirements.txt, setup.py – Packaging and dependencies

##### Key insights from the README
- Core services: Zoom API, OpenAI Whisper, Ollama (LLaMA)
- Uses OAuth2 for Zoom integration, FFmpeg for audio capture
- Two user interfaces: Web (Flask) and CLI

- Zoom Meeting (Audio Stream)
- Audio Capture Module
- Transcription Service (OpenAI Whisper)
- Poll Generation Engine (LLaMA via Ollama)
- Zoom API Integration
- Configuration Store (.env via config.py)
- Web UI (Flask app.py + templates)
- CLI/Daemon (run.py, run_loop.py, cli.py)
- Logging & Error Handling
1. Zoom Meeting → Audio Capture
2. Audio Capture → Transcription Service
3. Transcription → Poll Generation
4. Generated Poll → Zoom API
5. Zoom API → Meeting (poll posted)
6. Web UI ↔ Configuration Store ↔ OAuth callback
7. CLI/Daemon invokes Poller (same backend modules)
8. All modules log to central error/log handler
c. Architectural patterns
- Modular “service-oriented monolith”: each step in its own module
- MVC-style separation in the Flask UI (templates vs. app logic)
- Single-responsibility: capture, transcribe, prompt, post are separate
d. Technologies & frameworks
- Python 3.8+
- Flask for web
- OpenAI Whisper (transcribe_whisper.py)
- Ollama/LLaMA for poll prompts via poll_prompt.py
- Zoom API (OAuth2 + REST calls in poller.py)
- FFmpeg for raw audio capture
- Pytest for testing

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Presentation Layer"
        WebUI["Flask Web UI"]:::ui
        CLI["CLI / Daemon"]:::ui
    end

    subgraph "Configuration"
        Config["Configuration Store (.env)"]:::config
    end

    subgraph "Backend Processing"
        Audio["Audio Capture Module"]:::internal
        Transcribe["Transcription Service"]:::internal
        Prompt["Poll Generation Engine"]:::internal
        Poller["Zoom API Integration & Orchestration"]:::internal
        Log["Logging & Error Handling"]:::internal
    end

    subgraph "External Services"
        ZoomMeeting["Zoom Meeting (Audio Stream)"]:::external
        Whisper["OpenAI Whisper"]:::external
        Ollama["Ollama (LLaMA)"]:::external
        ZoomAPI["Zoom API"]:::external
    end

    subgraph "Testing & CI"
        Tests["tests/"]:::test
        PyTestIni["pytest.ini"]:::test
        TestReports["test-reports/"]:::test
    end

    %% Data Flow
    ZoomMeeting -->|"audio stream"| Audio
    Audio -->|"audio stream"| Transcribe
    Transcribe -->|"transcript text"| Prompt
    Prompt -->|"poll JSON"| Poller
    Poller -->|"post poll"| ZoomAPI
    ZoomAPI -->|"poll posted"| ZoomMeeting

    %% Presentation & Config
    Config -->|reads/writes| WebUI
    Config -->|reads| CLI
    WebUI <-->|"OAuth2 & setup"| Config

    CLI -->|"invoke Poller"| Poller

    %% Logging
    Audio --> Log
    Transcribe --> Log
    Prompt --> Log
    Poller --> Log
    WebUI --> Log
    CLI --> Log

    %% Testing & CI
    Tests --> PyTestIni
    Tests --> TestReports

    %% Click Events
    click WebUI "https://github.com/srinivas26k/zoom_poll_demo/blob/main/app.py"
    click WebUI "https://github.com/srinivas26k/zoom_poll_demo/tree/main/templates/"
    click CLI "https://github.com/srinivas26k/zoom_poll_demo/blob/main/cli.py"
    click CLI "https://github.com/srinivas26k/zoom_poll_demo/blob/main/run.py"
    click CLI "https://github.com/srinivas26k/zoom_poll_demo/blob/main/run_loop.py"
    click Audio "https://github.com/srinivas26k/zoom_poll_demo/blob/main/audio_capture.py"
    click Transcribe "https://github.com/srinivas26k/zoom_poll_demo/blob/main/transcribe_whisper.py"
    click Prompt "https://github.com/srinivas26k/zoom_poll_demo/blob/main/poll_prompt.py"
    click Poller "https://github.com/srinivas26k/zoom_poll_demo/blob/main/poller.py"
    click Config "https://github.com/srinivas26k/zoom_poll_demo/blob/main/config.py"
    click Tests "https://github.com/srinivas26k/zoom_poll_demo/tree/main/tests/"
    click PyTestIni "https://github.com/srinivas26k/zoom_poll_demo/blob/main/pytest.ini"
    click TestReports "https://github.com/srinivas26k/zoom_poll_demo/tree/main/test-reports/"

    %% Styles
    classDef ui fill:#FFA500,stroke:#333,stroke-width:1px
    classDef internal fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef external fill:#90EE90,stroke:#333,stroke-width:1px
    classDef config fill:#FFFF99,stroke:#333,stroke-width:1px
    classDef test fill:#DDA0DD,stroke:#333,stroke-width:1px
```
