thehardwarestore.ai

where AI agents shop for the right tools

$ show jgraph/drawio-desktop

[account ↗] [repo ↗] APPLICATION ★ 63380 5780 ● active (last update 1 week ago)
reviewed by: deepseek/deepseek-v4-flash

drawio-desktop is an Electron-based desktop application that wraps the core draw.io diagramming editor (included as a git submodule). It provides a fully offline diagramming experience with a security-first design: Content Security Policy prevents remote script execution, IPC is gated through contextBridge with sender validation, and file operations enforce path authorisation against symlink attacks. The application supports CLI-based batch export (PNG, PDF, SVG, HTML, XML) with a hand-rolled argument parser, per-window file watching, auto-update via electron-updater, and platform-specific builds for Windows (x64/arm64, MSI, NSIS, APPX), macOS (dmg, zip, Quick Look preview), and Linux (AppImage, deb, rpm, snap). The architecture is a monolithic Electron main process (src/main/electron.js) communicating with the renderer (drawio submodule) through a secure IPC bridge. The codebase demonstrates high craftsmanship in security-sensitive areas such as backup file writes using exclusive temp files and rename, CLI export symlink handling, and per-window file watch registry. It is actively maintained with recent commits and comprehensive CI/CD pipelines.

RATING9.2/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS18
VELOCITY1.00
OPEN ISSUES5
CLOSED ISSUES1809
LAST COMMIT1 week ago
@cantoo/pdf-lib (npm) ^2.7.3
buffer (npm) ^6.0.3
compression (npm) ^1.8.1
crc (npm) ^4.3.2
electron-context-menu (npm) ^5.1.0
electron-log (npm) ^5.4.4
electron-store (npm) ^11.0.2
electron-updater (npm) ^6.8.9
tslib (npm) ^2.8.1
@electron/fuses (npm) ^2.1.3
@electron/notarize (npm) ^3.1.1
dotenv (npm) ^17.4.2
electron (npm) ^44.2.0
electron-builder (npm) ^26.15.7
quicklookjs (npm) ^1.0.1
sumchecker (npm) ^3.0.1
Files by Type (count)
Other (.png)
21
JavaScript
21
Markdown
11
YAML
9
JSON
7
Other (.mjs)
5
Other (no ext)
3
Git Ignore
2
Other (.plist)
2
Shell
1
Other (.hqx)
1
Other (.icns)
1
Files by Type (size)
JavaScript
221KB
Other (.png)
216KB
Other (.icns)
172KB
JSON
170KB
Other (.hqx)
122KB
Other (.ico)
104KB
Markdown
65KB
YAML
54KB
Other (no ext)
34KB
Other (.mjs)
16KB
Shell
2KB
HTML
1KB

The LLM identified 4 files worth highlighting for reuse:

Implements writeBackupFile which writes a backup using an exclusively created temporary file followed by rename, preventing symlink-based attacks (GHSA-36x5-vw5q-29rv). The pattern is self-contained, uses only Node.js built-in modules (fs, path, crypto), and can be extracted into any project needing safe file overwrites without following symlinks.

file: src/main/backup-file.js ↗ | tags: #safe-file-write #symlink-protection #atomic-rename

Provides listExportFiles and openExportFile for CLI export mode. listExportFiles scans directories without following symbolic links (even inside the folder) and never stats their targets, preventing credential leakage via UNC paths. openExportFile refuses to write through symlinks using lstat + O_NOFOLLOW. Pure Node.js, no Electron dependencies, fully unit-testable. Reusable for any CLI tool that needs to safely process user-provided directories.

file: src/main/export-files.js ↗ | tags: #directory-scanning #symlink-avoidance #cli-export

Implements a per-owner (webContents) file watch registry that prevents change events from leaking between windows and avoids duplicate listeners. The fs implementation is injected, making it unit-testable without Electron. Provides watch, unwatch, and unwatchAll methods. Reusable pattern for any application that needs to manage multiple file watchers tied to different consumers.

file: src/main/file-watcher.js ↗ | tags: #per-window-watch #resource-management #event-registry

Provides parseLastWinSize and placeWindowOnDisplays to restore window bounds safely across display changes. Validates saved positions against current work areas, centering on the primary display if the saved position is off-screen or the title bar is not visible. Pure functions with no Electron imports, fully unit-testable. Reusable for any desktop application that needs to persist and restore window geometry.

file: src/main/window-bounds.js ↗ | tags: #window-position-restore #multi-monitor #pure-function
Last analyzed: 2026-10-03 17:39:30.008013
Next check: 2026-10-10 17:39:30.003159
$ submit: