# digma-ai/digma-ui architecture

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

- Interactive diagram: https://gitdiagram.com/digma-ai/digma-ui
- Repository: https://github.com/digma-ai/digma-ui

## Overview

##### Project type and purpose
- This is a React-based monorepo containing multiple frontend applications for the Digma continuous-feedback platform.
- It produces three primary distributions: Web, JetBrains IDE plugin, and VS/VS Code extensions.
- Key capabilities include connecting to Digma APIs, proxying Jaeger UI, PostHog analytics, JSON-RPC integration with a local Digma engine, and feature flags for “Agentic” services.

##### File structure
- Top-level build and config files: Dockerfile, babelrc, webpack.common/dev/prod, tsconfig.*, package.json.
- /src/app.ts & /src/dispatcher.ts: application launch points and event dispatching.
- /src/api: REST and JSON-RPC client layers (ActionDispatcher, convert-To-DigmaJsonRpcRequest, web services).
- /src/containers: platform-specific entry points (Admin, Agentic, Dashboard, InstallationWizard, IdeLauncher, Login, Main, Notifications, RecentActivity, Troubleshooting, etc.).
- /src/redux & /src/store: cross-app state management (slices, services, selectors).
- /src/hooks, /src/utils, /src/logging: shared utilities, custom React hooks, and logging.
- /src/components + /src/common: UI components organized by feature areas and shared modules.
- /public & /assets: static assets and HTML templates.
- /website: supporting static pages (e.g., Digmathon leaderboard).

##### Extract key README information
- Three build targets via `npm run build:prod:{platform}` → dist outputs for web, jetbrains, vs/vscode.
- Web dev server runs at `localhost:3000` with environment variables to configure API_BASE_URL, AUTH_API_BASE_URL, JAEGER_UI_PATH, feature flags (IS_AGENTIC_ENABLED, etc.).
- Storybook available on port 6006.
- Includes a fork of Jaeger UI for trace visualization.

- **Build & CI Pipeline**: GitHub Actions workflows → lint/test/build → Dockerfile.
- **Monorepo Codebase**:
- **Entry Points**
– Web app (webpack dev server → browser)
– IDE plugins (JetBrains, VS, VS Code) loaded in host UI view
- **API Layer**
– REST clients (src/api/web/services → API_BASE_URL, AUTH_API_BASE_URL)
– JSON-RPC client (src/api/json-rpc → local Digma engine)
- **State Management**
– Redux services & slices (/src/redux & /src/store)
– React hooks (/src/hooks)
- **UI Components**
– Feature modules: Admin, Agentic, Dashboard, Errors, Insights, etc.
– Shared /common component library
- Digma Back-end API
- Auth API
- Jaeger UI (custom or proxied)
- PostHog Analytics
- **IDE Host** (JetBrains/VS/VS Code) for plugin distributions
- **Browser** for web distribution

- **Browser** ←→ Web Dev Server (static assets + environment config)
- **Browser** → REST API (API_BASE_URL) for data fetch/auth
- **Browser** → Jaeger UI (iframe or proxy)
- **IDE Host** ↔ JSON-RPC client → local Digma engine (ActionDispatcher)
- **Monorepo Code** → Redux store updates → UI component re-render
- **User actions** → dispatcher.ts → analytics (PostHog), pluginEvents

c. Architectural patterns & design principles:
- **Monorepo** with shared code and multiple entrypoints
- **Modular feature structure**: “containers” for routing/logic and “components” for UI
- **Layered API abstraction**: unified JSON-RPC + REST wrappers
- **Centralized state** via Redux slices/services and custom hooks
- **Plugin architecture** for IDE integration
- **Environment-driven feature flags**

