# g2048/audiotools architecture

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

- Interactive diagram: https://gitdiagram.com/g2048/audiotools
- Repository: https://github.com/g2048/audiotools

## Overview

##### Main Components

A. Frontend Layer:
- Web UI Component (app/webui)
- Audio Pages (upload, converter, transcribe)
- Prompts Interface

B. Service Layer:
- Audio Service
- Email Service
- Upload Service
- AWS Integration

C. External Services:
- Whisper AI Model
- AWS S3 Buckets
- Email Service Provider

**[User Interface Layer]**

**[Service Layer]**

**[External Services/Storage Layer]**

##### Component Relationships

- User Interface → Audio Service (for transcription requests)
- Audio Service → Whisper AI Model (for processing)
- Upload Service → AWS S3 (for file storage)
- Email Service → Email Provider (for notifications)

##### Specific Implementation Details

A. UI Layer (Blue):
- [Web UI Container]
- Audio Upload Page
- Audio Converter
- Transcription Page

B. Service Layer (Green):
- [Core Services]
- Audio Processing Service
- Upload Service
- Email Service
- AWS Integration Service

C. External Services (Yellow):
- [External Components]
- Whisper AI Model
- AWS S3 Buckets
- Email Provider

##### Additional Elements

Include:
- Configuration components (app/configs)
- Environment variables
- Docker container boundaries
- API interfaces (app/services/interfaces.py)

##### Technical Stack Callouts

Technologies:
- Docker/Docker Compose
- Python
- Whisper AI
- AWS Services

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef service fill:#2ecc71,stroke:#27ae60,color:white
    classDef external fill:#f1c40f,stroke:#f39c12,color:black
    classDef config fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef storage fill:#e74c3c,stroke:#c0392b,color:white
    classDef future stroke-dasharray: 5 5

    %% Main Layers
    subgraph UI["User Interface Layer"]
        WebUI["Web UI Component"]
        AudioPages["Audio Pages"]
        Prompts["Prompts Interface"]
        
        subgraph Pages
            Upload["Upload Page"]
            Convert["Converter Page"]
            Transcribe["Transcribe Page"]
        end
    end

    subgraph Services["Service Layer"]
        AudioService["Audio Service"]
        EmailService["Email Service"]
        UploadService["Upload Service"]
        AWSIntegration["AWS Integration"]
        ServiceInterfaces["Service Interfaces"]
    end

    subgraph External["External Services"]
        WhisperAI["Whisper AI Model"]
        S3["AWS S3 Buckets"]
        EmailProvider["Email Provider"]
    end

    subgraph Config["Configuration"]
        Settings["Settings"]
        LogConfig["Logging Config"]
        EnvVars["Environment Variables"]
        Docker["Docker Config"]
    end

    %% Future Components
    TelegramBot["Telegram Bot"]:::future
    AIService["AI Transcription Service"]:::future
    MessageBroker["Message Broker"]:::future
    TTS["Text-to-Speech"]:::future

    %% Relationships
    WebUI --> AudioPages
    AudioPages --> Upload
    AudioPages --> Convert
    AudioPages --> Transcribe
    WebUI --> Prompts
    
    Upload --> UploadService
    Convert --> AudioService
    Transcribe --> AudioService
    
    AudioService --> WhisperAI
    UploadService --> S3
    EmailService --> EmailProvider
    AWSIntegration --> S3
    
    ServiceInterfaces --> AudioService
    ServiceInterfaces --> EmailService
    ServiceInterfaces --> UploadService
    
    %% Click Events
    click WebUI "https://github.com/G2048/AudioTools/blob/master/app/webui/webui.py"
    click Upload "https://github.com/G2048/AudioTools/blob/master/app/webui/pages/audio/upload.py"
    click Convert "https://github.com/G2048/AudioTools/blob/master/app/webui/pages/audio/converter.py"
    click Transcribe "https://github.com/G2048/AudioTools/blob/master/app/webui/pages/audio/transcribe.py"
    click Prompts "https://github.com/G2048/AudioTools/blob/master/app/webui/pages/prompts.py"
    click AudioService "https://github.com/G2048/AudioTools/blob/master/app/services/audio.py"
    click EmailService "https://github.com/G2048/AudioTools/blob/master/app/services/emails.py"
    click UploadService "https://github.com/G2048/AudioTools/blob/master/app/services/uploader.py"
    click ServiceInterfaces "https://github.com/G2048/AudioTools/blob/master/app/services/interfaces.py"
    click AWSIntegration "https://github.com/G2048/AudioTools/blob/master/app/aws/base.py"
    click S3 "https://github.com/G2048/AudioTools/blob/master/app/aws/buckets.py"
    click Settings "https://github.com/G2048/AudioTools/blob/master/app/configs/settings.py"
    click LogConfig "https://github.com/G2048/AudioTools/blob/master/app/configs/log_settings.py"
    click EnvVars "https://github.com/G2048/AudioTools/blob/master/.env.example"
    click Docker "https://github.com/G2048/AudioTools/blob/master/docker-compose.yaml"

    %% Style Applications
    class WebUI,AudioPages,Upload,Convert,Transcribe,Prompts ui
    class AudioService,EmailService,UploadService,AWSIntegration,ServiceInterfaces service
    class WhisperAI,S3,EmailProvider external
    class Settings,LogConfig,EnvVars,Docker config
    class TelegramBot,AIService,MessageBroker,TTS future
```
