# aisingapore/tagui architecture

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

- Interactive diagram: https://gitdiagram.com/aisingapore/tagui
- Repository: https://github.com/aisingapore/tagui

## Overview

##### Main Components

a. Core Engine Layer:
- TagUI Core Engine (src/tagui)
- Language Processing Components (src/tagui_parse.php)
- Execution Components (src/tagui_header.js, src/tagui_footer.js)

b. Integration Layer:
- Browser Automation (Chrome/Edge support)
- Desktop Automation (via SikuliX)
- Command Line Interface
- Visual Automation & OCR

c. Extension Layer:
- MS Office Integration (Word/Excel Add-ins)
- Programming Language Bindings (Python/R/C#)
- Telegram Integration
- Node-RED Integration

d. Development Tools:
- Chrome Extension (src/chrome)
- Language Support (src/languages)
- IDE Plugins (VS Code, Notepad++)

##### Relationship Flows

- User Input → Language Parser → Execution Engine
- Execution Engine ↔ Browser/Desktop/CLI Interfaces
- Core Engine ↔ Integration Services
- -ins/Extensions ↔ Core Engine

##### Architecture Patterns

Key architectural aspects:
- Modular Design (separate components for different functionalities)
- Plugin Architecture (support for multiple languages and integrations)
- Event-Driven Architecture (for automation workflow)
- Multi-platform Support (Windows, macOS, Linux)

##### Key Technical Details

- File Processing Flow:
- User Script → Language Parser → JavaScript Translation → Execution Engine
- Security Layer:
- On-premise execution
- Local storage
- OS-level security

##### Component Grouping

Related components:
**Core System:**
- TagUI Engine
- Parser
- Execution Runtime

**Automation Interfaces:**
- Web Automation
- Desktop Automation
- Visual Automation

**Extensions:**
- Office Integration
- Language Bindings
- External Services

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Legend
        L1[Core Components]:::core
        L2[Integration Layer]:::integration
        L3[Extensions]:::extension
        L4[Development Tools]:::devtools
        L5[Security]:::security
    end

    subgraph "Core Engine Layer"
        CE[TagUI Core Engine]:::core
        LP[Language Parser]:::core
        EX[Execution Runtime]:::core
        
        CE --> LP
        LP --> EX
    end

    subgraph "Integration Layer"
        BA[Browser Automation]:::integration
        DA[Desktop Automation]:::integration
        VA[Visual Automation & OCR]:::integration
        CLI[Command Line Interface]:::integration
        
        EX --> BA
        EX --> DA
        EX --> VA
        EX --> CLI
    end

    subgraph "Extension Layer"
        MSO[MS Office Integration]:::extension
        PLB[Programming Language Bindings]:::extension
        TG[Telegram Integration]:::extension
        NR[Node-RED Integration]:::extension
    end

    subgraph "Development Tools"
        CE_EXT[Chrome Extension]:::devtools
        LS[Language Support]:::devtools
        IDE[IDE Plugins]:::devtools
    end

    subgraph "Security Layer"
        SEC[On-premise Execution]:::security
        LS_SEC[Local Storage]:::security
        OS_SEC[OS-level Security]:::security
    end

    CE --> MSO
    CE --> PLB
    CE --> TG
    CE --> NR

    classDef core fill:#blue,color:#fff
    classDef integration fill:#green,color:#fff
    classDef extension fill:#yellow,color:#000
    classDef devtools fill:#purple,color:#fff
    classDef security fill:#red,color:#fff

    click CE "https://github.com/aisingapore/TagUI/tree/master/src/tagui"
    click LP "https://github.com/aisingapore/TagUI/blob/master/src/tagui_parse.php"
    click EX "https://github.com/aisingapore/TagUI/blob/master/src/tagui_runner.php"
    click BA "https://github.com/aisingapore/TagUI/blob/master/src/tagui_chrome.php"
    click DA "https://github.com/aisingapore/TagUI/blob/master/src/tagui.sikuli/tagui.py"
    click VA "https://github.com/aisingapore/TagUI/blob/master/src/tagui.sikuli"
    click MSO "https://github.com/aisingapore/TagUI/tree/master/src/office"
    click PLB "https://github.com/aisingapore/TagUI/tree/master/src/tagui_py"
    click TG "https://github.com/aisingapore/TagUI/tree/master/src/telegram"
    click CE_EXT "https://github.com/aisingapore/TagUI/tree/master/src/chrome"
    click LS "https://github.com/aisingapore/TagUI/tree/master/src/languages"
```
