π A comprehensive platform for video streaming, media editing, and content management
- πΉ HLS Video Streaming - Upload and stream videos with adaptive bitrate
- πΌοΈ Smart Thumbnails - Auto-generated thumbnails with FFmpeg
- π View Analytics - Real-time view tracking and engagement metrics
- π― Video Gallery - Professional grid and list views with search/filter
- β±οΈ Duration Detection - Automatic video length extraction and display
-
πΌοΈ Image Tools:
- βοΈ Smart Crop - Interactive cropping with aspect ratio controls
- π Resize - Intelligent resizing with quality preservation
- π¨ Effects - Filters, brightness, contrast, saturation adjustments
- ποΈ Compression - Advanced compression with quality controls
- π Rotation - Precise rotation and flip operations
-
π₯ Video Tools:
- βοΈ Video Trimming - Precise timeline-based video cutting
- π¬ Video Effects - Color grading, filters, and visual enhancements
- οΏ½ Audio Management - Audio track editing and replacement
-
π Format Conversion:
- πΌοΈ Image Formats - Support for JPG, PNG, WebP, AVIF, GIF, TIFF, BMP, ICO
- π₯ Video Formats - MP4, WebM, AVI, MOV, MKV, FLV, OGV conversion
- βοΈ Quality Control - Customizable compression and optimization settings
- π Secure Authentication - Powered by Clerk with multiple sign-in options
- π€ User Profiles - Personalized user experiences and content management
- οΏ½οΈ Protected Routes - Role-based access control for sensitive features
- π± Fully Responsive - Optimized for desktop, tablet, and mobile devices
- π Dark/Light Mode - System-aware theme switching with user preferences
- β‘ Modern UI - Built with Tailwind CSS and Lucide React icons
- οΏ½ Interactive Components - Smooth animations and hover effects
- π― Intuitive Navigation - Clean, accessible interface design
- π₯ Hot Module Replacement - Lightning-fast development with Vite
- π Comprehensive Documentation - Built-in docs with interactive examples
- π Error Handling - Robust error boundaries and user feedback
- π Performance Optimized - Code splitting and lazy loading
Before you begin, ensure you have the following installed:
- Node.js (v18 or later) - Download here
- npm or yarn package manager
- MongoDB (v5.0 or later) - MongoDB Atlas or local installation
- FFmpeg - Required for video processing (Download here)
-
Clone the repository
git clone https://github.com/ANAS727189/MediaHub.git cd MediaHub -
Install dependencies for both client and server
# Install client dependencies cd client npm install # Install server dependencies cd ../server npm install
-
Environment Configuration
Client Environment Variables (create
client/.env):VITE_BACKEND_URI=http://localhost:8000 VITE_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
Server Environment Variables (create
server/.env):PORT=8000 DATABASE_URI=mongodb://localhost:27017/mediahub CLIENT_URI=http://localhost:5173
-
Start the development servers
# Terminal 1 - Start the backend server cd server npm start # Terminal 2 - Start the frontend client cd client npm run dev
-
Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
| Feature | Description | Status |
|---|---|---|
| π Landing Page | Modern hero section with feature showcase | β Complete |
| πΊ Video Streaming | HLS streaming with professional video player | β Complete |
| πΌοΈ Media Editor | Comprehensive image and video editing tools | β Complete |
| π Format Conversion | Multi-format image and video conversion | β Complete |
| οΏ½ Documentation | Interactive documentation with examples | β Complete |
| π Authentication | Secure user management with Clerk | β Complete |
- Resize Tool - Intelligent resizing with aspect ratio preservation
- Crop Tool - Interactive cropping with preset ratios
- Effects Tool - Brightness, contrast, saturation, and filter adjustments
- Compression Tool - Smart compression with quality control
- Rotation Tool - Precise rotation and flip operations
- Trim Tool - Timeline-based video trimming and cutting
- Effects Tool - Color grading and visual enhancements
- Audio Tool - Audio track management and replacement
- Image Formats: JPG, PNG, WebP, AVIF, GIF, TIFF, BMP, ICO
- Video Formats: MP4, WebM, AVI, MOV, MKV, FLV, OGV
- Quality Control: Customizable compression and optimization
// Get all videos
GET /api/videos
Response: Array of video objects with metadata
// Get specific video
GET /api/videos/:id
Response: Video object with full details
// Upload new video
POST /api/upload
Body: FormData with video file
Response: Uploaded video with HLS segments
// Increment view count
POST /api/videos/:id/view
Response: Updated video with new view count{
_id: "unique_video_id",
title: "Video Title",
description: "Video Description",
videoPath: "/uploads/videos/uuid/index.m3u8",
thumbnailPath: "/uploads/videos/uuid/thumbnail.jpg",
duration: "5:23", // MM:SS format
views: 1250, // Real-time view count
uploadDate: "2025-01-01T00:00:00.000Z",
metadata: {
width: 1920,
height: 1080,
fileSize: 15728640, // bytes
bitrate: 2500000 // bits per second
}
}- βοΈ React 18 - Modern React with hooks and concurrent features
- π£οΈ React Router - Client-side routing and navigation
- π¨ Tailwind CSS - Utility-first CSS framework for rapid UI development
- β‘ Vite - Lightning-fast build tool and dev server
- π Lucide React - Beautiful, customizable icons
- πΌοΈ React Image Crop - Interactive image cropping component
- π¬ Video.js - Professional HTML5 video player
- π± React Toastify - Elegant notification system
- π’ Node.js - JavaScript runtime for server-side development
- π Express.js - Fast, unopinionated web framework
- π MongoDB - NoSQL database for flexible data storage
- π Mongoose - MongoDB object modeling for Node.js
- π€ Multer - Multipart/form-data handling for file uploads
- π₯ FFmpeg - Video processing and conversion
- πΌοΈ Sharp - High-performance image processing
- βοΈ Cloudinary - Cloud-based image and video management
- π Clerk - Complete user management and authentication
- π‘οΈ CORS - Cross-origin resource sharing security
- π Private Routes - Protected route components
- π¦ npm/yarn - Package management
- π Hot Module Replacement - Instant development feedback
- π³ Docker - Containerization support
- βοΈ Render - Cloud deployment platform
// Video Schema
const videoSchema = {
title: String,
description: String,
videoPath: String, // HLS playlist path
thumbnailPath: String, // Auto-generated thumbnail
uploaderId: String, // Clerk user ID
uploadDate: Date, // Auto-generated timestamp
duration: String, // MM:SS format from FFprobe
views: Number, // Real-time view tracking
metadata: {
width: Number, // Video resolution width
height: Number, // Video resolution height
fileSize: Number, // File size in bytes
bitrate: Number // Bitrate in bits/second
}
}# Local MongoDB (recommended for development)
brew install mongodb/brew/mongodb-community
brew services start mongodb/brew/mongodb-community
# Or use MongoDB Atlas (recommended for production)
# Sign up at https://www.mongodb.com/cloud/atlas# Sign up at https://cloudinary.com
# Get your credentials from the dashboard
# Add to your .env files# Sign up at https://clerk.dev
# Create a new application
# Get your publishable key from the dashboard# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt update && sudo apt install ffmpeg
# Windows
# Download from https://ffmpeg.org/download.html-
Backend Deployment
# Push code to GitHub # Connect Render to your GitHub repository # Set environment variables in Render dashboard # Deploy from server/ directory
-
Frontend Deployment
# Build the client cd client && npm run build # Deploy to Render static site # Or use Vercel, Netlify for frontend hosting
# Server Production Variables
NODE_ENV=production
PORT=10000
DATABASE_URI=mongodb+srv://username:[email protected]/mediahub
CLIENT_URI=https://your-frontend-domain.com
# Client Production Variables
VITE_BACKEND_URI=https://your-backend-domain.com
VITE_CLERK_PUBLISHABLE_KEY=pk_live_your_clerk_keyWe welcome contributions! Here's how you can help improve MediaHub:
- Check existing issues
- Create a new issue with detailed reproduction steps
- Include screenshots/videos if applicable
- Check discussions for existing requests
- Create a detailed feature request with use cases
- Consider contributing the implementation
-
Fork the repository
git clone https://github.com/your-username/MediaHub.git cd MediaHub -
Create a feature branch
git checkout -b feature/amazing-feature
-
Make your changes
- Follow existing code style and conventions
- Add comments for complex logic
- Update documentation if needed
-
Test your changes
# Run client tests cd client && npm run lint # Test server functionality cd server && npm start
-
Commit and push
git commit -m "feat: add amazing new feature" git push origin feature/amazing-feature -
Open a Pull Request
- Provide clear description of changes
- Include screenshots/GIFs for UI changes
- Reference related issues
- Help improve README, code comments, and documentation
- Create tutorials or example projects
- Report documentation bugs or inconsistencies
- UI/UX improvements and suggestions
- Icon and graphic contributions
- Accessibility enhancements
π Live Demo: https://media-hub-xi.vercel.app
Made with β€οΈ by Anas
β¬ Back to Top | π Give it a Star!
If you found this project helpful, please consider giving it a β!