# digma-ai/jaeger-ui architecture

> Architecture diagram of the GitHub repository digma-ai/jaeger-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/jaeger-ui
- Repository: https://github.com/digma-ai/jaeger-ui

## Overview

##### Project Type and Purpose
- This is a monorepo‐based frontend application for visualizing distributed traces (Jaeger UI).
- It contains two Lerna‐managed packages:
– `packages/jaeger-ui`: the main React/Redux UI app built with Create-React-App (CRA)/Vite, TypeScript, CSS, tests.
– `packages/plexus`: a reusable directed‐graph layout library used by the UI for dependency/trace graphs.

##### File Structure
- Top-level files: CI/CD configs (.github/workflows), Dockerfile, Nginx template, BUILD.md, scripts, Lerna config.
- Two package folders:
– `jaeger-ui/` (UI source, build output, Vite/CRA config, assets)
– `plexus/` (graph library, demo server, Webpack configs)
- Shared dev tooling: ESLint, Prettier, TypeScript configs, Yarn workspace, Docker.
- CI/CD pipelines orchestrate lint, tests, builds, Docker image creation, release via GitHub Actions.

##### README Insights
- UI runs on a local dev server (CRA/Vite on :3000), hot-reload, proxies API calls (`/api`) to Jaeger Query (default `http://localhost:16686`).
- Production build produces static assets under `packages/jaeger-ui/build`; these can be served by any static server (e.g. Nginx).
- UI Configuration is externalized (UI base-path, Google Analytics, etc.).

##### Main Components & Their Relationships
a. Frontend Dev/Build Flow
– Developer invokes `yarn start` → CRA/Vite Dev Server
- Serves React app on :3000
- Proxies API calls to Jaeger Query backend
– Developer runs `yarn build` → Webpack/Vite build → Static bundle (`/build`)
– Dockerfile/Nginx: containerize static assets + Nginx serves on port 80
b. Runtime Client Architecture
– React Components ↔ Redux Store (Actions/Reducers/Selectors)
– API Layer
- `src/api/jaeger.ts` calls Jaeger Query JSON HTTP API
- `src/api/digma/` integrates the Digma JSON-RPC plugin
– Visualization
- Graphing: uses `plexus` package for DAG and force-graph layouts
- Other UI modules: SearchTracePage, TracePage, TraceDiff, QualityMetrics, DependencyGraph, Monitor
c. External Services
– Jaeger Query Service (HTTP JSON API) connecting to tracing storage (Elasticsearch/Cassandra)
– Optional Digma backend (JSON-RPC over WebSocket)
– Analytics (Google Analytics or other via UI config)
– GitHub Actions & Docker registry (for CI/CD)

