Skip to content

aryan3939/CompressDecompressMeApp

Repository files navigation

๐Ÿ—œ๏ธ Data Compression & Decompression Web Application

A sophisticated, production-ready web application for exploring and applying various compression algorithms. Built with React, TypeScript, and Tailwind CSS, this educational tool provides interactive demonstrations, detailed algorithm analysis, and practical compression capabilities.


โšก Live Demo

https://compress-decompress-me-app.vercel.app/

๐ŸŽฅ Video Demo

https://www.youtube.com/watch?v=dwV-HAYMqwU


โœจ Features

๐ŸŽฏ Core Functionality

  • Multi-Algorithm Support: RLE, Huffman, LZ77, DEFLATE, and LZ4 compression algorithms
  • Dual Mode Operation: Compress files or decompress previously compressed files
  • Real-time Processing: Interactive compression with progress tracking
  • File Analysis: Detailed entropy analysis, byte frequency distribution, and compression potential assessment
  • Performance Metrics: Speed, efficiency, and compression ratio comparisons
  • Educational Content: Interactive algorithm demonstrations and comprehensive explanations

๐ŸŽจ User Experience

  • Dark/Light Theme: Automatic system preference detection with manual toggle
  • Responsive Design: Optimized for desktop, tablet, and mobile devices
  • Drag & Drop: Intuitive file upload with visual feedback
  • Progress Tracking: Real-time compression progress with algorithm-specific optimizations
  • Visual Analytics: Charts and graphs for performance comparison and file analysis

๐Ÿ“Š Advanced Analytics

  • Entropy Calculation: Information theory analysis for compression potential
  • Byte Distribution: Complete histogram of file content
  • Pattern Recognition: Identification of repeated sequences and structures
  • Algorithm Recommendations: Smart suggestions based on file type and characteristics
  • Performance Comparison: Side-by-side algorithm efficiency analysis

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn package manager

Installation

  1. Clone the repository
    git clone https://github.com/aryan3939/CompressDecompressMeApp
    cd CompressDecompressMeApp
  2. Install dependencies
    npm install
  3. Start development server
    npm run dev
  4. Open in browser Navigate to http://localhost:5173

Build for Production

npm run build
npm run preview

๐Ÿงฎ Compression Algorithms

1. Run-Length Encoding (RLE)

Complexity: Low | Speed: Fast | Compression: Low

How It Works: Run-Length Encoding (RLE) identifies consecutive identical bytes and replaces them with a count and the byte value. Effective for data with long runs of identical values.

Example: WWWWWWWWWWBBBBBRRRRRRRRRRR โ†’ 10W5B10R

Best Use Cases:

  • Images with solid colors
  • Fax transmissions
  • Binary data with repetition
  • Video compression (static backgrounds)
  • Medical imaging

2. Huffman Coding

Complexity: Medium | Speed: Medium | Compression: Medium

How It Works: Huffman Coding assigns shorter binary codes to more frequent symbols, using a binary tree. Optimal for data with skewed frequency distributions.

Example: 'ABRACADABRA' โ†’ 010110100010101011

Best Use Cases:

  • Text files
  • JPEG compression
  • MP3 audio
  • Network protocols
  • Database systems

3. LZ77

Complexity: High | Speed: Medium | Compression: High

How It Works: LZ77 uses a sliding window to find and encode repeated sequences as references to previous data.

Example: 'ABCABCABCABC' โ†’ (0,0,A)(0,0,B)(0,0,C)(3,3,A)...

Best Use Cases:

  • ZIP files
  • gzip compression
  • PNG images
  • Backup software
  • Version control

4. DEFLATE

Complexity: High | Speed: Medium | Compression: High

How It Works: DEFLATE combines LZ77 pattern matching with Huffman coding for optimal compression.

Example: Text with repeated headers and common letters is compressed in two stages: LZ77 then Huffman.

Best Use Cases:

  • ZIP archives
  • Web compression (gzip)
  • PNG images
  • PDF files
  • Office documents

5. LZ4

Complexity: Medium | Speed: Fast | Compression: Low

How It Works: LZ4 is a high-speed algorithm that quickly finds 'good enough' matches, prioritizing speed over ratio.

Example: 10MB file: 70% compression in 2s (traditional) vs 50% in 0.1s (LZ4)

Best Use Cases:

  • Real-time systems
  • Database storage
  • High-performance computing
  • Network appliances
  • Container technologies

๐ŸŽ“ Educational Features

Interactive Algorithm Visualization

  • Step-by-step demonstrations
  • Customizable input
  • Visual feedback
  • Progress tracking

Information Theory Concepts

  • Entropy calculation
  • Frequency analysis
  • Compression trade-offs
  • Pattern recognition

Performance Analytics

  • Compression ratio comparison
  • Speed benchmarking
  • Memory usage
  • Efficiency scoring

๐Ÿ› ๏ธ Technical Architecture

Frontend Stack

  • React 18.3.1
  • TypeScript 5.5.3
  • Tailwind CSS 3.4.1
  • Vite 5.4.2
  • Lucide React

Key Libraries

  • Recharts 2.8.0
  • ESLint
  • PostCSS

Algorithm Implementation

  • Optimized performance
  • Memory management (up to 100MB)
  • Error handling
  • Progress tracking
  • Web Worker compatibility

File Processing

  • Multiple format support
  • Drag & drop interface
  • File type detection
  • Size validation (100MB limit)
  • Compression detection

๐Ÿ“ Project Structure

src/
โ”œโ”€โ”€ algorithms/           # Compression algorithm implementations
โ”‚   โ”œโ”€โ”€ deflate.ts       # DEFLATE (LZ77 + Huffman)
โ”‚   โ”œโ”€โ”€ huffman.ts       # Huffman coding
โ”‚   โ”œโ”€โ”€ lz77.ts          # LZ77 sliding window
โ”‚   โ”œโ”€โ”€ lz4.ts           # LZ4 high-speed compression
โ”‚   โ”œโ”€โ”€ rle.ts           # Run-length encoding
โ”‚   โ””โ”€โ”€ index.ts         # Algorithm orchestration
โ”œโ”€โ”€ components/          # React components
โ”‚   โ”œโ”€โ”€ visualizations/  # Chart and analysis components
โ”‚   โ”œโ”€โ”€ AlgorithmSelector.tsx
โ”‚   โ”œโ”€โ”€ CompressionResults.tsx
โ”‚   โ”œโ”€โ”€ EducationalPanel.tsx
โ”‚   โ”œโ”€โ”€ FileUpload.tsx
โ”‚   โ””โ”€โ”€ ProgressIndicator.tsx
โ”œโ”€โ”€ context/             # React context providers
โ”‚   โ””โ”€โ”€ ThemeContext.tsx # Dark/light theme management
โ”œโ”€โ”€ data/                # Static data and configurations
โ”‚   โ””โ”€โ”€ algorithms.ts    # Algorithm metadata and explanations
โ”œโ”€โ”€ types/               # TypeScript type definitions
โ”‚   โ””โ”€โ”€ index.ts
โ”œโ”€โ”€ utils/               # Utility functions
โ”‚   โ””โ”€โ”€ fileUtils.ts     # File processing and validation
โ””โ”€โ”€ App.tsx              # Main application component

๐Ÿ“„ License

MIT License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages