Skip to content

hwanjongyu/MediaHub

Repository files navigation

🎬 Media Hub

A high-performance, local-first media management tool built with Tauri, Rust, and React.

Media Hub is designed to index and browse massive local media libraries (100,000+ files) with zero lag, low memory usage, and a premium "glassmorphic" UI.

Media Hub Interface

🚀 Key Features

  • ⚡ Ultra-Fast Scanning: Uses Rust's WalkDir and Rayon (Parallel Iterator) to index thousands of files per second.
  • 🧠 Memory Efficient: Streaming architecture keeps RAM usage low, even for huge libraries.
  • 🖼️ Virtualized Grid: Frontend uses react-window to render only visible items, ensuring 60fps scrolling regardless of library size.
  • 🔒 Secure Streaming: Custom gallery:// protocol serves local files securely without exposing the filesystem or using heavy base64 payloads.
  • 💾 Persistent Index: SQLite database (via sqlx in WAL mode) stores metadata for instant startup and searching.
  • 🎨 Rich Aesthetics: Modern, dark-mode-first UI with CSS variables and smooth transitions.

🛠️ Tech Stack

  • Backend: Rust (Tauri v2)
    • tokio (Async runtime)
    • rayon (Parallel processing)
    • sqlx (SQLite3)
    • image (Thumbnail generation)
  • Frontend: React + TypeScript (Vite)
    • react-window (Virtualization)
    • react-virtualized-auto-sizer
  • Styling: Vanilla CSS (CSS Modules + Variables)

📦 Installation & Setup

Prerequisites

  • Node.js (v18+)
  • Rust (Stable)
  • System dependencies for Tauri (likely installed if you develop on Linux/macOS/Windows).

Development

  1. Install Dependencies

    npm install
  2. Run Development Server

    npm run tauri dev

    This starts the Vite server and compiles the Rust backend.

Building

npm run tauri build

📂 Project Structure

  • src-tauri/ - Rust Backend
    • src/scanner.rs - File crawler logic.
    • src/protocol.rs - gallery:// handler.
    • src/db.rs - Database connection & migrations.
  • src/ - React Frontend
    • components/MediaGrid.tsx - Virtualized grid.
    • components/LazyImage.tsx - Optimized image component.

🛠️ Maintenance

Resetting the Database

If you need to clear your media index and start fresh, you can delete the local database and caches.

Linux:

# Remove the database file
rm ~/.local/share/temp_app/media.db

# Remove cached thumbnails
rm -rf ~/.local/share/temp_app/cache/thumbnails

Note: The database file media.db and the cache folder will be recreated automatically on the next launch.

📄 License

MIT

About

High-performance, local-first media management tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors