# flowiseai/flowiseembedreact architecture

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

- Interactive diagram: https://gitdiagram.com/flowiseai/flowiseembedreact
- Repository: https://github.com/flowiseai/flowiseembedreact

## Overview

##### Project type and purpose
- This is a front‑end React component library (“flowise-embed-react”) that provides two embeddable chat widgets (FullPageChat and BubbleChat).
- It wraps the underlying core embed logic (from “flowise-embed”) and exposes a simple React API for end‑users to embed a Flowise chatbot on their website.

##### File structure
- Top‑level config files
- package.json / react‑library.json / base.json – npm publishing settings, peerDependencies, module/ESM/CJS outputs.
- rollup.config.js – bundler configuration to produce UMD/ESM bundles.
- tsconfig.json – TypeScript compiler settings.
- .eslintrc.cjs, .gitignore, .npmignore – linting, VCS and npm packaging ignores.
- src directory
- src/index.ts – entry point that re‑exports public components.
- src/FullPageChat.tsx – React component for a full‑screen chat UI.
- src/BubbleChat.tsx – React component for a popup/bubble chat UI.

##### README for additional insights
- Usage examples show that the components accept two required props: chatflowid and apiHost.
- The library itself does not include the backend; it relies on the user’s Flowise API server.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Project Source Files
    subgraph "Project Source" 
        style ProjectSource fill:#ccf,stroke:#333,stroke-width:2px
        src_index["src/index.ts"]:::frontend
        src_full["FullPageChat Component"]:::frontend
        src_bubble["BubbleChat Component"]:::frontend
        cfg_pkg["package.json"]:::config
        cfg_reactlib["react-library.json"]:::config
        cfg_base["base.json"]:::config
        cfg_rollup_conf["rollup.config.js"]:::config
        cfg_ts["tsconfig.json"]:::config
        cfg_eslint[".eslintrc.cjs"]:::config
        cfg_gitignore[".gitignore"]:::config
        cfg_npmignore[".npmignore"]:::config
        docs_readme["README.md"]:::config
    end

    %% Build & Publish Pipeline
    subgraph "Build & Publish Pipeline" 
        style BuildPipeline fill:#cfc,stroke:#333,stroke-width:2px
        Rollup["Rollup Bundler"]:::pipeline
        Dist["dist/*"]:::pipeline
        npmReg["npm Registry"]:::external
    end

    %% Runtime Integration
    subgraph "Runtime Integration"
        style Runtime fill:#ccf,stroke:#333,stroke-width:2px
        App["Consumer React App"]:::frontend
        EntryPoint["Library Entry Point"]:::frontend
        FullComp["FullPageChat"]:::frontend
        BubbleComp["BubbleChat"]:::frontend
        SDK["flowise-embed SDK"]:::external
        API["((Flowise API Server))"]:::external
    end

    %% Build Flow
    cfg_pkg --> cfg_rollup_conf
    cfg_ts --> Rollup
    src_index --> Rollup
    src_full --> Rollup
    src_bubble --> Rollup
    Rollup --> Dist
    Dist -.-> npmReg
    npmReg -.-> App

    %% Runtime Flow
    App -->|"import from package"| EntryPoint
    EntryPoint --> FullComp
    EntryPoint --> BubbleComp
    FullComp -->|"loads SDK"| SDK
    BubbleComp -->|"loads SDK"| SDK
    SDK -->|"HTTP/WebSocket"| API
    FullComp -->|"props chatflowid,apiHost"| App
    BubbleComp -->|"props chatflowid,apiHost"| App

    %% Click Events
    click src_index "https://github.com/flowiseai/flowiseembedreact/blob/main/src/index.ts"
    click src_full "https://github.com/flowiseai/flowiseembedreact/blob/main/src/FullPageChat.tsx"
    click src_bubble "https://github.com/flowiseai/flowiseembedreact/blob/main/src/BubbleChat.tsx"
    click cfg_rollup_conf "https://github.com/flowiseai/flowiseembedreact/blob/main/rollup.config.js"
    click cfg_ts "https://github.com/flowiseai/flowiseembedreact/blob/main/tsconfig.json"
    click cfg_pkg "https://github.com/flowiseai/flowiseembedreact/blob/main/package.json"
    click cfg_reactlib "https://github.com/flowiseai/flowiseembedreact/blob/main/react-library.json"
    click cfg_base "https://github.com/flowiseai/flowiseembedreact/blob/main/base.json"
    click cfg_eslint "https://github.com/flowiseai/flowiseembedreact/blob/main/.eslintrc.cjs"
    click cfg_gitignore "https://github.com/flowiseai/flowiseembedreact/blob/main/.gitignore"
    click cfg_npmignore "https://github.com/flowiseai/flowiseembedreact/blob/main/.npmignore"
    click docs_readme "https://github.com/flowiseai/flowiseembedreact/blob/main/README.md"

    %% Styles
    classDef frontend fill:#cce,stroke:#333,stroke-width:1px
    classDef pipeline fill:#cfc,stroke:#333,stroke-width:1px
    classDef external fill:#fc9,stroke:#333,stroke-width:1px
    classDef config fill:#eef,stroke:#333,stroke-width:1px
```
