Architecture
Building from Source
Building from Source
This guide walks you through building MiniFy from source code, whether you’re contributing to the project or creating a custom build.
Build Overview
┌───────────────────────────────────────────────────────────────────────────────┐│ Build Pipeline │├───────────────────────────────────────────────────────────────────────────────┤│ ││ Source Code Build Process Output ││ ──────────── ───────────── ────── ││ ││ ┌──────────────┐ ┌──────────────┐ ┌────────────┐ ││ │ React/TS │─── Vite ───▶│ Bundled │ │ │ ││ │ Frontend │ │ JS/CSS │───┐ │ Platform │ ││ └──────────────┘ └──────────────┘ │ │ Specific │ ││ │─ Tauri ─▶│ Installer │ ││ ┌──────────────┐ ┌──────────────┐ │ │ │ ││ │ Rust │─── Cargo ──▶│ Native │───┘ │ .msi │ ││ │ Backend │ │ Binary │ │ .dmg │ ││ └──────────────┘ └──────────────┘ │ .deb │ ││ └────────────┘ ││ │└────────────────────────────────────────────────────────────────────────────────┘Prerequisites
All Platforms
Ensure you have the following installed:
| Tool | Version | Installation |
|---|---|---|
| Node.js | 18+ | nodejs.org |
| pnpm | 9+ | npm install -g pnpm |
| Rust | Latest stable | rustup.rs |
| Git | Any recent | git-scm.com |
Verify installations:
node --version # Should be 18.x or higherpnpm --version # Should be 9.x or higherrustc --version # Should be 1.70.x or highercargo --version # Should match rustc versionPlatform-Specific Requirements
Microsoft Visual Studio Build Tools
Required for compiling native Rust code:
# Using wingetwinget install Microsoft.VisualStudio.2022.BuildTools
# Or download from:# https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022During installation, select:
- “Desktop development with C++”
WebView2 Runtime
Usually pre-installed on Windows 10/11. If not:
- Download from Microsoft
Xcode Command Line Tools
xcode-select --installThis provides:
- C/C++ compiler (clang)
- Development headers
- Build utilities
Debian/Ubuntu:
sudo apt updatesudo apt install -y \ libwebkit2gtk-4.1-dev \ build-essential \ curl \ wget \ file \ libxdo-dev \ libssl-dev \ libayatana-appindicator3-dev \ librsvg2-devFedora:
sudo dnf install -y \ webkit2gtk4.1-devel \ openssl-devel \ curl \ wget \ file \ libxdo-devel \ libappindicator-gtk3-devel \ librsvg2-develArch Linux:
sudo pacman -S --needed \ webkit2gtk-4.1 \ base-devel \ curl \ wget \ file \ openssl \ appmenu-gtk-module \ libappindicator-gtk3 \ librsvgClone and Setup
-
Clone the repository
Terminal window git clone https://github.com/ModioStudio/MiniFy.gitcd MiniFy -
Install dependencies
Terminal window pnpm installThis installs dependencies for all workspace packages:
apps/desktop- Desktop applicationapps/www- Marketing websiteapps/docs- Documentation site
Development Build
Run the desktop app in development mode with hot reload:
pnpm desktop:devThis command:
- Starts the Vite development server (port 1420)
- Compiles the Rust backend in debug mode
- Opens the development window
- Enables hot module replacement (HMR) for React
┌───────────────────────────────────────────────────────────────────────────────┐│ Development Mode │├───────────────────────────────────────────────────────────────────────────────┤│ ││ Terminal Output: ││ ││ $ pnpm desktop:dev ││ ││ > @minify/desktop@0.1.0 dev ││ > tauri dev ││ ││ Info Watching for file changes... ││ ┌──────────────────────────────────────────┐ ││ │ VITE v5.x.x ready in 500ms │ ││ │ ➜ Local: http://localhost:1420/ │ ││ └──────────────────────────────────────────┘ ││ ││ Compiling minify v0.1.0... ││ Finished `dev` profile [unoptimized + debuginfo] ││ ││ [Window opens with MiniFy application] ││ │└────────────────────────────────────────────────────────────────────────────────┘Development with DevTools
Open the WebView DevTools for debugging:
# Press F12 in the app window# Or right-click → Inspect ElementProduction Build
Build optimized installers for distribution:
pnpm desktop:buildThis creates platform-specific installers:
Output Locations
apps/desktop/src-tauri/target/release/bundle/├── msi/ # Windows installer│ └── MiniFy_x.x.x_x64.msi├── nsis/ # Windows NSIS installer│ └── MiniFy_x.x.x_x64-setup.exe├── dmg/ # macOS disk image│ └── MiniFy_x.x.x_x64.dmg├── macos/ # macOS app bundle│ └── MiniFy.app├── deb/ # Debian package│ └── minify_x.x.x_amd64.deb├── rpm/ # Red Hat package│ └── minify-x.x.x.x86_64.rpm└── appimage/ # Universal Linux └── MiniFy_x.x.x_amd64.AppImageBuild with Embedded Client ID
For official releases, embed the Spotify Client ID at build time:
SPOTIFY_CLIENT_ID=your_client_id pnpm desktop:buildAll Build Scripts
| Script | Description |
|---|---|
pnpm desktop:dev | Run desktop app in development mode |
pnpm desktop:build | Build desktop app for production |
pnpm desktop:clear | Clear all stored credentials (for testing) |
pnpm www:dev | Run website in development mode |
pnpm www:build | Build website for production |
pnpm docs:dev | Run documentation in development mode |
pnpm docs:build | Build documentation for production |
pnpm build | Build all packages |
pnpm dev | Run all packages in development mode |
pnpm check | Run Biome linter and formatter check |
pnpm format | Format all code with Biome |
Environment Variables
Development
Create a .env file in apps/desktop/ for development:
# Optional: Custom Spotify Client ID for developmentVITE_SPOTIFY_CLIENT_ID=your_development_client_idProduction
For production builds, set environment variables before building:
# Required for official releasesSPOTIFY_CLIENT_ID=production_client_id
# Optional: Enable debug loggingRUST_LOG=debugCI/CD Secrets
For GitHub Actions, set these repository secrets:
| Secret | Purpose |
|---|---|
SPOTIFY_CLIENT_ID | Embedded in production builds |
APPLE_SIGNING_IDENTITY | macOS code signing (optional) |
APPLE_ID | macOS notarization (optional) |
WINDOWS_CERTIFICATE | Windows code signing (optional) |
Troubleshooting
Rust Compilation Fails
# Update Rust to latest stablerustup update stable
# Clean Cargo cache and rebuildcd apps/desktop/src-tauricargo cleancd ../../..pnpm desktop:devNode Module Issues
# Remove all node_modules and reinstallrm -rf node_modulesrm -rf apps/*/node_modulespnpm installTauri CLI Issues
# Update Tauri CLIpnpm add -D @tauri-apps/cli@latest -w
# Or reinstallpnpm remove @tauri-apps/clipnpm add -D @tauri-apps/cliPlatform-Specific Issues
“LINK : fatal error LNK1181”
- Install Visual Studio Build Tools with C++ support
- Restart your terminal after installation
WebView2 not found
- Download and install WebView2 from Microsoft
- Restart after installation
“xcrun: error: invalid active developer path”
xcode-select --installCode signing issues
- For development, signing is not required
- For distribution, see Tauri signing docs
“webkit2gtk not found”
# Check if installedpkg-config --modversion webkit2gtk-4.1
# Install if missing (Debian/Ubuntu)sudo apt install libwebkit2gtk-4.1-dev“libayatana-appindicator not found”
sudo apt install libayatana-appindicator3-devBuild Performance
For faster builds during development:
# Use incremental compilation (default in dev mode)pnpm desktop:dev
# For production, use release profile optimizationpnpm desktop:buildCross-Compilation
Tauri supports limited cross-compilation. For best results, build on each target platform:
| Build On | Can Target |
|---|---|
| Windows | Windows only |
| macOS | macOS only |
| Linux | Linux only |
For multi-platform releases, use GitHub Actions with matrix builds:
jobs: build: strategy: matrix: include: - platform: windows-latest - platform: macos-latest - platform: ubuntu-22.04