# gumball12/text-vide architecture

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

- Interactive diagram: https://gitdiagram.com/gumball12/text-vide
- Repository: https://github.com/gumball12/text-vide

## Overview

##### Main Components

a. Core Package Structure:
- text-vide (main package)
- utils (shared utilities)
- tsconfig (shared TypeScript configuration)

b. Applications:
- Sandbox (demo application)
- Benchmark (performance testing)

##### Key Architectural Elements

Layer 1 - Client Applications:

- Sandbox     |     |   Benchmark   |
- (React + Vite) |     |  (Node.js)    |

- ↓                    ↓

- ↓

Layer 2 - Main Package:

- text-vide package           |

- Core Processing         |    |
- getFixationLength         |    |
- getHighlightedText        |    |
- HTML Tag/Entity Handling  |    |

- ↓

Layer 3 - Supporting Packages:

- Utils      |     |    TSConfig    |
- Shared Helpers |     |  Build Config  |

##### Important Details to Highlight

- Processing Components:
- Text Analysis
- Fixation Point Calculation
- HTML Processing
- Text Transformation

- Configuration Flows:
- Options handling
- Build configuration
- TypeScript settings

##### Data Flow Indicators

- Input text flow
- Processing pipeline
- Output generation
- Configuration application

**Input Text → Word Separation → Fixation Point Calculation → HTML Tag Processing → Entity Processing → Final Output**

##### Integration Points

How the library can be consumed:
- Browser (IIFE)
- ESM
- CommonJS

##### Technical Details

- Build tools (Vite, Turbo)
- Testing framework (Vitest)
- Package management (pnpm)
- CI/CD workflows

##### The testing and benchmarking infrastructure

Keep the focus on the core text processing functionality while showing how the monorepo structure supports development, testing, and demonstration of the library.

Use standardized symbols:
- Rectangles for packages/modules
- Diamonds for decision points

Remember to maintain a balance between showing the monorepo structure and the actual text processing functionality, as the latter is the primary purpose of the project.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client_Layer
        Sandbox["Sandbox (React + Vite)"]:::app
        Benchmark["Benchmark (Node.js)"]:::app
    end

    subgraph Core_Processing
        TextVide["Text-Vide Package"]:::core
        subgraph Processing_Pipeline
            FixationLength["Fixation Length Calculator"]:::processor
            TextHighlight["Text Highlighter"]:::processor
            HtmlTag["HTML Tag Processor"]:::processor
            HtmlEntity["HTML Entity Processor"]:::processor
            Options["Options Handler"]:::config
            Types["Type Definitions"]:::types
            CoreUtils["Core Utils"]:::util
        end
    end

    subgraph Support_Layer
        Utils["Utils Package"]:::util
        TSConfig["TSConfig Package"]:::config
        subgraph Utils_Components
            Defaults["Default Handlers"]:::util
            EmptyChecks["Empty Checks"]:::util
            ObjectManip["Object Manipulation"]:::util
        end
    end

    subgraph Testing_Infrastructure
        CoreTests["Core Tests"]:::test
        UtilsTests["Utils Tests"]:::test
    end

    subgraph Build_System
        ViteConfig["Vite Configuration"]:::config
        VitestConfig["Vitest Configuration"]:::config
    end

    %% Relationships
    Sandbox --> TextVide
    Benchmark --> TextVide
    TextVide --> Processing_Pipeline
    Utils --> Processing_Pipeline
    TSConfig --> Build_System
    Processing_Pipeline --> CoreTests
    Utils_Components --> UtilsTests

    %% Component relationships
    FixationLength --> TextHighlight
    Options --> FixationLength
    HtmlTag --> TextHighlight
    HtmlEntity --> TextHighlight
    Types --> Processing_Pipeline
    CoreUtils --> Processing_Pipeline
    
    Utils_Components --> Utils

    %% Click events
    click Sandbox "https://github.com/Gumball12/text-vide/tree/main/apps/sandbox/"
    click Benchmark "https://github.com/Gumball12/text-vide/tree/main/apps/benchmark/"
    click FixationLength "https://github.com/Gumball12/text-vide/blob/main/packages/text-vide/src/getFixationLength.ts"
    click TextHighlight "https://github.com/Gumball12/text-vide/blob/main/packages/text-vide/src/getHighlightedText.ts"
    click HtmlTag "https://github.com/Gumball12/text-vide/blob/main/packages/text-vide/src/useCheckIsHtmlTag.ts"
    click HtmlEntity "https://github.com/Gumball12/text-vide/blob/main/packages/text-vide/src/useCheckIsHtmlEntity.ts"
    click Options "https://github.com/Gumball12/text-vide/blob/main/packages/text-vide/src/getOptions.ts"
    click Types "https://github.com/Gumball12/text-vide/blob/main/packages/text-vide/src/types.ts"
    click CoreUtils "https://github.com/Gumball12/text-vide/blob/main/packages/text-vide/src/utils.ts"
    click Utils "https://github.com/Gumball12/text-vide/tree/main/packages/utils/"
    click Defaults "https://github.com/Gumball12/text-vide/blob/main/packages/utils/defaults.ts"
    click EmptyChecks "https://github.com/Gumball12/text-vide/blob/main/packages/utils/isEmpty.ts"
    click ObjectManip "https://github.com/Gumball12/text-vide/blob/main/packages/utils/omitBy.ts"
    click TSConfig "https://github.com/Gumball12/text-vide/tree/main/packages/tsconfig/"
    click CoreTests "https://github.com/Gumball12/text-vide/tree/main/packages/text-vide/src/__tests__/"
    click UtilsTests "https://github.com/Gumball12/text-vide/tree/main/packages/utils/__tests__/"
    click ViteConfig "https://github.com/Gumball12/text-vide/blob/main/packages/text-vide/vite.config.ts"
    click VitestConfig "https://github.com/Gumball12/text-vide/blob/main/packages/text-vide/vitest.config.ts"

    %% Styling
    classDef app fill:#f9f,stroke:#333,stroke-width:2px
    classDef core fill:#bbf,stroke:#333,stroke-width:2px
    classDef processor fill:#dfd,stroke:#333,stroke-width:2px
    classDef config fill:#ffd,stroke:#333,stroke-width:2px
    classDef util fill:#ddd,stroke:#333,stroke-width:2px
    classDef test fill:#fdd,stroke:#333,stroke-width:2px
    classDef types fill:#dff,stroke:#333,stroke-width:2px
```
