# yarivtch/hebrew-audio-transcription architecture

> Architecture diagram of the GitHub repository yarivtch/hebrew-audio-transcription, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yarivtch/hebrew-audio-transcription
- Repository: https://github.com/yarivtch/hebrew-audio-transcription

## Overview

##### Main Components

A. Client-Side Components (Blue Group):
- Web Client
- HTML/CSS/JavaScript implementation
- Web Audio API for format conversion
- Upload interface
- Chat-style UI
- Chrome Extension
- Popup interface
- Extension-specific logic

B. Server-Side Components (Green Group):
- Flask Server
- Transcription Service (Faster Whisper Model)
- Audio Processing Pipeline

C. External Services/Dependencies (Purple Group):
- Faster Whisper Model (`ivrit-ai/faster-whisper-v2-d4`)
- Google Fonts Service

**[User Devices] → [Client Layer] → [Server Layer] → [ML Model Layer]**

##### Component Relationships

- Audio file upload flow: Client → Server
- Transcription request flow: Server → ML Model
- Response flow: ML Model → Server → Client
- Format conversion flow (within client)

B. Key Interactions:
- Client-side audio format conversion
- Server-side file validation
- Model processing pipeline
- Response handling and display

##### Technical Details

A. Client Layer:
- Web Audio API
- File upload handling
- RTL support
- Responsive design elements

B. Server Layer:
- Flask endpoints
- CORS handling
- Error management
- File processing pipeline

C. ML Model Layer:
- Faster Whisper implementation
- Audio processing components
- Hebrew language optimization

##### Specific Implementation Notes

- Rectangles: Main components
- Hexagons: External services
- Rounded rectangles: User interfaces

- Blue: Client-side components
- Green: Server-side components
- Purple: External services
- Orange: Security/validation layers

- Annotations for:
- Supported file formats
- Security measures
- Performance optimization points
- Scalability considerations

##### Additional Elements

- Version information for key components
- Future improvement areas (from README)
- Security checkpoints
- Error handling paths

##### Technical Specifications

- Minimum system requirements
- Technology versions
- API endpoints
- Supported audio formats
- Performance bottlenecks

Remember to include a separate view for the deployment architecture, showing how the application is deployed using the render.yaml configuration.

This system design should emphasize the unique aspects of Hebrew language processing and audio handling while maintaining clarity about the application's core functionality and component interactions.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "User Layer"
        User[User]
        Browser[Web Browser]
        ChromeExt[Chrome Extension]:::client
    end

    subgraph "Client Layer"
        WebClient[Web Client Interface]:::client
        ClientLogic[Client-Side Logic]:::client
        ClientUI[Client Styling/UI]:::client
        ExtUI[Extension UI]:::client
        ExtLogic[Extension Logic]:::client
        ExtConfig[Extension Config]:::client
        WebAudioAPI[Web Audio API]:::client
    end

    subgraph "Server Layer"
        FlaskServer[Flask Server]:::server
        AudioProcessor[Audio Processing Pipeline]:::server
        ServerDeps[Server Dependencies]:::server
    end

    subgraph "ML Model Layer"
        WhisperModel[Faster Whisper Model]:::external
        AudioProcessing[Audio Processing Components]:::external
    end

    subgraph "Deployment"
        DeployConfig[Deployment Configuration]:::deploy
        DeployScript[Deployment Script]:::deploy
    end

    %% Relationships
    User --> Browser
    User --> ChromeExt
    Browser --> WebClient
    ChromeExt --> ExtUI
    ExtUI --> ExtLogic
    ExtLogic --> ExtConfig
    WebClient --> ClientLogic
    WebClient --> ClientUI
    ClientLogic --> WebAudioAPI
    WebAudioAPI --> FlaskServer
    ExtLogic --> FlaskServer
    FlaskServer --> AudioProcessor
    AudioProcessor --> WhisperModel
    WhisperModel --> AudioProcessing
    AudioProcessing --> FlaskServer
    FlaskServer --> ServerDeps
    DeployConfig --> FlaskServer
    DeployScript --> DeployConfig

    %% Click Events
    click WebClient "https://github.com/yarivtch/hebrew-audio-transcription/blob/main/client/index.html"
    click ClientLogic "https://github.com/yarivtch/hebrew-audio-transcription/blob/main/client/scripts.js"
    click ClientUI "https://github.com/yarivtch/hebrew-audio-transcription/blob/main/client/styles.css"
    click ExtUI "https://github.com/yarivtch/hebrew-audio-transcription/blob/main/chrome-extension/popup.html"
    click ExtLogic "https://github.com/yarivtch/hebrew-audio-transcription/blob/main/chrome-extension/popup.js"
    click ExtConfig "https://github.com/yarivtch/hebrew-audio-transcription/blob/main/chrome-extension/manifest.json"
    click FlaskServer "https://github.com/yarivtch/hebrew-audio-transcription/blob/main/server/server.py"
    click ServerDeps "https://github.com/yarivtch/hebrew-audio-transcription/blob/main/server/requirements.txt"
    click DeployConfig "https://github.com/yarivtch/hebrew-audio-transcription/blob/main/render.yaml"
    click DeployScript "https://github.com/yarivtch/hebrew-audio-transcription/blob/main/deploy.sh"

    %% Styles
    classDef client fill:#a8d1ff,stroke:#333,stroke-width:2px
    classDef server fill:#90EE90,stroke:#333,stroke-width:2px
    classDef external fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef deploy fill:#FFA500,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        ClientComp[Client Components]:::client
        ServerComp[Server Components]:::server
        ExternalComp[External Services]:::external
        DeployComp[Deployment Components]:::deploy
    end
```