d. Relevant technologies & frameworks:
- React + TypeScript
- Redux Toolkit
- Webpack (common/dev/prod)
- Storybook
- JSON-RPC (custom converters)
- GitHub Actions CI
- PostHog, Jaeger UI integration

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Build & CI Pipeline"
        CI["GitHub Actions Workflows"]:::pipeline
        DF["Dockerfile"]:::pipeline
        WC["webpack.common.ts / webpack.dev.ts / webpack.prod.ts"]:::pipeline
    end

    subgraph "Monorepo Codebase"
        subgraph "Entry Points"
            APP["src/app.ts"]:::entry
            DIS["src/dispatcher.ts"]:::entry
        end
        subgraph "API Layer"
            API_INDEX["src/api/index.ts"]:::api
            WEB_CLIENT["src/api/web/client.ts"]:::api
            SEND_MSG["src/api/web/sendMessageToWebService.ts"]:::api
            WEB_SVC["src/api/web/services"]:::api
            JSON_REQ["src/api/json-rpc/convertToDigmaJsonRpcRequest.ts"]:::api
            JSON_DATA["src/api/json-rpc/convertToDigmaMessageData.ts"]:::api
            JSON_CHECK["src/api/json-rpc/isDigmaJsonRpcRequest.ts"]:::api
            JSON_TYPES["src/api/json-rpc/types.ts"]:::api
        end
        subgraph "State Management"
            REDUX_SERV["src/redux/services"]:::state
            REDUX_SLICES["src/redux/slices"]:::state
            REDUX_UTILS["src/redux/utils"]:::state
            STORE["src/store"]:::state
        end
        subgraph "Custom React Hooks"
            HOOKS["src/hooks"]:::ui
        end
        subgraph "Shared Utilities & Logging"
            UTILS["src/utils"]:::util
            LOGGING["src/logging"]:::util
        end
        subgraph "Containers"
            ADMIN["src/containers/Admin"]:::entry
            AGENT["src/containers/Agentic"]:::entry
            DASH["src/containers/Dashboard"]:::entry
            DOCS["src/containers/Documentation"]:::entry
            EMAIL["src/containers/EmailConfirmation"]:::entry
            IDELAUNCH["src/containers/IdeLauncher"]:::entry
            INSTALL["src/containers/InstallationWizard"]:::entry
            LOGIN["src/containers/Login"]:::entry
            MAIN["src/containers/Main"]:::entry
            NOTIF["src/containers/Notifications"]:::entry
            RECENT["src/containers/RecentActivity"]:::entry
            TROUB["src/containers/Troubleshooting"]:::entry
        end
        subgraph "UI Components"
            COMPS["src/components"]:::ui
            COMMON["src/components/common"]:::ui
        end
        PLUGIN["src/pluginEvents.ts"]:::api
        OS["src/os.ts / src/platform.ts"]:::api
        FEATURE_FLAGS["src/featureFlags.ts"]:::api
        CONSTS["src/constants.ts"]:::api
    end

    subgraph "Distributions"
        WEB_DIST["dist/web"]:::dist
        JB_DIST["dist/jetbrains"]:::dist
        VS_DIST["dist/vs"]:::dist
    end

    subgraph "External Services"
        BROWSER["Browser"]:::external
        IDE_HOST["IDE Host (JetBrains/VS/VS Code)"]:::external
        DAPI["Digma Back-end API"]:::external
        AUTH["Auth API"]:::external
        JAEGER["Jaeger UI"]:::external
        POSTHOG["PostHog Analytics"]:::external
        LOCAL_ENGINE["Local Digma Engine"]:::external
    end

    %% Connections
    CI -->|builds| WEB_DIST
    CI -->|builds| JB_DIST
    CI -->|builds| VS_DIST
    APP -->|serves UI| BROWSER
    APP -->|uses REST| API_INDEX
    APP -->|dispatches| DIS
    DIS -->|records| POSTHOG
    DIS -->|sends RPC| JSON_REQ
    JSON_REQ -->|executes| LOCAL_ENGINE
    IDE_HOST -->|loads plugin| IDELAUNCH
    IDELAUNCH -->|calls RPC| JSON_REQ
    API_INDEX --> WEB_CLIENT
    API_INDEX --> SEND_MSG
    API_INDEX --> WEB_SVC
    JSON_REQ --> JSON_DATA
    JSON_REQ --> JSON_CHECK
    JSON_REQ --> JSON_TYPES
    API_INDEX --> DAPI
    API_INDEX --> AUTH
    APP -->|embeds| JAEGER
    REDUX_SERV --> REDUX_SLICES
    REDUX_SLICES --> STORE
    APP --> REDUX_SERV
    HOOKS --> REDUX_SERV
    UTILS --> APP
    LOGGING --> APP
    ADMIN --> APP
    AGENT --> APP
    DASH --> APP
    DOCS --> APP
    EMAIL --> APP
    LOGIN --> APP
    MAIN --> APP
    NOTIF --> APP
    RECENT --> APP
    TROUB --> APP
    COMPS --> APP
    COMMON --> COMPS
    FEATURE_FLAGS --> APP
    CONSTS --> APP
    OS --> IDELAUNCH
    PLUGIN --> DIS

    %% Click Events
    click CI "https://github.com/digma-ai/digma-ui/tree/main/.github/workflows/"
    click DF "https://github.com/digma-ai/digma-ui/tree/main/Dockerfile"
    click WC "https://github.com/digma-ai/digma-ui/blob/main/webpack.common.ts"
    click APP "https://github.com/digma-ai/digma-ui/blob/main/src/app.ts"
    click DIS "https://github.com/digma-ai/digma-ui/blob/main/src/dispatcher.ts"
    click API_INDEX "https://github.com/digma-ai/digma-ui/blob/main/src/api/index.ts"
    click WEB_CLIENT "https://github.com/digma-ai/digma-ui/blob/main/src/api/web/client.ts"
    click SEND_MSG "https://github.com/digma-ai/digma-ui/blob/main/src/api/web/sendMessageToWebService.ts"
    click WEB_SVC "https://github.com/digma-ai/digma-ui/tree/main/src/api/web/services/"
    click JSON_REQ "https://github.com/digma-ai/digma-ui/blob/main/src/api/json-rpc/convertToDigmaJsonRpcRequest.ts"
    click JSON_DATA "https://github.com/digma-ai/digma-ui/blob/main/src/api/json-rpc/convertToDigmaMessageData.ts"
    click JSON_CHECK "https://github.com/digma-ai/digma-ui/blob/main/src/api/json-rpc/isDigmaJsonRpcRequest.ts"
    click JSON_TYPES "https://github.com/digma-ai/digma-ui/blob/main/src/api/json-rpc/types.ts"
    click REDUX_SERV "https://github.com/digma-ai/digma-ui/tree/main/src/redux/services/"
    click REDUX_SLICES "https://github.com/digma-ai/digma-ui/tree/main/src/redux/slices/"
    click REDUX_UTILS "https://github.com/digma-ai/digma-ui/tree/main/src/redux/utils/"
    click STORE "https://github.com/digma-ai/digma-ui/tree/main/src/store/"
    click HOOKS "https://github.com/digma-ai/digma-ui/tree/main/src/hooks/"
    click UTILS "https://github.com/digma-ai/digma-ui/tree/main/src/utils/"
    click LOGGING "https://github.com/digma-ai/digma-ui/tree/main/src/logging/"
    click ADMIN "https://github.com/digma-ai/digma-ui/tree/main/src/containers/Admin/"
    click AGENT "https://github.com/digma-ai/digma-ui/tree/main/src/containers/Agentic/"
    click DASH "https://github.com/digma-ai/digma-ui/tree/main/src/containers/Dashboard/"
    click DOCS "https://github.com/digma-ai/digma-ui/tree/main/src/containers/Documentation/"
    click EMAIL "https://github.com/digma-ai/digma-ui/tree/main/src/containers/EmailConfirmation/"
    click IDELAUNCH "https://github.com/digma-ai/digma-ui/tree/main/src/containers/IdeLauncher/"
    click INSTALL "https://github.com/digma-ai/digma-ui/tree/main/src/containers/InstallationWizard/"
    click LOGIN "https://github.com/digma-ai/digma-ui/tree/main/src/containers/Login/"
    click MAIN "https://github.com/digma-ai/digma-ui/tree/main/src/containers/Main/"
    click NOTIF "https://github.com/digma-ai/digma-ui/tree/main/src/containers/Notifications/"
    click RECENT "https://github.com/digma-ai/digma-ui/tree/main/src/containers/RecentActivity/"
    click TROUB "https://github.com/digma-ai/digma-ui/tree/main/src/containers/Troubleshooting/"
    click COMPS "https://github.com/digma-ai/digma-ui/tree/main/src/components/"
    click COMMON "https://github.com/digma-ai/digma-ui/tree/main/src/components/common/"
    click PLUGIN "https://github.com/digma-ai/digma-ui/blob/main/src/pluginEvents.ts"
    click OS "https://github.com/digma-ai/digma-ui/blob/main/src/os.ts"
    click FEATURE_FLAGS "https://github.com/digma-ai/digma-ui/blob/main/src/featureFlags.ts"
    click CONSTS "https://github.com/digma-ai/digma-ui/blob/main/src/constants.ts"

    classDef pipeline fill:#e0f7fa,stroke:#006064,color:#004d40
    classDef entry fill:#e8f5e9,stroke:#1b5e20,color:#2e7d32
    classDef api fill:#e3f2fd,stroke:#0d47a1,color:#1565c0
    classDef state fill:#f3e5f5,stroke:#6a1b9a,color:#4a148c
    classDef ui fill:#fffde7,stroke:#f9a825,color:#f57f17
    classDef util fill:#f5f5f5,stroke:#616161,color:#424242
    classDef dist fill:#ede7f6,stroke:#4527a0,color:#311b92
    classDef external fill:#eceff1,stroke:#37474f,color:#263238
```
