project-nomad/electron/package.json
Claude cd28a109b9
feat: add Electron desktop app wrapper
Adds a native desktop application shell in electron/ that wraps the
existing Docker-based NOMAD stack in an Electron BrowserWindow.

Architecture:
- Single instance lock prevents multiple app copies from running
- Main process manages the full Docker Compose lifecycle (up/stop)
- Health-check polling (GET /api/health) with 3-minute timeout before
  loading the NOMAD web UI in the BrowserWindow
- System tray stays alive when the window is closed, with menu items
  for Show/Hide, Open in Browser, Restart, Stop, and Quit
- Retry button on the loading screen re-runs the launch sequence
  without needing to restart the app

Files:
  electron/package.json       - Electron 34 + electron-builder config
                                Targets: AppImage/deb (Linux), DMG (Mac),
                                NSIS (Windows); supports x64 + arm64
  electron/tsconfig.json      - CommonJS/ES2020 TypeScript for main process
  electron/src/main.ts        - Main process: window, tray, Docker helpers,
                                startup state machine, IPC handlers
  electron/src/preload.ts     - contextBridge: exposes onStatus / retryLaunch
                                to loading screen without full nodeIntegration
  electron/src/loading.html   - Branded startup screen with animated progress
                                bar, status messages, and error retry button
  electron/assets/README.md   - Icon file guide (512px PNG, tray 32px PNG,
                                ICNS for Mac, ICO for Windows)

Root scripts added:
  npm run electron:install     - install electron deps
  npm run electron:build       - compile TypeScript
  npm run electron:dev         - build + launch in dev mode
  npm run electron📦*   - package for linux/mac/win

https://claude.ai/code/session_01WfRC4tDeYprykhMrg4PxX6
2026-03-22 21:53:02 +00:00

50 lines
1.3 KiB
JSON

{
"name": "nomad-desktop",
"version": "1.0.0",
"description": "Project N.O.M.A.D. Desktop Application",
"main": "dist/main.js",
"private": true,
"scripts": {
"build": "tsc && cp src/loading.html dist/loading.html",
"dev": "npm run build && electron .",
"watch": "tsc --watch",
"package:linux": "npm run build && electron-builder --linux",
"package:mac": "npm run build && electron-builder --mac",
"package:win": "npm run build && electron-builder --win"
},
"devDependencies": {
"@types/node": "^22.0.0",
"electron": "^34.0.0",
"electron-builder": "^25.0.0",
"typescript": "^5.7.0"
},
"build": {
"appId": "us.projectnomad.desktop",
"productName": "Project N.O.M.A.D.",
"copyright": "Copyright © 2025 Crosstalk Solutions, LLC",
"files": [
"dist/**/*",
"assets/**/*"
],
"linux": {
"target": [
{ "target": "AppImage", "arch": ["x64", "arm64"] },
{ "target": "deb", "arch": ["x64", "arm64"] }
],
"icon": "assets/icon.png",
"category": "Network"
},
"mac": {
"target": [
{ "target": "dmg", "arch": ["x64", "arm64"] }
],
"icon": "assets/icon.icns",
"darkModeSupport": true
},
"win": {
"target": "nsis",
"icon": "assets/icon.ico"
}
}
}