Skip to main content

Prerequisites

Before building Scratch, ensure you have the following installed:

Required Tools

1

Node.js 18+

Download and install from nodejs.org or use a version manager like nvm:
node --version  # Should be 18.0.0 or higher
2

Rust 1.70+

Install via rustup (recommended):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustc --version  # Should be 1.70.0 or higher

Platform-Specific Requirements

# Xcode Command Line Tools
xcode-select --install

# Verify installation
xcode-select -p

Clone the Repository

git clone https://github.com/erictli/scratch.git
cd scratch

Install Dependencies

Install Node.js dependencies:
npm install
The first build will also download and compile Rust dependencies, which may take several minutes.

Development Build

Run in Development Mode

Start the app with hot-reload enabled:
npm run tauri dev
This command:
  • Starts the Vite dev server for the frontend
  • Compiles the Rust backend
  • Launches the app in development mode
  • Enables hot-reload for both frontend and backend changes

Frontend Only (Optional)

To develop the frontend UI without the Tauri backend:
npm run dev
This mode is useful for UI development but Tauri commands will not work.

Production Build

Build Release Binary

1

Build the application

npm run tauri build
This compiles both the frontend and backend with optimizations enabled.
2

Locate the binaries

Built applications are located in src-tauri/target/release/bundle/:
  • macOS: dmg/ and macos/
  • Windows: nsis/ (installer) and msi/
  • Linux: appimage/ and deb/

Platform-Specific Builds

# Build for both Intel and Apple Silicon
npm run tauri build -- --target universal-apple-darwin

# Output: src-tauri/target/universal-apple-darwin/release/bundle/

Development Commands

Frontend Commands

# Start frontend development server only
npm run dev

# Server runs on http://localhost:1420

Tauri Commands

# Run full app in development mode
npm run tauri dev

Troubleshooting

Build Fails on macOS

Issue: xcode-select: error: tool 'xcodebuild' requires Xcode Solution: Install Xcode Command Line Tools:
xcode-select --install

Build Fails on Windows

Issue: WebView2 not found Solution: Install WebView2 Runtime from Microsoft

Build Fails on Linux

Issue: Missing development libraries Solution: Install required system dependencies (see Platform-Specific Requirements above)

Rust Compilation Errors

Issue: Outdated Rust toolchain Solution: Update Rust:
rustup update stable

Node Module Issues

Issue: Dependency conflicts or corrupted modules Solution: Clean install:
rm -rf node_modules package-lock.json
npm install

Next Steps

Architecture

Learn about Scratch’s technical architecture

Contributing

Read the contributing guidelines

Build docs developers (and LLMs) love