Introducing a new way to review your PRs.

Read the announcement

jgraph / drawio-desktop

Official electron build of draw.io

View on GitHub

10 documents · Updated Nov 16, 2026

overview

Knowledge Base updated: 2026-11-16

Knowledge Base Index

Orientation

This repository is the Electron desktop wrapper for draw.io/diagrams.net. The highest-level flow is the Electron main process launching a desktop window around the embedded draw.io web application, then coordinating local files, exports, printing, updates, and packaging.

Main parts:

  • src/main/ — Electron main-process shell and helper modules.
  • src/test/ — unit tests for main-process helper behavior.
  • build/ and electron-builder*.json — packaging assets, installer settings, signing, notarization, and platform build helpers.
  • .github/workflows/ — CI, release, store credential, and packaging automation.
  • drawio/ plus .gitmodules/sync.cjs — integration points for the embedded draw.io web app/submodule.

Critical state is local rather than server-side: user diagram files, backup files, watched filesystem paths, update preferences, config paths, and restored window bounds live on the desktop filesystem or Electron app state. There is no database, object store, queue, or service-side cache in this repository.

Architecture diagrams

flowchart TD
  subgraph Desktop_App[Electron desktop app]
    Main[src/main/electron.js]
    Preload[src/main/electron-preload.js and preload.js]
    Launch[args url-params config/system paths]
    FileState[backup watcher window bounds]
    Export[export html pdf png print progress]
    Updates[update channel mode disable]
  end

  subgraph Embedded_App[draw.io web app]
    Drawio[drawio submodule / web assets]
    Sync[sync.cjs]
  end

  subgraph Build_Release[Build and release]
    Builder[electron-builder*.json]
    BuildScripts[build scripts and assets]
    CI[.github/workflows]
  end

  subgraph Verification[Verification]
    Tests[src/test]
  end

  Main --> Launch
  Main --> Preload
  Main --> FileState
  Main --> Export
  Main --> Updates
  Main --> Drawio
  Sync --> Drawio
  Builder --> BuildScripts
  CI --> Builder
  Tests --> Launch
  Tests --> FileState
  Tests --> Export
  Tests --> Updates
flowchart LR
  CLI[CLI args / OS open event] --> Args[src/main/args.js]
  Args --> Params[src/main/url-params.js]
  Config[src/main/config-paths.js] --> Main[src/main/electron.js]
  System[src/main/system-path.js] --> Main
  Params --> Main
  Main --> Window[BrowserWindow]
  Preload[src/main/electron-preload.js / preload.js] --> Window
  Window --> Drawio[draw.io web UI]
flowchart TD
  Request[Export or print request] --> ExportFiles[src/main/export-files.js]
  ExportFiles --> Html[src/main/html-export.js]
  ExportFiles --> Pdf[src/main/pdf-xml.js]
  ExportFiles --> Png[src/main/png-xml.js]
  ExportFiles --> Print[src/main/print-options.js]
  ExportFiles --> Progress[src/main/progress-bar.js]
  Html --> Output[Desktop output file]
  Pdf --> Output
  Png --> Output
  Print --> Output
flowchart LR
  CI[GitHub Actions workflows] --> Package[electron-builder configs]
  Package --> Assets[build assets/scripts]
  Assets --> Win[Windows installers/AppX/MSI]
  Assets --> Mac[macOS DMG/notarized app]
  Assets --> Linux[Linux/Snap/Flathub artifacts]
  CI --> Release[release prep and hashes]

Glossary

  • draw.io / diagrams.net — the diagram editor web application embedded by this desktop Electron wrapper.
  • Electron Builder — the packaging tool configured by electron-builder*.json and invoked by CI/build scripts.
  • AppX/MSI/Snap/Flathub — platform-specific installer or distribution targets represented in build config and workflows.

Codebase-wide invariants

Routing table