Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/adileo/squirreldisk/llms.txt

Use this file to discover all available pages before exploring further.

Development Setup

This guide will help you set up your local development environment to start contributing to SquirrelDisk.

Prerequisites

Before you begin, ensure you have the following installed:
SquirrelDisk’s frontend is built with React and Vite, which require Node.js.Installation:Verify installation:
node --version
npm --version
SquirrelDisk’s backend is built with Rust. You’ll need the Rust toolchain installed.Installation:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Verify installation:
rustc --version
cargo --version
Learn more at rust-lang.org
Tauri is the framework that bridges Rust and React in SquirrelDisk.Installation: The Tauri CLI is included in the project’s dependencies and will be installed automatically with npm install.Learn more at tauri.app
  • Microsoft Visual Studio C++ Build Tools: Required for Rust compilation
  • Download from Visual Studio downloads
  • Select “Desktop development with C++” during installation

Getting Started

1. Clone the Repository

First, fork the repository on GitHub, then clone your fork:
git clone https://github.com/YOUR_USERNAME/squirreldisk.git
cd squirreldisk
Add the upstream repository as a remote:
git remote add upstream https://github.com/adileo/squirreldisk.git

2. Install Dependencies

Install the Node.js dependencies:
npm install
This will install all required packages, including:
  • React and React DOM
  • Vite (build tool)
  • D3.js (visualization library)
  • Tauri CLI
  • TypeScript and type definitions
  • Tailwind CSS
Rust dependencies are managed by Cargo and will be downloaded automatically when you first build the project.

3. Run in Development Mode

Start the development server:
npm run tauri dev
This command will:
  1. Start the Vite development server for the React frontend
  2. Compile the Rust backend
  3. Launch the SquirrelDisk application window
  4. Enable hot module replacement (HMR) for frontend changes
The first build may take several minutes as Cargo downloads and compiles all Rust dependencies.

4. Making Changes

Frontend code is located in src/:
  • src/components/ - React components (DiskList, DiskDetail, TitleBar, etc.)
  • src/d3chart.ts - D3.js sunburst chart implementation
  • src/App.tsx - Main application component
  • src/main.tsx - Application entry point
Changes to React/TypeScript files will automatically reload with HMR.

5. Building for Production

Create a production build:
npm run tauri build
This will:
  1. Build the React frontend for production (TypeScript compilation + Vite build)
  2. Compile the Rust backend with optimizations
  3. Create platform-specific installers in src-tauri/target/release/:
    • Windows: .exe and .msi installers
    • macOS: .dmg and .app bundle
    • Linux: .deb, .appimage, and other formats
Production builds take significantly longer than development builds due to optimization passes.

Project Structure

Here’s an overview of the project structure:
squirreldisk/
├── src/                          # Frontend source code (React + TypeScript)
│   ├── components/               # React components
│   │   ├── DiskList.tsx         # Disk selection list
│   │   ├── DiskDetail.tsx       # Disk detail view with chart
│   │   ├── DiskItem.tsx         # Individual disk item
│   │   ├── FileLine.tsx         # File list item
│   │   ├── TitleBar.tsx         # Custom window title bar
│   │   └── ParentFolder.tsx     # Parent folder navigation
│   ├── assets/                  # Images and icons
│   ├── d3chart.ts              # D3.js sunburst chart logic
│   ├── pruneData.ts            # Data processing utilities
│   ├── App.tsx                 # Main app component
│   └── main.tsx                # Entry point
├── src-tauri/                   # Backend source code (Rust + Tauri)
│   ├── src/
│   │   ├── main.rs             # Tauri setup and commands
│   │   ├── scan.rs             # Disk scanning implementation
│   │   └── window_style.rs     # Window styling (shadows, rounded corners)
│   ├── Cargo.toml              # Rust dependencies
│   ├── tauri.conf.json         # Tauri configuration
│   └── icons/                  # Application icons
├── public/                      # Static assets
├── package.json                # Node.js dependencies and scripts
├── tsconfig.json               # TypeScript configuration
├── vite.config.ts              # Vite configuration
├── tailwind.config.cjs         # Tailwind CSS configuration
└── README.md                   # Project readme

Common Development Tasks

To debug the frontend, uncomment this line in src-tauri/src/main.rs:
window.open_devtools();
Then restart the app. The Chrome DevTools will open automatically.
Rust logs are printed to the terminal where you ran npm run tauri dev.Add logging with:
println!("Debug message: {:?}", variable);
Run Rust tests from the src-tauri directory:
cd src-tauri
cargo test
TypeScript/React:
npm run build
This runs TypeScript type checking.Rust:
cd src-tauri
cargo clippy
cargo fmt --check
Frontend:
npm update
Backend:
cd src-tauri
cargo update

Troubleshooting

Solution:
  • Ensure all prerequisites are installed correctly
  • On Linux, double-check that all system libraries are installed
  • Try cargo clean in the src-tauri directory and rebuild
  • Check the Tauri prerequisites guide
Solution:
  • Restart the development server
  • Check for TypeScript errors in the terminal
  • Clear Vite cache: rm -rf node_modules/.vite
Solution:
  • Update Rust: rustup update
  • Clear Cargo cache: cargo clean in src-tauri/
  • Ensure you’re using Rust 1.57 or higher
Solution:
  • Delete node_modules and run npm install again
  • Delete src-tauri/target and rebuild
  • Check that your Node.js version is compatible (v16+)

Next Steps

Architecture

Learn about SquirrelDisk’s architecture and how components interact

Find Issues

Browse open issues and find something to work on