This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
npm start # Start Electron app in development mode (hot reload via Vite)
npm run make # Build and package the app for distribution
npm run package # Package without creating installers
npm run lint # ESLint on all .ts/.tsx filesNo test framework is configured yet.
To cut a release, push a version tag — GitHub Actions builds macOS (ARM + Intel) and Windows and attaches the artifacts automatically:
git tag v1.0.0
git push origin v1.0.0This is an Electron + Vite + TypeScript + React + Tailwind CSS 4 desktop app scaffolded with Electron Forge.
Electron runs two separate JS contexts:
| Process | Entry point | Bundler config |
|---|---|---|
| Main (Node.js) | src/main.ts |
vite.main.config.ts |
| Preload (bridge) | src/preload.ts |
vite.preload.config.ts |
| Renderer (browser) | src/renderer.ts + index.html |
vite.renderer.config.ts |
- Main process (
src/main.ts) — createsBrowserWindow, handles app lifecycle. Node.js APIs are fully available here. - Preload script (
src/preload.ts) — runs in renderer context but with Node.js access; usecontextBridgehere to expose safe APIs to the renderer. - Renderer (
src/renderer.ts) — runs in the browser context. Node.js integration is disabled by default (security default). Communicate with main via IPC (ipcRenderer/ipcMain).
Electron Forge + the Vite plugin writes compiled output to .vite/. The package.json "main" field points to .vite/build/main.js.
forge.config.ts configures:
- asar packaging enabled
- Electron Fuses lock down runtime flags (RunAsNode disabled, cookie encryption on, ASAR integrity validation on)
- Makers: Squirrel (Windows), ZIP (macOS), RPM + DEB (Linux)
To expose functionality from main to renderer:
- Add a
contextBridge.exposeInMainWorld(...)call insrc/preload.ts - Handle the corresponding
ipcMain.handle(...)insrc/main.ts - Call
window.<api>.<method>()fromsrc/renderer.ts
forge.env.d.ts declares the Vite-injected globals (MAIN_WINDOW_VITE_DEV_SERVER_URL, MAIN_WINDOW_VITE_NAME) used in src/main.ts to switch between dev-server and production file loading.