# abd-ul-hannan/my-assistants architecture

> Architecture diagram of the GitHub repository abd-ul-hannan/my-assistants, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abd-ul-hannan/my-assistants
- Repository: https://github.com/abd-ul-hannan/my-assistants

## Overview

##### Project type and purpose
- This is a single-page, full-stack presentation creator (front-end only) built with React 18 + TypeScript, styled with Tailwind CSS, and bundled with Vite.
- It transforms a user’s topic into a short AI-generated script, synthesizes voice via ElevenLabs, produces an AI talking-head video via Tavus, and displays progress in real time.

##### File structure
- Top level:
- index.html, src/, package.json, Vite/Tailwind/TypeScript configs, .env for API keys.
- src/
- components/: React UI (SplashScreen, MainInterface, ProgressIndicator, GenderSelector, ResultsDisplay).
- services/: orchestration & wrappers for external APIs (scriptGenerator.ts, apiService.ts, elevenLabsService.ts, tavusService.ts).
- config/: presenter metadata (male/female IDs).
- types/: shared TypeScript definitions.
- No custom backend – client directly calls third-party APIs.

##### README for additional insights
- UX flow: topic in → script (~5s) → voice (~10s) → video (1–3 min)
- Fallback: if video times out, uses demo videos
- Deployment target: Netlify (static hosting)
- Key external dependencies: ElevenLabs Text-to-Speech API, Tavus Video Generation API

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User and Browser Entry
    User(["User"]):::external
    Index["index.html"]:::hosting
    click Index "https://github.com/abd-ul-hannan/my-assistants/blob/main/index.html"
    MainTS["main.tsx"]:::hosting
    click MainTS "https://github.com/abd-ul-hannan/my-assistants/blob/main/src/main.tsx"
    App["App.tsx"]:::ui
    click App "https://github.com/abd-ul-hannan/my-assistants/blob/main/src/App.tsx"

    %% Client UI Components
    subgraph "Client (Browser)"
        direction TB
        Splash["SplashScreen"]:::ui
        click Splash "https://github.com/abd-ul-hannan/my-assistants/blob/main/src/components/SplashScreen.tsx"
        MainIface["MainInterface"]:::ui
        click MainIface "https://github.com/abd-ul-hannan/my-assistants/blob/main/src/components/MainInterface.tsx"
        Gender["GenderSelector"]:::ui
        click Gender "https://github.com/abd-ul-hannan/my-assistants/blob/main/src/components/GenderSelector.tsx"
        Progress["ProgressIndicator"]:::ui
        click Progress "https://github.com/abd-ul-hannan/my-assistants/blob/main/src/components/ProgressIndicator.tsx"
        Results["ResultsDisplay"]:::ui
        click Results "https://github.com/abd-ul-hannan/my-assistants/blob/main/src/components/ResultsDisplay.tsx"
    end

    %% Service Layer
    subgraph "Service Layer"
        direction TB
        APIService["apiService.ts<br/>(orchestration & timeouts)"]:::services
        click APIService "https://github.com/abd-ul-hannan/my-assistants/blob/main/src/services/apiService.ts"
        APIWrapper["api.ts<br/>(generic wrapper)"]:::services
        click APIWrapper "https://github.com/abd-ul-hannan/my-assistants/blob/main/src/services/api.ts"
        ScriptGen["scriptGenerator.ts"]:::services
        click ScriptGen "https://github.com/abd-ul-hannan/my-assistants/blob/main/src/services/scriptGenerator.ts"
        TTS["elevenLabsService.ts"]:::services
        click TTS "https://github.com/abd-ul-hannan/my-assistants/blob/main/src/services/elevenLabsService.ts"
        VideoGen["tavusService.ts"]:::services
        click VideoGen "https://github.com/abd-ul-hannan/my-assistants/blob/main/src/services/tavusService.ts"
        Config["presenters.ts"]:::data
        click Config "https://github.com/abd-ul-hannan/my-assistants/blob/main/src/config/presenters.ts"
        Types["types/index.ts"]:::data
        click Types "https://github.com/abd-ul-hannan/my-assistants/blob/main/src/types/index.ts"
    end

    %% External Services
    subgraph "External AI Services"
        direction TB
        TextGen["Text Generation API"]:::external
        ElevenLabs["ElevenLabs TTS API"]:::external
        Tavus["Tavus Video API"]:::external
    end

    %% Fallback Assets
    Demo["Demo Video Assets"]:::data

    %% Build & Hosting
    Vite["vite.config.ts"]:::hosting
    click Vite "https://github.com/abd-ul-hannan/my-assistants/blob/main/vite.config.ts"
    Tailwind["tailwind.config.js<br/>postcss.config.js"]:::hosting
    click Tailwind "https://github.com/abd-ul-hannan/my-assistants/blob/main/tailwind.config.js"
    Env[".env.example"]:::hosting
    click Env "https://github.com/abd-ul-hannan/my-assistants/blob/main/.env.example"
    Netlify["Netlify Hosting"]:::hosting

    %% Layout & Flow
    User --> Index
    Index --> MainTS
    MainTS --> App
    App --> Splash
    Splash --> MainIface
    MainIface --> Gender
    Gender --> APIService
    APIService --> ScriptGen
    ScriptGen --> TextGen
    TextGen --> ScriptGen
    ScriptGen --> APIService
    APIService --> TTS
    TTS --> ElevenLabs
    ElevenLabs --> TTS
    TTS --> APIService
    APIService --> VideoGen
    VideoGen --> Tavus
    Tavus --> VideoGen
    VideoGen --> APIService
    APIService --> Results
    APIService --> Progress
    VideoGen -- "timeout/fallback" --> Demo
    Demo --> Results

    %% Build & Deploy Flow
    MainTS --> Vite
    App --> Vite
    Vite --> Netlify
    Tailwind --> Vite
    Env --> Vite
    Netlify --> Index

    %% Styles
    classDef ui fill:#E0F7FF,stroke:#036;
    classDef services fill:#E6FFE6,stroke:#090;
    classDef external fill:#FFF2E6,stroke:#F60;
    classDef hosting fill:#F2F2F2,stroke:#666;
    classDef data fill:#DDDDDD,stroke:#666;
    classDef external2 fill:#FFE6E6,stroke:#F00;
```
