# owulveryck/gptslideshow architecture

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

- Interactive diagram: https://gitdiagram.com/owulveryck/gptslideshow
- Repository: https://github.com/owulveryck/gptslideshow

## Overview

##### Main Components Identification

a) Client Layer:
- Command-line interface (main.go)
- Configuration handling (config/)
- Flag parsing (flags.go)

b) Service Layer:
- AI Services Integration (internal/ai/)
- Google Services Integration (internal/gcputils/)
- Slides Processing (internal/slidesutils/)
- Drive Operations (internal/driveutils/)
- Content Upload Services (internal/uploader/)

c) External Services:
- Google Slides API
- Google Drive API
- OpenAI API
- Vertex AI
- Ollama
- Ngrok (for uploads)

##### Flow Representation

a) Primary Flow:
- Input → Authentication → AI Processing → Slides Processing → Google APIs

b) Secondary Flows:
- Template handling flow
- Image generation flow
- PDF export flow
- Content upload flow

##### Technical Details

Create annotations showing:
- Go version requirement (1.21+)
- API dependencies
- Configuration requirements
- Environment variables

##### Component Relationships

Key interactions:
- Content processing pipeline
- Template management
- Authentication flow
- Resource management

- User interaction layer
- Core processing layer
- External services layer
- Storage and persistence layer

- Component types
- Integration points

This will provide a clear understanding of how the system processes content from input through AI processing to final slide generation, while showing the integration points with external services and the authentication mechanisms required for secure operation.

Remember to emphasize the modular nature of the system, particularly the separation between different AI providers and the extensibility of the template system.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        MD[Markdown Files]
        AF[Audio Files]
        CLI[Command Line Interface]:::cli
    end

    subgraph Core
        CH[Configuration Handler]:::config
        FP[Flag Parser]:::parser
        
        subgraph "AI Processing"
            AIS[AI Service Interface]:::ai
            OAI[OpenAI Processor]:::ai
            VAI[Vertex AI Processor]:::ai
            OLA[Ollama Processor]:::ai
        end
        
        subgraph "Slides Processing"
            SPI[Slides Processing Interface]:::slides
            TH[Template Handler]:::slides
            CP[Content Parser]:::slides
            
            subgraph "Template System"
                COV[Cover Handler]:::template
                CHP[Chapter Handler]:::template
                CNT[Content Handler]:::template
                IMG[Image Handler]:::template
            end
        end
        
        subgraph "Storage Operations"
            DO[Drive Operations]:::drive
            PE[PDF Export]:::drive
            IU[Image Upload]:::drive
        end
        
        subgraph "Upload Services"
            UPI[Upload Interface]:::upload
            NGR[Ngrok Implementation]:::upload
        end
        
        AUTH[Authentication Module]:::auth
    end

    subgraph "External Services"
        GS[Google Slides API]:::external
        GD[Google Drive API]:::external
        OA[OpenAI API]:::external
        VA[Vertex AI]:::external
        OL[Ollama]:::external
        NG[Ngrok]:::external
    end

    CLI --> CH
    CLI --> FP
    CH --> AUTH
    FP --> AUTH
    
    AUTH --> AIS
    AIS --> OAI
    AIS --> VAI
    AIS --> OLA
    
    OAI --> OA
    VAI --> VA
    OLA --> OL
    
    AUTH --> SPI
    SPI --> TH
    SPI --> CP
    
    TH --> COV
    TH --> CHP
    TH --> CNT
    TH --> IMG
    
    SPI --> DO
    DO --> PE
    DO --> IU
    
    IU --> UPI
    UPI --> NGR
    NGR --> NG
    
    SPI --> GS
    DO --> GD

    %% Click Events
    click CLI "https://github.com/owulveryck/gptslideshow/blob/main/main.go"
    click CH "https://github.com/owulveryck/gptslideshow/blob/main/config/config.go"
    click FP "https://github.com/owulveryck/gptslideshow/blob/main/flags.go"
    click AIS "https://github.com/owulveryck/gptslideshow/blob/main/internal/ai/interface.go"
    click OAI "https://github.com/owulveryck/gptslideshow/blob/main/internal/ai/openai/ai.go"
    click VAI "https://github.com/owulveryck/gptslideshow/blob/main/internal/ai/vertexai/vertex.go"
    click OLA "https://github.com/owulveryck/gptslideshow/blob/main/internal/ai/ollama/ollama.go"
    click AUTH "https://github.com/owulveryck/gptslideshow/blob/main/internal/gcputils/google.go"
    click SPI "https://github.com/owulveryck/gptslideshow/blob/main/internal/slidesutils/interface.go"
    click TH "https://github.com/owulveryck/gptslideshow/blob/main/internal/slidesutils/mytemplate/slides_builder.go"
    click CP "https://github.com/owulveryck/gptslideshow/blob/main/internal/slidesutils/parser.go"
    click PE "https://github.com/owulveryck/gptslideshow/blob/main/internal/driveutils/export_pdf.go"
    click IU "https://github.com/owulveryck/gptslideshow/blob/main/internal/driveutils/upload_image.go"
    click UPI "https://github.com/owulveryck/gptslideshow/blob/main/internal/uploader/interface.go"
    click NGR "https://github.com/owulveryck/gptslideshow/blob/main/internal/uploader/ngrok/uploader.go"
    click COV "https://github.com/owulveryck/gptslideshow/blob/main/internal/slidesutils/mytemplate/cover.go"
    click CHP "https://github.com/owulveryck/gptslideshow/blob/main/internal/slidesutils/mytemplate/chapter.go"
    click CNT "https://github.com/owulveryck/gptslideshow/blob/main/internal/slidesutils/mytemplate/content.go"
    click IMG "https://github.com/owulveryck/gptslideshow/blob/main/internal/slidesutils/mytemplate/image.go"

    %% Styling
    classDef cli fill:#1f77b4
    classDef config fill:#1f77b4
    classDef parser fill:#1f77b4
    classDef ai fill:#9467bd
    classDef slides fill:#2ca02c
    classDef template fill:#2ca02c,stroke-dasharray: 5 5
    classDef drive fill:#ff7f0e
    classDef upload fill:#8c564b
    classDef auth fill:#e377c2
    classDef external fill:#7f7f7f,stroke-dasharray: 5 5
```
