# 5ET-D Desktop App Current stage: - Build 0 complete: Electron boots directly into local 5etools wiki. - Stage 1 in progress: React shell navigation + light visual reskin pass, while preserving wiki behavior. ## Prerequisites - Node.js 20+ - `5etools-src` directory in this repository root: - `./5etools-src` Optional override: - Set `FIVEETOOLS_SRC_DIR` to point at a different `5etools-src` path. - Set `FIVEETOOLS_DESKTOP_RESKIN=0` to disable injected wiki styling for strict baseline comparisons. - Set `FIVEETOOLS_DESKTOP_FORCE_NIGHT=0` to keep 5etools day theme while using desktop reskin. ## Install ```bash npm install ``` ## Run (dev) ```bash npm run dev ``` `npm run dev` uses a portless workflow (`vite build --watch`) for environments where local TCP binding is restricted. Optional HMR mode (requires local port binding): ```bash npm run dev:web ``` ## Run (build once + launch) ```bash npm run start ``` ## Package installers ```bash npm run dist ``` This command installs `electron-builder` on demand via `npx` for packaging, rather than during every local dependency install. ## Notes - The app starts an internal local HTTP server for wiki content. - This avoids `file://` loading limitations while keeping content fully local. - Electron launch scripts clear `ELECTRON_RUN_AS_NODE` automatically, so app boot is stable even if that variable is set in your shell environment. - SQLite is intentionally deferred until post-Build 0 to avoid native module/toolchain issues while the wiki bootstrap is stabilized. - Build identity is set to: - Product name: `5ET-D` - App ID: `com.notBoris.5et-desktop` ## Troubleshooting - `app.whenReady` undefined or Electron behaving like Node: - check `echo $ELECTRON_RUN_AS_NODE` - launcher scripts already clear this variable before app start - `listen EPERM ...5173`: - use `npm run dev` (portless mode) - only use `npm run dev:web` when local TCP binding is available