A premium, high-performance media management system for the heavy collectors.
Effortlessly organize, scan, and view millions of images, mangas, and videos with a self-hosted platform built for speed and reliability.
ImageViewer is not just another image gallery; it's a distributed powerhouse designed to handle massive libraries. Whether you're managing a 2,000,000+ item art collection, a multi-terabyte manga library, or a video archive, ImageViewer scales with your needs.
- π Manga & Comics: Seamless paging, double-view modes, and archive support (ZIP, CBZ, CBR).
- π¨ Art & Illustrations: High-fidelity thumbnail generation, nested collection discovery, and infinite scroll.
- π¬ Video Management: Integrated video support for unified media library oversight.
- π Self-Hosting First: Complete control over your data with Docker-ready deployment and local storage.
- Smart Incremental Rebuild: 30 min full scan reduced to 3 seconds daily (600x faster).
- Atomic Caching: Distributed Redis caching with zero-leak memory management.
- Background Processing: Multi-stage RabbitMQ pipeline (Scan β Process β Thumbnail β Cache).
- Dynamic Layouts: Single, Double, Triple, or Quad-view modes.
- Control Modes: Toggle between Continuous Scroll and Classic Paging.
- Cross-Collection Navigation: Fluid browsing across different collections and folders.
- Hotkeys First: Full keyboard control (Shuffle with
Ctrl+Shift+R, Mode toggle with numbers).
- Admin Dashboard: Real-time Hangfire job monitoring and library stats.
- Incremental Indexing: Selective rebuilds and consistency verification (Verify Mode).
- Multi-Level Cache: Tailored quality settings with auto-source analysis.
- π Main Storage: MongoDB 7.0 - Utilizing document-based collections for flexible metadata.
- π° Message Broker: RabbitMQ 3.12 - Orchestrating heavy background image processing tasks.
- π Caching & State: Redis 7.2 - Fast indexing and distributed session/state management.
ImageViewer follows a strict separation of concerns, ensuring that business logic remains independent of external frameworks and databases.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Presentation Layer β
β β’ ImageViewer.Api (REST + JWT) β’ React Frontend (Vite + TS) β
βββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ
β Application Layer β
β β’ Use Cases & Services β’ DTOs & Mappings β
βββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ
β Domain Layer β
β β’ Entities & Value Objects β’ Domain Logic & Interfaces β
βββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ
β Infrastructure Layer β
β β’ MongoDB Repositories β’ RabbitMQ Messaging β
β β’ Redis Indexing Service β’ File System Operations β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The system uses an asynchronous, message-driven approach to handle heavy media processing without blocking the user interface.
graph TD
Client[React Frontend] <--> API[.NET 9 API]
API <--> Mongo[(MongoDB)]
API <--> Redis[(Redis)]
API -- "Publish Tasks" --> MQ[RabbitMQ]
MQ -- "Scaleable Processing" --> Worker[Worker Services]
Worker -- "Storage Access" --> Storage[Local Storage]
Scheduler[Hangfire Scheduler] -- "Cron Triggers" --> API
To achieve high performance with millions of records, we utilize a highly optimized embedded document strategy:
- Aggregated Collections: Media items (images/videos) are embedded directly within the Collection document.
- Atomic Operations: Statistics (counts, sizes) are updated using atomic
$incoperators. - Single-Trip Retrieval: A single query fetches the collection, its metadata, and all media pointers.
ImageViewer is constantly evolving. Here is what we are working on:
- Smart Incremental Rebuilds: Minimize indexing time and memory usage.
- Archive Support: ZIP, CBZ, CBR, 7z extraction and viewing.
- AI-Powered Tagging: Automatic image classification and OCR for manga text search.
- Native Mobile Apps: Smooth scrolling experience for Android and iOS.
- Multi-User Collaboration: Shared libraries with granular permission models.
- Advanced Video Transcoding: On-the-fly streaming for various formats.
The fastest way to get ImageViewer running locally:
git clone https://github.com/letuhao/media-management.git
cd media-managementdocker-compose up -dThis starts MongoDB, RabbitMQ, Redis, API, Worker, and Frontend.
- Web UI:
http://localhost:3000 - API Docs:
http://localhost:5000/swagger - Dashboard:
http://localhost:5000/hangfire
| Metric | Before Optimization | After Optimization | Improvement |
|---|---|---|---|
| Daily Rebuild Time | 30 minutes | 3 seconds | 600x π |
| Peak Memory Usage | 40 GB | 120 MB | 333x πΎ |
| Memory Leakage | 37 GB / hour | 0.0 GB | Solid stable β |
| Collection Capacity | - | 25,000+ | Tested πͺ |
| Media File Capacity | - | 2,000,000+ | Tested πͺ |
| Key | Action |
|---|---|
1 - 4 |
Switch View Modes (Single to Quad) |
β β |
Previous / Next Item |
Ctrl+Shift+R |
Navigate to Random Collection (Shuffle) |
Space |
Toggle Slideshow |
R |
Rotate Image 90Β° |
0 |
Reset Zoom |
ImageViewer is highly configurable via .env or appsettings.json.
CACHE_QUALITY=85 # Balance between quality and storage
THUMBNAIL_WIDTH=200 # Fast loading grid view
HANGFIRE_JOB_SYNC_INTERVAL=5 # Real-time state synchronization
REDIS_MAX_MEMORY=48gb # For massive 2M+ file indexingWe welcome contributions! Please see our Organization Log to understand the project structure and CONTRIBUTING.md for guidelines.
Distributed under the MIT License. See LICENSE for more information.
Built with β€οΈ by LΓͺ TΓΊ HΓ o
