Prerequisites
- All Platforms
- macOS
- Windows
- Linux
- Node.js 18+ and npm (nodejs.org)
- Git for cloning the repository
- Internet connection for downloading dependencies and binaries
Quick Start
Install dependencies
- Electron 36
- React 19, Vite, TypeScript
- better-sqlite3 (requires native compilation)
- ffmpeg-static, dbus-next, and more
Compile native helpers
- macOS:
macos-globe-listener(Swift),macos-fast-paste(C) - Windows:
windows-key-listener.exe,windows-fast-paste.exe(C) - Linux:
linux-fast-paste(C)
Development mode uses
NODE_ENV=development and loads from http://localhost:5173. Changes to React components hot-reload automatically.Development Workflow
File Structure
Development Scripts
Native Module Compilation
macOS Globe Key Listener
Source:resources/globe-listener.swift
Build script: scripts/build-globe-listener.js
- Xcode Command Line Tools installed
- macOS 10.15+ for ApplicationServices APIs
Windows Key Listener
Source:resources/windows-key-listener.c
Build script: scripts/build-windows-key-listener.js
Linux Fast Paste
Source:resources/linux-fast-paste.c
Build script: scripts/build-linux-fast-paste.js
xdotool or wtype.
Building for Distribution
Unsigned Builds (Personal Use)
Best for testing or personal use without code signing:- macOS:
dist/mac-arm64/OpenWhispr.app(ordist/mac/for Intel) - Windows:
dist/win-unpacked/OpenWhispr.exe - Linux:
dist/linux-unpacked/openwhispr
macOS Security Warning
macOS Security Warning
When opening an unsigned app, macOS shows a security warning.Workaround:
- Right-click
OpenWhispr.app - Select “Open”
- Click “Open” in the dialog
Signed macOS Builds
Obtain certificates
- Join Apple Developer Program ($99/year)
- Create “Developer ID Application” certificate
- Download and install in Keychain Access
- Export as
.p12file (optional, for CI)
Build with signing
- Build React app
- Package with electron-builder
- Sign all binaries and frameworks
- Create DMG and ZIP
- Notarize with Apple (10-30 minutes)
- Staple notarization ticket
Signed Windows Builds
Obtain code signing certificate
Purchase from DigiCert, Sectigo, or another CA.
- EV certificate (recommended): Stored on USB token, instant SmartScreen reputation
- Standard certificate: Cheaper but requires reputation building
Linux Packages
- AppImage
- Debian (.deb)
- RPM
- tar.gz
File:
dist/OpenWhispr-1.5.5-linux-x64.AppImageSelf-contained, portable executable:Multi-Platform Builds
Build for all platforms from a single host (requires Docker or VMs):Code Signing Considerations
macOS Entitlements
macOS Entitlements
File: Required for:
resources/mac/entitlements.mac.plist- allow-unsigned-executable-memory: V8 JIT in Electron
- disable-library-validation: Native modules (better-sqlite3, ffmpeg)
- audio-input: Microphone access
Windows Authenticode
Windows Authenticode
Signing adds:
- Publisher name in installer
- Removal of “Unknown publisher” warning
- Faster SmartScreen reputation (with EV cert)
Linux Signing
Linux Signing
Not commonly used. Most users trust:
- Repository packages: Official distro repos
- Flatpak: Sandboxed with explicit permissions
- AppImage: User verifies SHA256 checksum
Troubleshooting Build Issues
better-sqlite3 compilation fails
better-sqlite3 compilation fails
Symptom:
Error: Cannot find module 'better-sqlite3'Fix:Vite build fails
Vite build fails
Symptom: TypeScript errors or missing modulesFix:
whisper-cpp not found
whisper-cpp not found
Symptom: “whisper-cpp binary not found” at runtimeFix:
macOS notarization fails
macOS notarization fails
Common issues:
- Wrong certificate: Must be “Developer ID Application”, not “Mac Developer”
- Hardened runtime missing: Check
electron-builder.json→mac.hardenedRuntime: true - Invalid entitlements: Verify
entitlements.mac.plistsyntax - Apple ID password: Use app-specific password, not account password
Windows binary missing vcruntime140.dll
Windows binary missing vcruntime140.dll
Symptom: “VCRUNTIME140.dll was not found” on some Windows machinesFix: Include Visual C++ Redistributable in installer
CI/CD Pipeline Example
Performance Optimization
Minimize bundle size
- Exclude dev dependencies from production build
- Use
filesarray inelectron-builder.jsonto exclude unnecessary files - Enable ASAR packaging (default)
Next Steps
Architecture
Understand the codebase structure
Model Registry
Learn how models are managed
Troubleshooting
Debug common build and runtime issues