# laravelgpt/ai-storyboard-generator architecture

> Architecture diagram of the GitHub repository laravelgpt/ai-storyboard-generator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/laravelgpt/ai-storyboard-generator
- Repository: https://github.com/laravelgpt/ai-storyboard-generator

## Overview

##### Project type and purpose
- This is a single‐page, front-end web application built with React, TypeScript, and Vite.
- Its purpose is to let end users type a text description and generate a storyboard via Google’s Gemini AI API.

##### File structure
- Top-level entrypoints:
- index.html – host page for the SPA
- index.tsx & App.tsx – React bootstrapping and root application component
- UI layer:
- components/LoadingSpinner.tsx
- components/SceneCard.tsx
- Service layer:
- services/geminiService.ts – encapsulates calls to the external Gemini API, handling authentication via the VITE_GEMINI_API_KEY env var
- Configuration and build:
- vite.config.ts – Vite build/dev server config
- tsconfig.json – TypeScript compiler settings
- package.json / package-lock.json – dependencies (React, Vite, TypeScript, etc.)
- Other:
- types.ts – shared TypeScript interfaces and types
- metadata.json – (presumably) static metadata for the app’s configuration

##### README for additional insights
- Tech Stack: React 19, TypeScript, Vite
- Features: AI storyboard generation, mobile-friendly UI, secure API key handling

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Client (Browser)"
        User((End User)):::actor
        HTML["index.html"]:::config
        ViteDev["Vite Dev Server / Build"]:::config
        User -->|"loads SPA"| HTML
        HTML -->|"bootstraps via"| ViteDev
    end

    subgraph "Application"
        subgraph "UI Components"
            Spinner["LoadingSpinner"]:::ui
            SceneCard["SceneCard"]:::ui
        end
        subgraph "Root Bootstrap"
            IndexTSX["index.tsx"]:::ui
            AppTSX["App.tsx"]:::ui
        end
        subgraph "Service Layer"
            GeminiService["geminiService"]:::service
        end
        IndexTSX -->|"renders"| AppTSX
        AppTSX -->|"uses UI"| Spinner
        AppTSX -->|"uses UI"| SceneCard
        AppTSX -->|"calls"| GeminiService
    end

    GeminiService -->|"HTTPS request"| GeminiAPI[(Google Gemini AI API)]:::external
    GeminiAPI -->|"response data"| GeminiService
    GeminiService -->|"storyboard data"| AppTSX

    subgraph "Configuration & Types"
        Env[".env (VITE_GEMINI_API_KEY)"]:::config
        Types["types.ts"]:::config
        Meta["metadata.json"]:::config
        ViteCfg["vite.config.ts"]:::config
        TSConfig["tsconfig.json"]:::config
        PackageJSON["package.json"]:::config
        PackageLock["package-lock.json"]:::config
    end

    GeminiService -->|"reads API key"| Env
    AppTSX -->|"imports types"| Types

    click IndexTSX "https://github.com/laravelgpt/ai-storyboard-generator/blob/master/index.tsx"
    click AppTSX "https://github.com/laravelgpt/ai-storyboard-generator/blob/master/App.tsx"
    click HTML "https://github.com/laravelgpt/ai-storyboard-generator/blob/master/index.html"
    click Spinner "https://github.com/laravelgpt/ai-storyboard-generator/blob/master/components/LoadingSpinner.tsx"
    click SceneCard "https://github.com/laravelgpt/ai-storyboard-generator/blob/master/components/SceneCard.tsx"
    click GeminiService "https://github.com/laravelgpt/ai-storyboard-generator/blob/master/services/geminiService.ts"
    click Types "https://github.com/laravelgpt/ai-storyboard-generator/blob/master/types.ts"
    click Meta "https://github.com/laravelgpt/ai-storyboard-generator/blob/master/metadata.json"
    click ViteCfg "https://github.com/laravelgpt/ai-storyboard-generator/blob/master/vite.config.ts"
    click TSConfig "https://github.com/laravelgpt/ai-storyboard-generator/blob/master/tsconfig.json"
    click PackageJSON "https://github.com/laravelgpt/ai-storyboard-generator/blob/master/package.json"
    click PackageLock "https://github.com/laravelgpt/ai-storyboard-generator/blob/master/package-lock.json"

    classDef ui fill:#cce5ff,stroke:#004085,color:#004085
    classDef service fill:#d4edda,stroke:#155724,color:#155724
    classDef external fill:#fff3cd,stroke:#856404,color:#856404
    classDef config fill:#e2e3e5,stroke:#6c757d,color:#6c757d
    classDef actor fill:#f0f0f0,stroke:#888888,color:#333333
```
