Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/xcoder-es/media-cleaner-pro/llms.txt

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

MediaCleaner Pro is a Cargo workspace written in Rust. Building from source produces a single self-contained native binary that embeds the frontend assets, the SQLite engine, and all processing logic — no separate runtime or service is required. The steps below assume you have a working Rust toolchain; everything else is handled by Cargo.

Prerequisites

  • Rust 1.75 or later — install via rustup.rs. Run rustup update stable to make sure you are on a recent stable release.
  • Node.js 18+ (optional) — only needed if you want to rebuild the browser UI from its source. If Node.js is not available, a fully-functional placeholder frontend is compiled in automatically.

Building

1

Clone the repository

git clone https://github.com/xcoder-es/media-cleaner-pro.git
cd media-cleaner-pro
2

Build in release mode

cargo build --release
Cargo resolves all workspace dependencies, compiles both library crates (mc-core and mc-infra), and links the final binary. The release profile applies maximum optimisations (see Release profile below), so the first build takes a few minutes.
3

Run the binary

The compiled binary is placed at:
target/release/mediacleaner-pro
Run it directly — on first launch it creates a .env file and the data/source/ and data/output/ directories, then starts the web server on http://127.0.0.1:8080.
./target/release/mediacleaner-pro

Optional: Rebuilding the Frontend

The browser UI lives in the frontend/ directory. When frontend/dist/ is present at compile time, rust-embed bakes those assets directly into the binary. If the directory is absent, build.rs checks for bun first, then falls back to npm. If neither is found, it writes a minimal single-file placeholder UI into frontend/dist/ and continues the build — so Node.js is never a hard requirement. To build and embed the full UI yourself:
cd frontend
npm install
npm run build
cd ..
cargo build --release
After this, the binary at target/release/mediacleaner-pro serves the full production frontend from memory without touching the filesystem.
If you are iterating on the frontend only, you can run the dev server from the frontend/ directory and point it at a running mediacleaner-pro process — no Rust rebuild required.

Cargo Features

The workspace Cargo.toml defines two optional feature flags. No optional features are enabled in the default build.
FeatureDescriptionHow to enable
supabaseEnables Supabase integration. Pulls in reqwest 0.12 as an HTTP client for talking to Supabase REST and Auth endpoints.--features supabase
cloudReserved placeholder for future cloud/SaaS features. Enables no additional code today.--features cloud
To build with Supabase support:
cargo build --release --features supabase
You can combine flags:
cargo build --release --features supabase,cloud

Workspace Structure

The repository is a Cargo workspace with three members:

mediacleaner-pro (root)

Main binary crate. Contains the Axum HTTP server, API routes, SSE progress streaming, the streaming pipeline runner, the job state machine, and the Temporal client integration.

packages/mc-core

Domain library. Pure Rust — no filesystem access, no network I/O. Defines all domain types, port traits, the PipelineStage interface, and the 10-stage processor logic as pure functions.

packages/mc-infra

Adapter library. Provides concrete implementations of every port trait: local filesystem via tokio::fs, SHA-256 via sha2, dHash via the image crate, SQLite via rusqlite, recursive file scanning via walkdir, and the in-process notification bus.

Key Dependencies

The table below lists the most significant dependencies declared in the root Cargo.toml.
CrateVersionRole
axum0.7Async HTTP server and router (with WebSocket feature enabled)
tokio1.38Async runtime (full feature: all executors, timers, channels, fs)
image0.25Image decoding — jpeg, png, bmp, webp, gif
rayon1.10Data-parallel CPU work; pipeline CPU stages run off the async scheduler via tokio::task::block_in_place
sha20.10SHA-256 exact-duplicate hashing
rusqlite0.31SQLite with the bundled feature — no system SQLite required
utoipa5Derives OpenAPI 3.1 specs directly from Axum handler types
rust-embed8Embeds frontend/dist/ assets into the binary at compile time

Release Profile

The release profile in Cargo.toml is configured for maximum single-binary performance:
[profile.release]
opt-level = 3
lto = true
codegen-units = 1
strip = true
lto = true enables link-time optimisation across all crates in the workspace. codegen-units = 1 forces a single code-generation unit, giving LLVM the full picture for inlining decisions. strip = true removes debug symbols from the output, keeping the binary compact.
For day-to-day development, skip --release and use cargo build (debug mode). Debug builds skip LTO and use multiple codegen units, so incremental recompilation is much faster. The binary is slower at runtime but perfectly usable for testing logic changes.

Build docs developers (and LLMs) love