##### Architectural Patterns & Principles
- Monorepo with Lerna/Yarn workspaces: separate concerns (UI vs. graph library) but share dependencies.
- Modular React + Redux: slices per feature (trace search, trace view, diff, metrics).
- Thin API client layer: keeps fetch logic separate from components.
- Reusable visualization core (`plexus`): independent demo server → decoupled graph engine.
- CI/CD automation: build/test lint pipelines in GitHub Actions, Docker image assembly, version bumping.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Developer("Developer Workstation"):::actor

    subgraph "Monorepo Root & Tooling"
        Lerna["lerna.json"]:::root
        PkgJSON["package.json"]:::root
        TSRoot["tsconfig.json"]:::root
        Workflows[".github/workflows/"]:::ci
        Dockerfile["Dockerfile"]:::infra
        NginxTemp["nginx.conf.template"]:::infra
        BUILDMD["BUILD.md"]:::root
    end

    subgraph "Packages"
        subgraph "jaeger-ui"
            UIApp["jaeger-ui"]:::frontend
            subgraph "Source"
                ViteCfg["vite.config.ts"]:::config
                TSUI["tsconfig.json"]:::config
                subgraph "React Components"
                    Components["Components"]:::frontend
                end
                subgraph "Redux Store"
                    Actions["Actions"]:::frontend
                    Reducers["Reducers"]:::frontend
                    Selectors["Selectors"]:::frontend
                end
                subgraph "API Layer"
                    JaegerAPI["jaeger.js"]:::frontend
                    DigmaAPI["digma/"]:::frontend
                end
                Model["State Model"]:::frontend
                Middleware["middlewares/"]:::frontend
                Logging["logging/"]:::frontend
                subgraph "Utils & Config"
                    Utils["utils/"]:::frontend
                    Constants["constants/"]:::frontend
                    SitePrefix["site-prefix.tsx"]:::frontend
                end
                subgraph "Static Assets"
                    HTML["index.html"]:::frontend
                    Img["img/"]:::frontend
                end
            end
        end
        subgraph "plexus"
            Plexus["plexus"]:::lib
            Demo["demo/"]:::lib
        end
    end

    subgraph "Dev & Build Flow"
        DevServer["Dev Server (CRA/Vite)"]:::build
        BuildStep["Build (Webpack/Vite)"]:::build
        StaticBundle["Static Bundle (/build)"]:::artifact
        DockerNginx["Docker + Nginx"]:::infra
        EndUsers("End Users"):::actor
    end

    subgraph "Runtime Interactions"
        JaegerQuery["Jaeger Query Service"]:::external
        DigmaRPC["Digma RPC (WebSocket)"]:::external
        Analytics["Analytics"]:::external
    end

    subgraph "CI/CD"
        GHActions["GitHub Actions"]:::ci
        DockerRegistry["Docker Registry"]:::ci
    end

    Developer -->|yarn start| DevServer
    DevServer -->|serves UI| UIApp
    DevServer -->|proxy HTTP/JSON| JaegerQuery
    Developer -->|yarn build| BuildStep
    BuildStep -->|outputs| StaticBundle
    StaticBundle -->|containerize| DockerNginx
    DockerNginx -->|serves HTTP| EndUsers

    UIApp -->|depends on| Plexus
    UIApp -->|calls API| JaegerAPI
    JaegerAPI -->|HTTP/JSON| JaegerQuery
    DigmaAPI -->|WebSocket/JSON-RPC| DigmaRPC
    UIApp -->|sends data| Analytics

    GHActions -->|runs lint/test/build| BuildStep
    GHActions -->|push image| DockerRegistry
    DockerRegistry -->|provides image| DockerNginx

    classDef frontend fill:#D0E6FF,stroke:#0366d6,color:#0366d6
    classDef lib fill:#E8F5E9,stroke:#2E7D32,color:#2E7D32
    classDef build fill:#FFF3E0,stroke:#FB8C00,color:#E65100
    classDef infra fill:#ECEFF1,stroke:#607D8B,color:#37474F
    classDef external fill:#FFE0B2,stroke:#F57C00,color:#E65100
    classDef ci fill:#E3F2FD,stroke:#2196F3,color:#0D47A1
    classDef config fill:#F3E5F5,stroke:#8E24AA,color:#6A1B9A
    classDef artifact fill:#F1F8E9,stroke:#558B2F,color:#33691E
    classDef actor fill:#FFFFFF,stroke:#000000,color:#000000
    classDef root fill:#FAFAFA,stroke:#9E9E9E,color:#212121

    click Lerna "https://github.com/digma-ai/jaeger-ui/blob/main/lerna.json"
    click PkgJSON "https://github.com/digma-ai/jaeger-ui/blob/main/package.json"
    click TSRoot "https://github.com/digma-ai/jaeger-ui/blob/main/tsconfig.json"
    click Workflows "https://github.com/digma-ai/jaeger-ui/tree/main/.github/workflows/"
    click Dockerfile "https://github.com/digma-ai/jaeger-ui/tree/main/Dockerfile"
    click NginxTemp "https://github.com/digma-ai/jaeger-ui/blob/main/nginx.conf.template"
    click BUILDMD "https://github.com/digma-ai/jaeger-ui/blob/main/BUILD.md"
    click ViteCfg "https://github.com/digma-ai/jaeger-ui/blob/main/packages/jaeger-ui/vite.config.ts"
    click TSUI "https://github.com/digma-ai/jaeger-ui/blob/main/packages/jaeger-ui/tsconfig.json"
    click Components "https://github.com/digma-ai/jaeger-ui/tree/main/packages/jaeger-ui/src/components/"
    click Actions "https://github.com/digma-ai/jaeger-ui/tree/main/packages/jaeger-ui/src/actions/"
    click Reducers "https://github.com/digma-ai/jaeger-ui/tree/main/packages/jaeger-ui/src/reducers/"
    click Selectors "https://github.com/digma-ai/jaeger-ui/tree/main/packages/jaeger-ui/src/selectors/"
    click JaegerAPI "https://github.com/digma-ai/jaeger-ui/blob/main/packages/jaeger-ui/src/api/jaeger.js"
    click DigmaAPI "https://github.com/digma-ai/jaeger-ui/tree/main/packages/jaeger-ui/src/api/digma/"
    click Model "https://github.com/digma-ai/jaeger-ui/tree/main/packages/jaeger-ui/src/model/"
    click Middleware "https://github.com/digma-ai/jaeger-ui/tree/main/packages/jaeger-ui/src/middlewares/"
    click Logging "https://github.com/digma-ai/jaeger-ui/tree/main/packages/jaeger-ui/src/logging/"
    click Utils "https://github.com/digma-ai/jaeger-ui/tree/main/packages/jaeger-ui/src/utils/"
    click Constants "https://github.com/digma-ai/jaeger-ui/tree/main/packages/jaeger-ui/src/constants/"
    click SitePrefix "https://github.com/digma-ai/jaeger-ui/blob/main/packages/jaeger-ui/src/site-prefix.tsx"
    click HTML "https://github.com/digma-ai/jaeger-ui/blob/main/packages/jaeger-ui/index.html"
    click Img "https://github.com/digma-ai/jaeger-ui/tree/main/packages/jaeger-ui/src/img/"
    click Plexus "https://github.com/digma-ai/jaeger-ui/tree/main/packages/plexus/"
    click Demo "https://github.com/digma-ai/jaeger-ui/tree/main/packages/plexus/demo/"
    click GHActions "https://github.com/digma-ai/jaeger-ui/blob/main/.github/workflows/release.yml"
    click GHActions "https://github.com/digma-ai/jaeger-ui/blob/main/.github/workflows/unit-tests.yml"
    click GHActions "https://github.com/digma-ai/jaeger-ui/blob/main/.github/workflows/digma-*.yml"
```
