Created by Salimuddin - Full-Stack Developer & Media Processing Expert
A comprehensive, modern media conversion platform built with Node.js and React. Features professional-grade architecture with properly named services and clean code structure.
- Format Conversion: JPEG, PNG, WebP, AVIF, GIF, BMP, TIFF, SVG
- Image Manipulation: Resize, crop, rotate, optimize, apply effects
- Intelligent Service Selection: Automatically chooses optimal processing library (Sharp, Jimp, ImageMagick)
- Batch Processing: Convert multiple files simultaneously
- Advanced Effects: Filters, overlays, watermarks, text addition
- Format Conversion: MP4, AVI, MOV, WebM, MKV, M4V, 3GP, FLV
- Video Manipulation: Split, merge, resize, quality adjustment
- Scene Detection: Intelligent video segmentation
- Frame Extraction: Extract specific frames or sequences
- Web Optimization: Multiple quality presets for web delivery
- GIF Creation: Convert videos/images to animated GIFs
- Frame Manipulation: Extract, edit, and reassemble GIF frames
- Optimization: Size and quality optimization for web
- Scene Filtering: Smart frame selection based on content analysis
- Text Overlay: Add animated text to GIFs
- Consolidated Services: Replaced 20+ duplicate services with 3 unified processors
- Intelligent Service Selection: Automatic optimal library selection based on operation and file characteristics
- Event-Driven Processing: Real-time progress tracking and status updates
- Clean API Design: RESTful endpoints with comprehensive error handling
- Factory Pattern: Centralized service management and configuration
π¦ GIF converter/
βββ π backend/ # Node.js Express API
β βββ π src/
β β βββ π controllers/ # Request handlers
β β β βββ π webpController.js # WebP-specific operations
β β βββ π routes/ # API route definitions (NEW PROPER NAMING!)
β β β βββ π ConversionRoutes.js # Main conversion endpoints
β β β βββ π SplitRoutes.js # Video/GIF splitting operations
β β β βββ π VideoRoutes.js # Video processing endpoints
β β β βββ π AiRoutes.js # AI-powered enhancements
β β β βββ π TextRoutes.js # Text processing operations
β β β βββ π FileRoutes.js # File management endpoints
β β β βββ π WebpRoutes.js # WebP conversion routes
β β βββ π services/ # Core processing services (COMPLETELY REFACTORED!)
β β β βββ π ImageProcessingService.js # Unified image processing
β β β βββ π VideoProcessingService.js # Unified video processing
β β β βββ π GifProcessingService.js # Unified GIF processing
β β β βββ π AiService.js # AI-powered enhancements
β β β βββ π CleanupService.js # File cleanup management
β β β βββ π ConversionService.js # General conversion utilities
β β β βββ π EditService.js # Image editing operations
β β β βββ π FfmpegService.js # FFmpeg wrapper service
β β β βββ π GifService.js # Advanced GIF operations
β β β βββ π SplitService.js # Media splitting utilities
β β β βββ π TextService.js # Text overlay processing
β β β βββ π VideoService.js # Video manipulation tools
β β β βββ π WebPService.js # WebP format handling
β β β βββ π SharpService.js # Sharp image processing
β β β βββ π JimpService.js # Pure JS image processing
β β β βββ π ImageMagickService.js # ImageMagick integration
β β β βββ π EnhancedConversionService.js # Advanced conversions
β β β βββ π EnhancedJimpService.js # Extended Jimp functionality
β β β βββ π MediaAnalysisService.js # Media analysis tools
β β β βββ π CanvasGraphicsService.js # Canvas-based graphics
β β β βββ π VideoJSService.js # Video.js integration
β β β βββ οΏ½ VideoSplitterService.js # Video splitting utilities
β β β βββ π index.js # ServiceFactory & Registry
β β βββ π utils/ # Utility libraries (RENAMED FROM lib/)
β β β βββ π FilePathUtils.js # Centralized file management
β β βββ π middleware/ # Express middleware (PROPER NAMING!)
β β β βββ οΏ½ ErrorHandler.js # Error handling middleware
β β β βββ π FileValidator.js # File validation middleware
β β βββ οΏ½π config/ # Configuration files
β β β βββ π index.js # Main configuration
β β βββ π app.js # Express application setup
β β βββ π server.js # Server entry point
β βββ π package.json
β βββ π eslint.config.js
βββ π frontend/ # React SPA
β βββ π src/
β β βββ π components/ # React components (RENAMED & ORGANIZED!)
β β β βββ π MainConversionInterface.jsx # Main conversion UI
β β β βββ π ProgressVisualization.jsx # Progress tracking
β β β βββ π MainNavigation.jsx # Navigation component
β β β βββ π ImageEditor.jsx # Image editing interface
β β β βββ π FileManager.jsx # File management UI
β β β βββ π VideoToGifConverter.jsx # Video to GIF converter
β β β βββ π WebPConverter.jsx # WebP conversion UI
β β β βββ π GifSplitter.jsx # GIF splitting interface
β β β βββ π AddText.jsx # Text overlay component
β β β βββ π AdvancedUploadArea.jsx # Advanced file upload
β β β βββ οΏ½ Footer.jsx # Footer component
β β β βββ π Header.jsx # Header component
β β β βββ π HomePage.jsx # Home page component
β β β βββ π Results.jsx # Results display
β β β βββ π Sidebar.jsx # Sidebar navigation
β β β βββ π SplitResults.jsx # Split results display
β β β βββ π UploadArea.jsx # File upload area
β β β βββ π VideoResults.jsx # Video results display
β β βββ οΏ½π utils/ # Frontend utilities
β β β βββ π NotificationService.js # Notification system
β β β βββ π polishedHelpers.js # UI helper functions
β β βββ π App.jsx # Main application component
β β βββ π main.jsx # React entry point
β β βββ π aio-convert-style.css # Main stylesheet
β βββ π package.json
β βββ π vite.config.js
β βββ π index.html
βββ π logs/ # Application logs
βββ π output/ # Processed file output
βββ π public/ # Static assets
β βββ π static/
βββ π temp/ # Temporary processing files
βββ π uploads/ # Uploaded files
βββ π README.md # This file
βββ π ARCHITECTURE.md # Detailed architecture documentation
βββ π package.json # Root package configuration
- Node.js 18+ and npm
- FFmpeg (for video processing)
- ImageMagick (for advanced image operations)
cd backend
npm install
npm run dev # Development server with hot reload
npm start # Production servercd frontend
npm install
npm run dev # Development server with hot reload
npm run build # Production buildCreate .env files in both backend and frontend directories:
Backend .env:
NODE_ENV=development
PORT=3001
OPENAI_API_KEY=your_openai_key_here
MAX_FILE_SIZE_MB=500
MAX_BATCH_COUNT=20Frontend .env:
VITE_API_BASE_URL=http://localhost:3001
VITE_MAX_FILE_SIZE=500This project features a completely refactored service architecture with proper naming conventions:
The consolidated image processing service that intelligently selects the optimal library:
import { imageProcessor } from './services/index.js';
// Automatic optimal library selection
const result = await imageProcessor.convertImage('input.jpg', {
format: 'webp',
quality: 85,
width: 1200
});
// Batch processing with concurrency control
const results = await imageProcessor.batchConvert(files, {
format: 'webp',
concurrent: 4
});Event-driven video processing with progress tracking:
import { videoProcessor } from './services/index.js';
// Set up event listeners
videoProcessor.on('progress', (progress) => {
console.log(`Processing: ${progress.percent}%`);
});
// Convert with quality presets
const result = await videoProcessor.convertVideo('input.mp4', {
format: 'webm',
quality: 'high',
width: 1920,
height: 1080
});Advanced GIF creation with scene detection:
import { gifProcessor } from './services/index.js';
// Create optimized GIF from video
const result = await gifProcessor.createFromVideo('input.mp4', {
fps: 15,
width: 500,
duration: 10,
sceneDetection: true
});
// Extract frames with filtering
const frames = await gifProcessor.extractFrames('input.gif', {
sceneThreshold: 0.3,
maxFrames: 50
});Centralized service management with intelligent selection:
import { serviceFactory } from './services/index.js';
// Get optimal service for file type and operation
const service = serviceFactory.getServiceFor('.mp4', 'convert');
const result = await service.convertVideo(inputPath, options);
// Get services by capability
const videoServices = serviceFactory.getServicesByCategory('video');POST /api/convert- Convert image formats (via ConversionRoutes.js)POST /api/convert/batch- Batch image conversionPOST /api/convert/gif-editor- Advanced GIF editingPOST /api/convert/validate- Validate conversion options
POST /api/video/convert- Convert video formats (via VideoRoutes.js)POST /api/split/video- Split videos into segments (via SplitRoutes.js)GET /api/split/video/status/:jobId- Get video processing statusGET /api/split/video/download/:jobId- Download processed video segments
POST /api/convert/gif-advanced- Advanced GIF processingPOST /api/split/gif- Extract frames from GIF (via SplitRoutes.js)GET /api/split/gif/status/:jobId- Get GIF processing statusGET /api/split/gif/download-zip/:jobId- Download extracted frames
POST /api/webp/convert- WebP conversion (via WebpRoutes.js)POST /api/webp/batch- Batch WebP processing
POST /api/text/overlay- Add text overlays (via TextRoutes.js)POST /api/ai/enhance- AI-powered enhancements (via AiRoutes.js)
GET /api/files/:filename- Download processed files (via FileRoutes.js)GET /api/files/list- List available filesDELETE /api/files/cleanup- Clean up temporary filesGET /api/files/download/:id- Download processed filesDELETE /api/files/cleanup- Clean up temporary files
# Backend linting
cd backend
npm run lint # Check code style
npm run lint:fix # Auto-fix style issues
# Frontend linting
cd frontend
npm run lint # Check code style
npm run lint:fix # Auto-fix style issues- ES Modules: All code uses modern ES module syntax
- Async/Await: Promise-based asynchronous operations
- Error Handling: Comprehensive error catching and user-friendly messages
- Documentation: JSDoc comments for all public functions
- Type Safety: Runtime type checking and validation
- Security: Input validation, file type restrictions, path traversal protection
The project uses a centralized ServiceFactory for intelligent service selection:
import { serviceFactory } from './services/index.js';
// Get optimal service for file type and operation
const service = serviceFactory.getServiceFor('.mp4', 'convert');
const result = await service.convertVideo(inputPath, options);
// Get services by capability
const videoServices = serviceFactory.getServicesByCategory('video');Vercel CANNOT host the backend due to:
- No persistent file storage
- Serverless function limitations
- Heavy binary dependencies (FFmpeg, ImageMagick)
- Large file processing requirements
# Deploy frontend to Vercel
cd frontend
npm run build
# Connect to Vercel dashboard or use Vercel CLI
vercel --prodOption A: Railway (Recommended)
- Connect your GitHub repo to Railway
- Railway will automatically detect the Dockerfile
- Set environment variables in Railway dashboard
- Deploy backend with Docker support
Option B: Render
- Connect GitHub repo to Render
- Use the included
render.yamlconfiguration - Render will build and deploy automatically
Option C: DigitalOcean App Platform
# Use the Dockerfile for container deployment
# Set up environment variables in DO dashboardFrontend Environment (.env for Vercel)
VITE_API_BASE_URL=https://your-backend-url.railway.app
VITE_MAX_FILE_SIZE=500Backend Environment (Railway/Render)
NODE_ENV=production
PORT=8080
MAX_FILE_SIZE_MB=500
MAX_BATCH_COUNT=20
OPENAI_API_KEY=your_openai_key_here
CORS_ORIGIN=https://your-frontend-url.vercel.app-
Deploy Backend First:
- Push code to GitHub
- Connect to Railway/Render
- Set environment variables
- Get backend URL
-
Deploy Frontend:
- Update
VITE_API_BASE_URLwith backend URL - Deploy to Vercel
- Update CORS_ORIGIN in backend with frontend URL
- Update
-
Test Connection:
- Verify API endpoints work
- Test file uploads/downloads
- Check CORS configuration
- Code Style: Follow the ESLint configuration
- Documentation: Add JSDoc comments for new functions
- Testing: Test all new features thoroughly
- Service Integration: Use the ServiceFactory pattern for new services
- Error Handling: Implement comprehensive error handling
This project underwent a comprehensive refactoring with professional naming conventions:
-
Services Renamed: All services now use proper PascalCase with descriptive suffixes
image-processor.jsβImageProcessingService.jsvideo-processor.jsβVideoProcessingService.jsgif-processor.jsβGifProcessingService.jsaiService.jsβAiService.jscleanupService.jsβCleanupService.js- And 15+ more services properly renamed
-
Routes Renamed: All route files now clearly indicate their purpose
convert.jsβConversionRoutes.jssplit.jsβSplitRoutes.jsvideo.jsβVideoRoutes.jsai.jsβAiRoutes.jstext.jsβTextRoutes.jsfiles.jsβFileRoutes.jswebp.jsβWebpRoutes.js
-
Utilities Reorganized: Better structure and naming
lib/directory βutils/directoryfile-paths.jsβFilePathUtils.jserrorHandler.jsβErrorHandler.jsvalidateFiles.jsβFileValidator.js
-
Frontend Components: React components now have clear, descriptive names
AIOConvertMainInterface.jsxβMainConversionInterface.jsxD3ProgressVisualization.jsxβProgressVisualization.jsxFullPageNavigation.jsxβMainNavigation.jsxKonvaImageEditor.jsxβImageEditor.jsxSortableFileManager.jsxβFileManager.jsxVideoToGif.jsxβVideoToGifConverter.jsx
- All Import Statements Updated: Every import throughout the entire codebase has been updated
- Path Consistency: All utilities now use consistent
../utils/FilePathUtils.jspaths - Service References: All service imports use the new proper names
- Component References: All React component imports and function names updated
- Professional Naming: All files now follow industry-standard naming conventions
- Better Organization: Clear separation of concerns with descriptive file names
- Improved Maintainability: Much easier to locate and understand code purpose
- Enhanced Readability: Self-documenting file names that explain functionality
- Service Consolidation: Unified processors replace 20+ duplicate services
- Architecture Modernization: ServiceFactory pattern and WorkflowOrchestrator implemented
- Documentation: Comprehensive inline documentation added
- Error Handling: Improved consistency across all services
- Modularity: Clean separation between services, routes, and utilities
This project is licensed under the MIT License - see the LICENSE file for details.
- ARCHITECTURE.md - Detailed technical architecture
- API Documentation - Complete API reference
- Development Guide - Development workflow and guidelines
Built with β€οΈ for modern media processing needs
- Automatic scene-based splitting using AI detection
- Progress tracking for long operations
- Batch download of all segments as ZIP
- GIF Frame Extraction:
- Extract all frames from animated GIFs
- Scene-based frame extraction with similarity detection
- Multiple output formats (PNG, JPG, WebP)
- Duplicate frame filtering
- Batch frame downloads
- Real-time Progress Tracking: Monitor conversion progress with detailed status updates
- Job Management: Queue multiple operations with unique job IDs
- Automatic Cleanup: Smart temporary file management
- API-First Design: RESTful API with comprehensive endpoints
- Error Handling: Robust error handling with detailed feedback
- Mobile Responsive: Works seamlessly across all devices
- Runtime: Node.js 18+ with Express.js
- Media Processing:
- FFmpeg with fluent-ffmpeg for video operations
- Sharp for image processing
- ImageMagick integration for advanced operations
- File Handling: Multer for uploads, Archiver for ZIP creation
- Architecture: EventEmitter-based services for scalable processing
- API: RESTful design with comprehensive error handling
- Framework: React 18 with modern hooks
- Build Tool: Vite for fast development and optimized builds
- Styling: Modern CSS with responsive design
- UI/UX: Professional interface with progress indicators
- Notifications: Smart notification system for user feedback
- Testing: Jest + Supertest for comprehensive API testing
- Development: Hot reload with Vite dev server
- Code Quality: ESLint configuration for consistent code style
- Environment: Configurable environment variables
- Node.js: Version 18.0.0 or higher
- FFmpeg: Required for video processing (automatically handled by ffmpeg-static)
- RAM: Minimum 4GB recommended for large media files
- Storage: Adequate space for temporary file processing
git clone https://github.com/salimuddin93/gif-converter.git
cd gif-converter# Install backend dependencies
cd backend
npm install
# Install frontend dependencies
cd ../frontend
npm installBackend Server:
cd backend
npm run devServer runs on http://localhost:4000
Frontend Server:
cd frontend
npm run devFrontend runs on http://localhost:5173
Open http://localhost:5173 in your browser to start using AIO Convert!
Create a .env file in the backend directory:
# Server Configuration
PORT=4000
NODE_ENV=development
# File Processing
MAX_FILE_SIZE_MB=500
MAX_BATCH_COUNT=50
TEMP_DIR=./temp
OUTPUT_DIR=./output
# Cleanup Settings
FILE_TTL_MINUTES=60
CLEANUP_INTERVAL_CRON="*/30 * * * *"
# Image Quality
JPEG_QUALITY=85
PNG_COMPRESSION=6
WEBP_QUALITY=80
# Video Processing
FFMPEG_TIMEOUT=300000
VIDEO_QUALITY_PRESET=mediumPOST /api/convert
Content-Type: multipart/form-data
files: <image files>
targetFormat: png|jpg|jpeg|gif|webp|bmp
quality: 1-100 (optional)
singleGif: true|false (optional)
gif.frameDelay: <milliseconds> (optional)
gif.loop: <number> (optional, 0 = infinite)Response:
{
"results": [
{
"originalName": "image1.png",
"convertedName": "converted_1234567890.jpg",
"url": "/api/files/converted_1234567890.jpg",
"sizeBytes": 245760,
"mimeType": "image/jpeg",
"dimensions": { "width": 1920, "height": 1080 }
}
]
}POST /api/video/to-gif
Content-Type: multipart/form-data
video: <video file>
startTime: <seconds> (optional)
endTime: <seconds> (optional)
fps: <frames per second> (optional)
quality: low|medium|high|custom (optional)
width: <pixels> (optional)
height: <pixels> (optional)POST /api/split/video
Content-Type: multipart/form-data
video: <video file>
splitBy: manual|scenes
segments: [{"start": 0, "end": 30}, {"start": 30, "end": 60}] (for manual)
sceneThreshold: 0.1-1.0 (for scene detection)
maxSegments: <number>
outputFormat: mp4|avi|webm|mov
quality: low|medium|high|customPOST /api/split/gif
Content-Type: multipart/form-data
image: <gif file>
outputFormat: png|jpg|jpeg|webp
splitBy: frames|scenes
quality: 1-100
resize: <width>x<height> (optional)
skipDuplicates: true|false
maxFrames: <number>GET /api/split/video/status/{jobId}
GET /api/split/gif/status/{jobId}Response:
{
"success": true,
"jobId": "uuid-string",
"status": "processing|completed|failed",
"progress": {
"totalSegments": 10,
"completedSegments": 7,
"percentage": 70
},
"result": { /* job results */ },
"error": null
}GET /api/split/video/download/{jobId}/{filename} # Individual file
GET /api/split/video/download-all/{jobId} # ZIP archive
GET /api/split/gif/download/{jobId}/{filename} # Individual frame
GET /api/split/gif/download-zip/{jobId} # ZIP archivePOST /api/split/video/cancel/{jobId}
POST /api/split/gif/cancel/{jobId}GET /api/files/{filename}GET /healthcd backend
npm testcd frontend
npm test# Convert image
curl -X POST http://localhost:4000/api/convert \
-F "files=@image.png" \
-F "targetFormat=jpg" \
-F "quality=85"
# Split video by scenes
curl -X POST http://localhost:4000/api/split/video \
-F "video=@video.mp4" \
-F "splitBy=scenes" \
-F "sceneThreshold=0.3" \
-F "outputFormat=mp4"# Build frontend
cd frontend
npm run build
# Start production server
cd ../backend
npm start# Dockerfile example
FROM node:18-alpine
# Install FFmpeg
RUN apk add --no-cache ffmpeg
# Copy and install dependencies
WORKDIR /app
COPY package*.json ./
RUN npm install --production
# Copy source code
COPY . .
EXPOSE 4000
CMD ["npm", "start"]- File Type Validation: Strict MIME type checking
- File Size Limits: Configurable upload size restrictions
- Input Sanitization: Comprehensive input validation
- Temporary File Cleanup: Automatic cleanup prevents disk overflow
- Error Handling: Detailed errors without exposing internal structure
- CORS Configuration: Proper cross-origin resource sharing setup
- Streaming Processing: Large files processed in streams
- Memory Management: Efficient memory usage for large operations
- Concurrent Processing: Multiple jobs handled simultaneously
- Caching Strategy: Smart caching for frequently accessed files
- Progress Tracking: Real-time progress updates for long operations
- Audio file processing (MP3, WAV, FLAC)
- PDF to image conversion
- Advanced image filters and effects
- Bulk operations API
- Smart image upscaling
- Automatic image enhancement
- Content-aware cropping
- Background removal
- Cloud storage integration (AWS S3, Google Drive)
- CDN integration for faster delivery
- User accounts and history
- API rate limiting and authentication
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow existing code style and conventions
- Add tests for new features
- Update documentation for API changes
- Ensure all tests pass before submitting PR
This project is licensed under the MIT License - see the LICENSE file for details.
Salimuddin is a passionate Full-Stack Developer and Media Processing Expert with extensive experience in building scalable web applications and media processing solutions.
- π GitHub: salimuddin07
- πΌ LinkedIn: salimuddin-shaikh
- πΈ Instagram: @salimuddin_shaikh_786
Built with β€οΈ by Salimuddin
Professional Media Processing with Clean Architecture