Prerequisites
Before building the desktop app, ensure you have:- Node.js 18+ or Bun 1.0+
- Go 1.25+ (for building the streaming server binary)
- Git
- Platform-specific build tools:
- Windows: Visual Studio Build Tools or Windows SDK
- macOS: Xcode Command Line Tools
- Linux: Standard build tools (
build-essentialon Debian/Ubuntu)
Build Configuration
The build configuration is defined inraffi-desktop/package.json under the build key:
Development Build
To run the desktop app in development mode:Run development server
This command builds the server binary and starts Electron:The
electron:dev script runs:- Server build (
npm run server:build) - Vite dev server on
http://localhost:5173 - Electron with
NODE_ENV=development
Production Build
Build Process
The production build process involves three stages:Build the streaming server
The
server:build script runs build_binary.cjs, which compiles the Go server for your platform:Build the frontend
The This outputs the compiled frontend to the
build script compiles the Svelte app using Vite:dist/ directory.Platform-Specific Builds
Windows
Build Targets:- NSIS installer (
.exe) - MSI installer (
.msi)
raffi-desktop/release/
Artifacts:
Raffi-Setup-{version}.exe- NSIS installerRaffi-{version}.msi- MSI installer
macOS
Build Targets:- DMG disk image
- ZIP archive
raffi-desktop/release/
Artifacts:
Raffi-{version}.dmg- Disk imageRaffi-{version}-mac.zip- ZIP archive- Universal binary support (both ARM64 and x64 server binaries included)
Linux
Build Targets:- Debian package (
.deb) - AppImage (
.AppImage) - RPM package (
.rpm)
raffi-desktop/release/
Artifacts:
Raffi-{version}.deb- Debian packageRaffi-{version}.AppImage- Universal Linux packageRaffi-{version}.rpm- Red Hat package
Build Output Structure
After runningnpm run dist, the release/ directory contains:
File Associations
The desktop app registers handlers for common video formats:.mp4- MP4 Video.mkv- Matroska Video.avi- AVI Video.webm- WebM Video.mov- QuickTime Video
fileAssociations section of the build config.
ASAR Packaging
The app uses ASAR archives (asar: true) to package the application code, with specific files unpacked: