Skip to content

Initial Electron desktop app - #1

Merged
kjellberg merged 1 commit into
mainfrom
feat/initial-electron-app
Jun 8, 2026
Merged

Initial Electron desktop app#1
kjellberg merged 1 commit into
mainfrom
feat/initial-electron-app

Conversation

@kjellbergzoey

@kjellbergzoey kjellbergzoey commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

The first cut of Kiqr Desktop — a native companion to the kiqr CLI that watches the local kiqr agent and the WordPress dev environments it proxies, in one live dark dashboard.

What's in here

Stack: electron-vite + React + TypeScript (strict), Biome for lint/format (matching the kiqr/cli config — 2-space, single quotes, no bracket spacing, trailing commas), electron-builder for packaging.

Main process — Docker service (src/main/docker.ts)

  • getAgentStatus()docker ps against kiqr-traefik / kiqr-splash to decide if the agent is up.
  • getContainerStats()docker stats --no-stream --format '{{json .}}', parsed per-line, filtered to kiqr containers (name prefix kiqr- or attached to the kiqr network).
  • All string-parsing lives in pure functions (parseAgentPs, parseStatsLines, classifyStat) and the exec wrapper is injectable, so the logic is unit-tested without a Docker daemon.
  • A 2s pollLoop pushes results over IPC. Missing/stopped Docker degrades to a clear docker-down status instead of crashing.

Preload — sandboxed window.kiqr via contextBridge (onStatus / onStats / refresh), contextIsolation on, nodeIntegration off.

Renderer — pulsing green/grey/amber agent status pill, an Agent card, grouped Project cards (WordPress / MariaDB / phpMyAdmin), animated CPU/mem meters, CPU sparklines, smooth 2s updates, and intentional empty states ("Agent stopped — run kiqr up"). Kiqr blue (#3858e9) accent.

Tests — Vitest specs for every parser plus the poll loop (24 tests, no Docker needed).

Hygiene — real README, .gitignore, GitHub Actions CI (npm ci → lint → typecheck → test → build), MIT LICENSE.

Gate results (all green locally)

  • npm install
  • npm run typecheck ✅ (strict, node + web configs)
  • npm test ✅ — 24/24
  • npm run build ✅ — main + preload + renderer compile
  • npm run lint ✅ — Biome clean

Not exercised here

This was built in a headless environment with no display and no Docker daemon, so the live GUI and real-docker behavior were not run — only typecheck, build, and unit tests of the pure parsers. Worth trying on your machine, @kjellberg: npm install && npm run dev with Docker running and a kiqr up project active to see live meters; and with Docker stopped to confirm the amber "Docker not running" state.

🤖 Generated with Claude Code

Companion app for the kiqr CLI that monitors the local kiqr agent and
the WordPress dev environments it proxies, with a live dark dashboard.

- electron-vite + React + TypeScript (strict), Biome for lint/format
- Main process Docker service (src/main/docker.ts): pure, testable
  parsers (parseAgentPs, parseStatsLines, classifyStat) with an
  injectable exec wrapper; graceful "Docker not running" handling
- 2s poll loop pushing AgentStatus + ClassifiedStat[] over IPC
- Sandboxed preload exposing window.kiqr (onStatus/onStats/refresh)
  with contextIsolation on and nodeIntegration off
- Renderer dashboard: pulsing agent status pill, agent card, grouped
  project cards, animated CPU/mem meters, CPU sparklines, intentional
  empty states
- Vitest specs for all parsers (no Docker daemon required)
- electron-builder config, GitHub Actions CI, README, .gitignore

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@kjellberg
kjellberg merged commit 96cbaa3 into main Jun 8, 2026
1 check passed
@kjellberg
kjellberg deleted the feat/initial-electron-app branch June 8, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants