Skip to content

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:

ToolVersionInstallation
Node.js18+nodejs.org
pnpm9+npm install -g pnpm
RustLatest stablerustup.rs
GitAny recentgit-scm.com

Verify installations:

Terminal window
node --version # Should be 18.x or higher
pnpm --version # Should be 9.x or higher
rustc --version # Should be 1.70.x or higher
cargo --version # Should match rustc version

Platform-Specific Requirements

Microsoft Visual Studio Build Tools

Required for compiling native Rust code:

Terminal window
# Using winget
winget install Microsoft.VisualStudio.2022.BuildTools
# Or download from:
# https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022

During installation, select:

  • “Desktop development with C++”

WebView2 Runtime

Usually pre-installed on Windows 10/11. If not:

Clone and Setup

  1. Clone the repository

    Terminal window
    git clone https://github.com/ModioStudio/MiniFy.git
    cd MiniFy
  2. Install dependencies

    Terminal window
    pnpm install

    This installs dependencies for all workspace packages:

    • apps/desktop - Desktop application
    • apps/www - Marketing website
    • apps/docs - Documentation site

Development Build

Run the desktop app in development mode with hot reload:

Terminal window
pnpm desktop:dev

This command:

  1. Starts the Vite development server (port 1420)
  2. Compiles the Rust backend in debug mode
  3. Opens the development window
  4. 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:

Terminal window
# Press F12 in the app window
# Or right-click → Inspect Element

Production Build

Build optimized installers for distribution:

Terminal window
pnpm desktop:build

This 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.AppImage

Build with Embedded Client ID

For official releases, embed the Spotify Client ID at build time:

Terminal window
SPOTIFY_CLIENT_ID=your_client_id pnpm desktop:build

All Build Scripts

ScriptDescription
pnpm desktop:devRun desktop app in development mode
pnpm desktop:buildBuild desktop app for production
pnpm desktop:clearClear all stored credentials (for testing)
pnpm www:devRun website in development mode
pnpm www:buildBuild website for production
pnpm docs:devRun documentation in development mode
pnpm docs:buildBuild documentation for production
pnpm buildBuild all packages
pnpm devRun all packages in development mode
pnpm checkRun Biome linter and formatter check
pnpm formatFormat all code with Biome

Environment Variables

Development

Create a .env file in apps/desktop/ for development:

Terminal window
# Optional: Custom Spotify Client ID for development
VITE_SPOTIFY_CLIENT_ID=your_development_client_id

Production

For production builds, set environment variables before building:

Terminal window
# Required for official releases
SPOTIFY_CLIENT_ID=production_client_id
# Optional: Enable debug logging
RUST_LOG=debug

CI/CD Secrets

For GitHub Actions, set these repository secrets:

SecretPurpose
SPOTIFY_CLIENT_IDEmbedded in production builds
APPLE_SIGNING_IDENTITYmacOS code signing (optional)
APPLE_IDmacOS notarization (optional)
WINDOWS_CERTIFICATEWindows code signing (optional)

Troubleshooting

Rust Compilation Fails

Terminal window
# Update Rust to latest stable
rustup update stable
# Clean Cargo cache and rebuild
cd apps/desktop/src-tauri
cargo clean
cd ../../..
pnpm desktop:dev

Node Module Issues

Terminal window
# Remove all node_modules and reinstall
rm -rf node_modules
rm -rf apps/*/node_modules
pnpm install

Tauri CLI Issues

Terminal window
# Update Tauri CLI
pnpm add -D @tauri-apps/cli@latest -w
# Or reinstall
pnpm remove @tauri-apps/cli
pnpm add -D @tauri-apps/cli

Platform-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

Build Performance

For faster builds during development:

Terminal window
# Use incremental compilation (default in dev mode)
pnpm desktop:dev
# For production, use release profile optimization
pnpm desktop:build

Cross-Compilation

Tauri supports limited cross-compilation. For best results, build on each target platform:

Build OnCan Target
WindowsWindows only
macOSmacOS only
LinuxLinux 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

Next Steps