# siddhesh-desai/slideai architecture

> Architecture diagram of the GitHub repository siddhesh-desai/slideai, 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/siddhesh-desai/slideai
- Repository: https://github.com/siddhesh-desai/slideai

## Overview

##### Project Type and Purpose
- SlideAI is a Google Apps Script–based web application that automates PowerPoint (Google Slides) creation.
- It exposes a simple HTML/JS UI (index.html) as a web app, runs server-side Apps Script (Code.gs), invokes OpenAI for text generation, Bing Search API for images, and Google Slides API to build/update the presentation.

##### File Structure
- Top level:
- README.md – project overview, architecture hints.
- images/ – static assets (logo & screenshots).
- lib/ – application code:
– index.html: client-side form for user inputs.
– Code.gs: Apps Script handlers, orchestrator.
- No separate “backend” folder: Apps Script code lives alongside UI in lib/.

##### Key Architecture Insights from README
- Technologies: Apps Script runtime, OpenAI API, Bing API, Google Slides API.
- Data flow: User inputs → Apps Script → external AI/image services → Slides API → updated presentation.
- Deployment: as an Apps Script web app, with a bound script project accessing Slides.

##### Main Components
a. Client Browser/UI (index.html)
b. Google Apps Script Runtime (Code.gs)
c. OpenAI API (text-generation service)
d. Bing Search API (image-retrieval service)
e. Google Slides API & Target Presentation (in Google Drive)

##### Architectural Patterns and Design Principles
- Serverless (Apps Script) orchestrator pattern
- External API façade: wrap OpenAI & Bing REST calls in helper functions
- Single-page input form + server callbacks (RPC over HTTPS)
- Separation of concerns: UI, orchestration, external services, and slide storage

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Side
    subgraph "Client Side"
        UI["Client: index.html"]:::frontend
    end

    %% Apps Script Runtime Boundary
    subgraph "Apps Script Runtime"
        AS["Apps Script: Code.gs"]:::backend
    end

    %% External Cloud Services
    subgraph "Cloud Services"
        OAI["OpenAI API"]:::external
        BING["Bing Search API"]:::external
        SLAPI["Google Slides API"]:::external
    end

    %% Persistence
    DB["Presentation Storage\n(Google Drive)"]:::db

    %% Data Flows
    UI -->|"submitPoints()"| AS
    AS -->|"generateText()"| OAI
    OAI -->|"text response"| AS
    AS -->|"searchImages()"| BING
    BING -->|"image URLs"| AS
    AS -->|"batchUpdate()"| SLAPI
    SLAPI -->|"update slide"| DB
    SLAPI -->|"response"| AS
    AS -->|"success"| UI

    %% Legend
    subgraph "Legend"
        LF["Frontend"]:::frontend
        LB["Backend"]:::backend
        LE["External"]:::external
        LD["Storage"]:::db
    end

    %% Click Events
    click UI "https://github.com/siddhesh-desai/slideai/blob/main/lib/index.html"
    click AS "https://github.com/siddhesh-desai/slideai/blob/main/lib/Code.gs"

    %% Styles
    classDef frontend fill:#cfe2ff,stroke:#007bff,color:#000;
    classDef backend fill:#d1e7dd,stroke:#0f5132,color:#000;
    classDef external fill:#ffe5b4,stroke:#ff8c00,color:#000;
    classDef db fill:#d1d1ff,stroke:#6f42c1,color:#000;
```
