# linxfeng/flow-eda architecture

> Architecture diagram of the GitHub repository linxfeng/flow-eda, 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/linxfeng/flow-eda
- Repository: https://github.com/linxfeng/flow-eda

## Overview

##### Project type and purpose
- This is a full‑stack, microservices‑based, event‑driven low‑code flow‑engine application.
- It provides a visual, drag‑and‑drop flow editor (Vue3 & React UIs) and a Java/Spring‑Boot backend engine to run, orchestrate, and log “flows” (business processes).

##### File structure
- Top‑level modules:
- flow-eda-common: shared utilities, exceptions, HTTP wrappers, Dubbo APIs/models
- flow-eda-oauth2: OAuth2 authentication microservice
- flow-eda-web: web/admin microservice providing REST APIs for flow/node management
- flow-eda-runner: core flow execution engine microservice (runs nodes, multi-threaded, event callbacks)
- flow-eda-logger: log collection microservice (consumes events, writes to DB, pushes via WebSocket)
- flow-eda-vue & flow-eda-react: two alternative single‑page frontends
- Infra/config: Dockerfile, docker-compose.yml, Nacos config, application.yaml in each service

##### README for insights
- Architecture: Backend‑heavy, frontends are thin clients driven by backend JSON config
- Tech stack: Spring Boot, MyBatis, MySQL, Nacos (service registry/config), Dubbo (RPC), RabbitMQ (messaging), WebSocket (real‑time push), Docker/Compose
- Microservice pattern, event‑driven (pub/sub via RabbitMQ), module decoupling

##### Essential details without over‑splitting
- Related modules (all Spring Boot services) in a “Backend” cluster.
- Only one MySQL instance unless multiple schemas are used.
- Omit minor utility classes and focus on runtime components and integrations.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User Interface Layer
    subgraph "User Interface"
        Vue["Vue3 Flow Editor"]:::ui
        React["React Flow Editor"]:::ui
    end

    %% Backend Microservices
    subgraph "Backend Microservices"
        Common["Shared Library Module"]:::services
        Auth["OAuth2 Auth Service"]:::services
        Web["Flow Management Service"]:::services
        Runner["Flow Execution Engine"]:::services
        Logger["Log Collection Service"]:::services
    end

    %% Infrastructure
    subgraph "Infrastructure"
        Nacos["Nacos Registry/Config"]:::infra
        RabbitMQ["RabbitMQ Broker"]:::infra
        MySQL["MySQL Database"]:::db
        DockerInfra["Docker & Compose"]:::infra
    end

    %% Connections: UI to Services
    Vue -->|"REST API"| Web
    Vue -->|"Auth API"| Auth
    React -->|"REST API"| Web
    React -->|"Auth API"| Auth

    %% Web service interactions
    Web -->|"Dubbo RPC"| Runner
    Web -->|"Dubbo RPC"| Logger

    %% Event-driven flows
    Runner -->|"Publishes Events"| RabbitMQ
    Logger -->|"Consumes Events"| RabbitMQ

    %% Data persistence
    Runner -->|"Updates Data"| MySQL
    Logger -->|"Writes Logs"| MySQL

    %% Real-time push
    Logger -->|"WebSocket Push"| Vue
    Logger -->|"WebSocket Push"| React

    %% Service registry & config
    Auth -->|"Register & Config"| Nacos
    Web -->|"Register & Config"| Nacos
    Runner -->|"Register & Config"| Nacos
    Logger -->|"Register & Config"| Nacos

    %% Click Events
    click Common "https://github.com/linxfeng/flow-eda/tree/master/flow-eda-common/"
    click Auth "https://github.com/linxfeng/flow-eda/tree/master/flow-eda-oauth2/"
    click Web "https://github.com/linxfeng/flow-eda/tree/master/flow-eda-web/"
    click Runner "https://github.com/linxfeng/flow-eda/tree/master/flow-eda-runner/"
    click Logger "https://github.com/linxfeng/flow-eda/tree/master/flow-eda-logger/"
    click Vue "https://github.com/linxfeng/flow-eda/tree/master/flow-eda-vue/"
    click React "https://github.com/linxfeng/flow-eda/tree/master/flow-eda-react/"
    click Nacos "https://github.com/linxfeng/flow-eda/blob/master/flow-eda-common/sql/nacos_config.sql"
    click DockerInfra "https://github.com/linxfeng/flow-eda/tree/master/Dockerfile"
    click DockerInfra "https://github.com/linxfeng/flow-eda/blob/master/docker-compose.yml"

    %% Styles
    classDef ui fill:#D0E8FF,stroke:#037FFF,color:#000
    classDef services fill:#DFFFE0,stroke:#2E8B57,color:#000
    classDef infra fill:#FFEBDD,stroke:#D2691E,color:#000
    classDef db fill:#FFFFCC,stroke:#DAA520,color:#000
```
