Skip to content
Tanmay Patel
All work

Case study · Open source · sole developer

DiskGrove

A free desktop disk space analyser that shows where the space went, keeps everything on the user's computer, and never opens or deletes a file without asking.

operating systems from one codebase
3
views of folder sizes
5
of memory per million items scanned
~250 MB

Context

A full disk usually has a few large folders, old downloads and duplicate copies behind it, and finding them means handing a tool every file on the machine. DiskGrove is a disk space analyser that does that job offline: there is no account, telemetry or cloud service, and it works the same way on Windows, macOS and Linux.

I designed and built it on my own, from the scanner and the security boundaries to the installers and the release pipeline, and published it as free software under the MIT licence.

What I built

Five views of a scan
Folder sizes as a tree, a sortable table, a treemap, a pie chart or a bar chart, plus breakdowns by file extension and modification age and a list of the largest files. Unreadable folders are counted, marked and listed rather than silently dropped.
Search
Plain-text or wildcard name search in the selected folder or across the whole scan, ignoring case and Unicode normalisation differences. Results update while the scan is still running, with the largest 2,000 listed beside the total count.
Duplicate finder
Files of the same size are first hashed with SHA-256 over their first megabyte and last 64 KiB, and only the groups that still match are hashed in full, so different content is never reported as a duplicate.
Read-only previews
A side pane previews images, video, audio, PDF, text and code, CSV, Word, Excel, PowerPoint and ZIP contents, with dates, dimensions, duration and document properties. File content is shown as text and tables and never runs.
File actions & reports
Reveal, open, move to Trash or Recycle Bin, or delete permanently, each behind a native confirmation dialog with Cancel as the default. Scans export to CSV, JSON or a standalone HTML report.
Installers & release
Windows NSIS, macOS DMG for Apple silicon and Intel (in beta), Linux AppImage and .deb, each with an uninstaller that asks before removing settings. Pushing a version tag builds every installer in GitHub Actions and attaches it to a draft release with a SHA-256 checksum.

Architecture

  1. Renderer

    • React 19 views

      • tree · table · treemap · pie · bar
      • search · duplicates
    • Preview pane

      • PDF.js in a worker
      • Office and ZIP as text and tables
  2. Preload

    • Typed preload API

      • context isolation · no Node integration
  3. Main process

    • Electron main process

      • IPC checks sender, frame and arguments
      • concurrent scanner → typed-array scan tree
      • SHA-256 sample-then-verify duplicates
      • identity and ancestor checks before file actions
      • native confirmation, Cancel by default
      • media over a private scheme · 16 MiB preview cap
      • atomic settings and report writes
  4. System

    • Filesystem

    • Trash · Recycle Bin

    • Native dialogs

    • File manager

A sandboxed React renderer talks to the Electron main process only through a narrow, typed preload API. All filesystem access lives in the main process, which validates every IPC call before it scans, hashes, previews or touches a file.

Key decisions

  1. A scan tree in typed arrays

    A scan keeps one row per file and folder, stored column by column in typed arrays rather than as objects, with each path rebuilt from the names up the parent chain instead of stored. Rows of objects with full paths took about 470 bytes of heap per item; the columns take well under half of that and the garbage collector never has to trace them, so a scan costs about 250 MB of memory per million items.

  2. The renderer is never trusted

    The renderer runs sandboxed with context isolation and no Node integration, and production builds inject a content security policy and block HTTP, HTTPS and WebSocket requests. Every IPC call checks the sender window and frame and validates its arguments, file actions only accept paths from the current scan, and before opening or deleting anything the main process rechecks the file's identity and ancestors and refuses to traverse symbolic links or junctions.

Results

  • Released as free, open-source software under the MIT licence, with installers for Windows, macOS and Linux.
  • Works entirely offline: no account, telemetry or cloud service, and nothing is opened or deleted without confirmation.
  • Regression tests for scanning, search, exports, previews, IPC boundaries and the uninstall script run on Windows, macOS and Linux in CI.
  • Built entirely by me, from the scanner to the release pipeline.