AI-Powered Video Clipping & Social Media Publishing Platform
Transform long-form videos into viral-ready clips automatically using AI, then publish directly to Instagram, TikTok, YouTube Shorts, and more.
- Gemini AI Analysis - Automatically identifies viral moments and engaging segments
- Whisper AI Subtitles - Generates accurate, multi-language subtitles with auto-detection
- Smart Clipping - FFmpeg creates professional clips with burned-in subtitles
- Viral Scoring - Each clip receives a viral potential score (0-100%)
- Emotion Detection - Identifies joy, excitement, surprise, tension, and more
- Thumbnail Generation - Auto-generates thumbnails for each clip
- Multi-Platform Publishing - Post to Instagram, TikTok, YouTube, Facebook, Twitter/X
- OAuth Authentication - Secure platform connections via OAuth 2.0
- Scheduled Posts - Schedule clips for optimal posting times
- Post Analytics - Track views, likes, comments, and engagement
- Bulk Publishing - Publish multiple clips across platforms simultaneously
- YouTube Download - Download videos from YouTube/Vimeo/Dailymotion with quality selection (360p to 4K)
- File Upload - Support for MP4, MOV, AVI, MKV, WEBM formats (up to 500MB)
- Quality Selection - Choose source video quality during download (affects final clip quality)
- Smart Processing - FFmpeg-powered clip creation with optimized encoding settings
- Cloud Storage - Optional Cloudinary integration for video and clip storage
- Local Storage - Automatic cleanup of processed files to save disk space
- JWT Authentication - Secure token-based authentication
- Google OAuth - One-click sign-in with Google
- Email Verification - Secure account verification system
- Password Reset - Secure password recovery flow
- Role-Based Access - User and admin roles with different permissions
- Multi-Device Sessions - Manage sessions across multiple devices
- User Dashboard - Comprehensive overview of videos, clips, and posts
- Platform Analytics - Track performance across all connected platforms
- Admin Panel - User management, platform monitoring, and system analytics
- Video Library - Organized library of all processed videos and clips
- Engagement Metrics - Real-time tracking of post performance
Before you begin, ensure you have the following installed:
- Node.js 16+ (Download)
- Python 3.8+ (Download)
- PostgreSQL (Download)
- FFmpeg (Download)
- Git (Download)
git clone <your-repo-url>
cd clipforgeBackend (Node.js + Python):
# Install Node.js dependencies
cd server
npm install
# Install Python dependencies
pip install -r requirements.txtFrontend (React):
cd ../client
npm installServer Configuration:
cd ../server
cp .env.example .envEdit server/.env with your credentials:
# =============================================================================
# REQUIRED CONFIGURATION
# =============================================================================
# Server Configuration
PORT=5000
FLASK_PORT=5001
NODE_ENV=development
BACKEND_URL=http://localhost:5000
FRONTEND_URL=http://localhost:5173
# Database (PostgreSQL)
DATABASE_URL=postgresql://postgres:your_password@localhost:5432/clipforge
# JWT Secrets (Generate with: node -e "console.log(require('crypto').randomBytes(64).toString('hex'))")
JWT_SECRET=your-generated-secret-here
JWT_REFRESH_SECRET=your-generated-refresh-secret-here
ACCESS_TOKEN_EXPIRY=24h
REFRESH_TOKEN_EXPIRY=30d
# Email (Gmail - Use App Password, not regular password)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASSWORD=your-16-char-app-password
SMTP_FROM=ClipForge <noreply@clipforge.com>
# Google OAuth (Get from: https://console.cloud.google.com/apis/credentials)
GOOGLE_CLIENT_ID=your-google-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-google-client-secret
# AI Configuration (Get from: https://makersuite.google.com/app/apikey)
GEMINI_API_KEY=your-gemini-api-key
USE_GEMINI=true
GEMINI_MODEL=gemini-2.0-flash-exp
# =============================================================================
# OPTIONAL CONFIGURATION
# =============================================================================
# Cloudinary (Cloud Storage - Get from: https://cloudinary.com)
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret
USE_CLOUD_STORAGE=true
# Instagram Graph API (Get from: https://developers.facebook.com/apps/)
INSTAGRAM_APP_ID=your-meta-app-id
INSTAGRAM_APP_SECRET=your-meta-app-secret
# Security Settings
MAX_LOGIN_ATTEMPTS=5
LOCKOUT_DURATION_MINUTES=15
ENABLE_SECURITY_LOGGING=true
ENABLE_RATE_LIMITING=true
# File Upload Settings
MAX_FILE_SIZE=500
ALLOWED_EXTENSIONS=mp4,mov,avi,mkv,webm
# Processing Defaults
DEFAULT_CLIP_DURATION=45
DEFAULT_NUM_CLIPS=5
DEFAULT_VIDEO_QUALITY=720p
DEFAULT_MIN_VIRAL_SCORE=0.5Client Configuration:
cd ../client
cp .env.example .env.localEdit client/.env.local:
# API Configuration
VITE_API_URL=http://localhost:5000
# Google OAuth (Must match server configuration)
VITE_GOOGLE_CLIENT_ID=your-google-client-id.apps.googleusercontent.comcd ../server
node migrations/run-migrations.jsThis will create all necessary tables and indexes.
You'll need 3 terminal windows:
Terminal 1 - Flask Server (Video Processing):
cd server
python app.py
# Runs on http://localhost:5001Terminal 2 - Node.js Server (API):
cd server
npm start
# Runs on http://localhost:5000Terminal 3 - React Frontend:
cd client
npm run dev
# Runs on http://localhost:5173Open your browser and navigate to:
http://localhost:5173
-
Create an Account
- Sign up with email or use Google OAuth
- Verify your email address
-
Upload or Download a Video
- Go to
/demopage - Upload a video file (MP4, MOV, AVI, MKV, WEBM)
- Or paste a YouTube URL to download
- Go to
-
Process with AI
- Click "Generate Viral Clips with AI"
- Wait for processing (2-5 minutes for a 5-minute video)
- First run takes longer (Whisper model download)
-
View Results
- Navigate to
/dashboard/videosto see your videos - Click on a video to view generated clips
- Each clip shows viral score, emotion, and reason
- Navigate to
-
Download or Publish
- Download clips directly
- Or connect social media accounts to publish
When processing videos, you can customize:
- Clip Duration: 15s, 30s, 45s, 60s, or custom (15-90 seconds)
- Number of Clips: Generate 1-10 clips per video
- Minimum Viral Score: Filter clips by viral potential (0-100%)
- Emotion Filter: Focus on specific emotions (joy, excitement, surprise, tension, inspiration)
- Processing Mode: AI-powered, equal division, or custom time ranges
- Quality: Choose source video download quality (360p to 4K) - clips inherit this quality
- Subtitle Language: Auto-detect or specify language (supports 50+ languages via Whisper AI)
- Skip Subtitles: Fast mode - skip subtitle generation for quicker processing
-
Connect Platforms
- Go to
/dashboard/settings - Click "Connect" for each platform
- Authorize via OAuth
- Go to
-
Schedule Posts
- Select a clip
- Choose platforms
- Set publish time
- Add captions and hashtags
-
Track Performance
- View analytics in
/dashboard/analytics - Monitor engagement metrics
- Optimize posting strategy
- View analytics in
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β React Frontend (Vite) β
β Port 5173 β
β - User Interface β
β - Authentication UI β
β - Video Management β
β - Dashboard & Analytics β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β
β HTTP/REST API
β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββ
β Node.js Express API β
β Port 5000 β
β - Authentication & Authorization β
β - User Management β
β - Video/Clip Metadata β
β - Platform OAuth β
β - Post Scheduling β
ββββββββββ¬ββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββ
β β
β β HTTP Requests
β β
β ββββββββββΌβββββββββ
β β Python Flask β
β β Port 5001 β
β β β
β β - Video Downloadβ
β β - AI Processing β
β β - Clip Creation β
β βββββββββββββββββββ
β β
β β
βΌ βΌ
βββββββββββββββββββ ββββββββββββββββββββ
β PostgreSQL β β AI Services β
β Database β β β
β β β - Whisper AI β
β - Users β β - Gemini AI β
β - Videos β β - FFmpeg β
β - Clips β β - yt-dlp β
β - Posts β ββββββββββββββββββββ
β - Platforms β
βββββββββββββββββββ
- React 19 - UI framework
- Vite - Build tool and dev server
- React Router - Client-side routing
- Tailwind CSS - Utility-first CSS framework
- Axios - HTTP client
- Express.js - Web framework
- PostgreSQL - Primary database
- JWT - Authentication tokens
- Bcrypt - Password hashing
- Nodemailer - Email service
- Multer - File upload handling
- Google OAuth - Social authentication
- Node-cron - Task scheduling
- Flask - Lightweight web framework
- OpenAI Whisper - Speech-to-text AI
- Google Gemini - Video analysis AI
- FFmpeg - Video processing
- yt-dlp - YouTube video downloader
- MoviePy - Video editing library
- Pillow - Image processing
- Railway - Hosting platform
- Vercel - Frontend deployment option
- Neon - Serverless PostgreSQL
- Git - Version control
clipforge/
βββ client/ # React frontend
β βββ public/ # Static assets
β β βββ demo-thumbnail.jpg
β β βββ demo-video.mp4
β βββ src/
β β βββ components/ # Reusable components
β β β βββ DashboardLayout.jsx
β β β βββ GoogleSignInButton.jsx
β β β βββ Layout.jsx
β β β βββ PostModal.jsx
β β β βββ ProtectedRoute.jsx
β β β βββ Sidebar.jsx
β β βββ context/ # React context
β β β βββ AuthContext.jsx
β β βββ pages/ # Page components
β β β βββ admin/ # Admin pages
β β β β βββ AdminDashboard.jsx
β β β β βββ Plans.jsx
β β β β βββ PlatformAnalytics.jsx
β β β β βββ Users.jsx
β β β βββ auth/ # Authentication pages
β β β β βββ ForgotPassword.jsx
β β β β βββ Login.jsx
β β β β βββ OAuthCallback.jsx
β β β β βββ ResetPassword.jsx
β β β β βββ Signup.jsx
β β β β βββ VerifyEmail.jsx
β β β βββ user/ # User dashboard pages
β β β β βββ Analytics.jsx
β β β β βββ Clips.jsx
β β β β βββ DashboardOverview.jsx
β β β β βββ Scheduled.jsx
β β β β βββ Settings.jsx
β β β β βββ Subscription.jsx
β β β β βββ VideoDetails.jsx
β β β β βββ Videos.jsx
β β β βββ About.jsx
β β β βββ Contact.jsx
β β β βββ Demo.jsx
β β β βββ Home.jsx
β β β βββ Pricing.jsx
β β β βββ Privacy.jsx
β β β βββ ShareClip.jsx
β β β βββ Terms.jsx
β β βββ utils/ # Utility functions
β β β βββ auth.js
β β β βββ helpers.js
β β β βββ toast.js
β β β βββ videoUrl.js
β β βββ App.jsx # Main app component
β β βββ main.jsx # Entry point
β β βββ index.css # Global styles
β βββ .env # Environment variables
β βββ index.html # HTML template
β βββ package.json # Dependencies
β βββ tailwind.config.js # Tailwind configuration
β βββ vite.config.js # Vite configuration
β
βββ server/ # Backend
β βββ config/ # Configuration
β β βββ database.js # Database connection
β βββ controllers/ # Route controllers
β β βββ aiController.js # AI processing endpoints
β β βββ authController.js # Authentication logic
β β βββ platformController.js # Social media integration
β β βββ postController.js # Post management
β βββ downloads/ # Video storage
β β βββ clips/ # Generated clips
β βββ logs/ # Application logs
β β βββ app.log
β β βββ error.log
β β βββ security.log
β βββ middleware/ # Express middleware
β β βββ authenticateWithQuery.js
β β βββ authMiddleware.js
β β βββ csrf.js
β β βββ rateLimiter.js
β β βββ validator.js
β βββ migrations/ # Database migrations
β β βββ run-migrations.js
β β βββ schema.sql
β β βββ README.md
β βββ models/ # Database models
β β βββ Clip.js
β β βββ PlatformConnection.js
β β βββ PublishedPost.js
β β βββ Session.js
β β βββ Token.js
β β βββ User.js
β β βββ Video.js
β βββ routes/ # API routes
β βββ scripts/ # Utility scripts
β β βββ checkClipPaths.js
β β βββ clearVideoData.js
β β βββ createAdmin.js
β β βββ resetDatabase.js
β β βββ verifyAdmin.js
β βββ services/ # Background services
β β βββ scheduler.js # Post scheduling
β βββ utils/ # Utility functions
β β βββ cleanup.js
β β βββ email.js
β β βββ logger.js
β βββ .env # Environment variables
β βββ .env.example # Environment template
β βββ app.py # Flask server (Python)
β βββ Server.js # Express server (Node.js)
β βββ video_processor.py # Video processing logic
β βββ package.json # Node dependencies
β βββ requirements.txt # Python dependencies
β
βββ .gitignore # Git ignore rules
βββ README.md # This file
βββ Procfile # Railway deployment
βββ railway.json # Railway configuration
βββ nixpacks.toml # Nixpacks configuration
βββ vercel.json # Vercel configuration
| Variable | Required | Default | Description |
|---|---|---|---|
PORT |
Yes | 5000 |
Node.js server port |
FLASK_PORT |
Yes | 5001 |
Python Flask server port |
NODE_ENV |
Yes | development |
Environment mode (development or production) |
BACKEND_URL |
Yes | http://localhost:5000 |
Backend API URL |
FRONTEND_URL |
Yes | http://localhost:5173 |
Frontend URL (for CORS) |
DATABASE_URL |
Yes | - | PostgreSQL connection string |
JWT_SECRET |
Yes | - | Secret for access tokens (64+ chars) |
JWT_REFRESH_SECRET |
Yes | - | Secret for refresh tokens (64+ chars) |
ACCESS_TOKEN_EXPIRY |
No | 24h |
Access token expiration time |
REFRESH_TOKEN_EXPIRY |
No | 30d |
Refresh token expiration time |
SMTP_HOST |
Yes | smtp.gmail.com |
SMTP server hostname |
SMTP_PORT |
Yes | 587 |
SMTP server port |
SMTP_USER |
Yes | - | SMTP username/email |
SMTP_PASSWORD |
Yes | - | SMTP password (Gmail App Password) |
SMTP_FROM |
No | ClipForge <noreply@clipforge.com> |
Email sender name |
GOOGLE_CLIENT_ID |
Yes | - | Google OAuth client ID |
GOOGLE_CLIENT_SECRET |
Yes | - | Google OAuth client secret |
GEMINI_API_KEY |
Yes | - | Google Gemini API key |
USE_GEMINI |
No | true |
Enable/disable Gemini AI |
GEMINI_MODEL |
No | gemini-2.0-flash-exp |
Gemini model version |
CLOUDINARY_CLOUD_NAME |
No | - | Cloudinary cloud name |
CLOUDINARY_API_KEY |
No | - | Cloudinary API key |
CLOUDINARY_API_SECRET |
No | - | Cloudinary API secret |
USE_CLOUD_STORAGE |
No | true |
Enable cloud storage |
INSTAGRAM_APP_ID |
No | - | Meta/Instagram app ID |
INSTAGRAM_APP_SECRET |
No | - | Meta/Instagram app secret |
MAX_LOGIN_ATTEMPTS |
No | 5 |
Max failed login attempts |
LOCKOUT_DURATION_MINUTES |
No | 15 |
Account lockout duration |
SESSION_CLEANUP_INTERVAL |
No | 24 |
Session cleanup interval (hours) |
ENABLE_SECURITY_LOGGING |
No | true |
Enable security event logging |
ENABLE_RATE_LIMITING |
No | true |
Enable API rate limiting |
MAX_FILE_SIZE |
No | 500 |
Maximum video upload size (MB) |
ALLOWED_EXTENSIONS |
No | mp4,mov,avi,mkv,webm |
Allowed video file formats |
DEFAULT_CLIP_DURATION |
No | 45 |
Default clip duration (seconds) |
DEFAULT_NUM_CLIPS |
No | 5 |
Default number of clips to generate |
DEFAULT_VIDEO_QUALITY |
No | 720p |
Default video download quality |
DEFAULT_MIN_VIRAL_SCORE |
No | 0.5 |
Default minimum viral score filter |
Future Platform Integrations (Optional - Coming Soon):
| Variable | Description |
|---|---|
YOUTUBE_CLIENT_ID |
YouTube Data API v3 client ID |
YOUTUBE_CLIENT_SECRET |
YouTube Data API v3 client secret |
TIKTOK_CLIENT_KEY |
TikTok API client key |
TIKTOK_CLIENT_SECRET |
TikTok API client secret |
TWITTER_API_KEY |
Twitter/X API key |
TWITTER_API_SECRET |
Twitter/X API secret |
TWITTER_BEARER_TOKEN |
Twitter/X bearer token |
FACEBOOK_APP_ID |
Facebook API app ID |
FACEBOOK_APP_SECRET |
Facebook API app secret |
| Variable | Required | Default | Description |
|---|---|---|---|
VITE_API_URL |
Yes | http://localhost:5000 |
Backend API URL |
VITE_GOOGLE_CLIENT_ID |
Yes | - | Google OAuth client ID (must match server) |
Note: Vite only exposes variables prefixed with VITE_ to the frontend.
Local Setup (Development):
# Install PostgreSQL
# Windows: Download from https://www.postgresql.org/download/windows/
# Mac: brew install postgresql
# Linux: sudo apt-get install postgresql
# Create database
psql -U postgres
CREATE DATABASE clipforge;
\q
# Update DATABASE_URL in .env
DATABASE_URL=postgresql://postgres:your_password@localhost:5432/clipforgeRemote Setup (Production):
- Neon - Serverless PostgreSQL (Free tier: 0.5 GB)
- Supabase - PostgreSQL + Auth (Free tier: 500 MB)
- Railway - PostgreSQL + Hosting (Free tier: $5 credit)
Generate strong random secrets:
# Run this command twice to generate both secrets
node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"Copy the output to JWT_SECRET and JWT_REFRESH_SECRET in .env
Setup Steps:
- Go to Google Cloud Console
- Create a new project (or select existing)
- Enable Google+ API:
- Go to "APIs & Services" β "Library"
- Search for "Google+ API"
- Click "Enable"
- Create OAuth 2.0 credentials:
- Go to "APIs & Services" β "Credentials"
- Click "Create Credentials" β "OAuth client ID"
- Application type: "Web application"
- Name: "ClipForge AI"
- Add authorized redirect URIs:
http://localhost:5173/auth/callback http://localhost:5000/api/auth/google/callback https://your-domain.com/auth/callback (for production) - Copy Client ID and Client Secret
- Add to both
server/.envandclient/.env.local
Setup Steps:
- Enable 2-Factor Authentication on your Google account:
- Go to Google Account Security
- Enable "2-Step Verification"
- Generate App Password:
- Go to App Passwords
- Select "Mail" and "Other (Custom name)"
- Name it "ClipForge AI"
- Click "Generate"
- Copy the 16-character password (format:
xxxx xxxx xxxx xxxx) - Add to
SMTP_PASSWORDin.env(remove spaces)
Alternative Email Providers:
Setup Steps:
- Go to Google AI Studio
- Sign in with your Google account
- Click "Get API Key" β "Create API key"
- Copy the API key
- Add to
GEMINI_API_KEYin.env
Free Tier Limits:
- 60 requests per minute
- 1,500 requests per day
- Sufficient for development and small-scale production
Setup Steps:
- Sign up at Cloudinary
- Free tier includes:
- 25 GB storage
- 25 GB bandwidth/month
- 25,000 transformations/month
- Get credentials from Console:
- Cloud Name
- API Key
- API Secret
- Add to
.env:CLOUDINARY_CLOUD_NAME=your-cloud-name CLOUDINARY_API_KEY=your-api-key CLOUDINARY_API_SECRET=your-api-secret USE_CLOUD_STORAGE=true
Benefits:
- Automatic file cleanup (saves local disk space)
- CDN delivery (faster video loading)
- Video transformations
- Scalable storage
Setup Steps:
- Go to Meta for Developers
- Create new app:
- Click "Create App"
- Type: "Business"
- Name: "ClipForge AI"
- Add products:
- Facebook Login
- Instagram Graph API
- Configure OAuth redirect URI:
http://localhost:5000/api/platforms/instagram/callback https://your-domain.com/api/platforms/instagram/callback - Get App ID and App Secret from Settings β Basic
- Add to
.env:INSTAGRAM_APP_ID=your-meta-app-id INSTAGRAM_APP_SECRET=your-meta-app-secret
Requirements:
- User must have Instagram Creator or Business account
- Instagram account must be connected to a Facebook Page
- App must be in "Live" mode (requires Meta review for production)
Testing:
- Use "Development" mode for testing with your own account
- No review needed for development mode
Setup Steps:
- Go to Google Cloud Console
- Enable YouTube Data API v3
- Create OAuth 2.0 credentials (same project as Google OAuth)
- Add redirect URI:
http://localhost:5000/api/platforms/youtube/callback - Add to
.env:YOUTUBE_CLIENT_ID=your-youtube-client-id YOUTUBE_CLIENT_SECRET=your-youtube-client-secret
Free Tier Limits:
- 10,000 quota units per day
- 1 video upload = 1,600 units
- Sufficient for ~6 uploads per day
TikTok API:
- Apply at TikTok for Developers
- Requires business verification
- Video posting available in API v2
Twitter/X API:
- Apply at Twitter Developer Portal
- Free tier: 1,500 tweets/month
- Elevated access required for media uploads
Facebook API:
- Use same Meta app as Instagram
- Supports video posts to Facebook Pages
- Requires page management permissions
Edit server/video_processor.py line 27:
# Trade-off: Speed vs Accuracy
model = self.load_whisper_model("base")
# Available Models:
# - tiny: ~1GB RAM, 32x faster, 70% accuracy - Best for testing
# - base: ~1GB RAM, 16x faster, 80% accuracy - Recommended (default)
# - small: ~2GB RAM, 6x faster, 85% accuracy - Good balance
# - medium: ~5GB RAM, 2x faster, 90% accuracy - High accuracy
# - large: ~10GB RAM, 1x speed, 95% accuracy - Best quality (very slow)
# Processing Time Examples (5-minute video):
# - tiny: ~30 seconds
# - base: ~1 minute (default)
# - small: ~2-3 minutes
# - medium: ~5-8 minutes
# - large: ~15-20 minutes
# First run downloads model (~40MB for tiny, ~140MB for base, ~460MB for small)Recommendation: Use base for production, tiny for development/testing.
The quality selection affects the source video download quality. Clips inherit the quality of the source video.
How it works:
-
Download Stage - Quality parameter controls yt-dlp download resolution
- 2160p (4K) β Downloads 4K video β Clips are 4K
- 720p (HD) β Downloads 720p video β Clips are 720p
- 360p β Downloads 360p video β Clips are 360p
-
Clip Creation - FFmpeg uses optimized encoding settings (defined in
server/video_processor.py):
# FFmpeg encoding settings for clips
'-c:v', 'libx264', # H.264 codec
'-c:a', 'aac', # AAC audio codec
'-preset', 'fast', # Encoding speed (ultrafast, fast, medium, slow)
'-crf', '23', # Quality: 0-51 (lower = better quality, larger file)
# 23 = good balance between quality and file size
'-avoid_negative_ts', 'make_zero' # Fix timestamp issuesTo customize clip encoding quality, edit server/video_processor.py line 352-356:
- Lower CRF (18-22) = Higher quality, larger files
- Higher CRF (24-28) = Lower quality, smaller files
- Faster preset = Quicker processing, larger files
- Slower preset = Better compression, smaller files
Adjust in the frontend or API request:
{
clipDuration: 45, // Seconds per clip (15-90s)
numClips: 5, // Number of clips to generate (1-10)
minViralScore: 0.5, // Minimum viral score (0-1)
quality: '720p', // Source video download quality (affects clip quality)
emotions: ['joy', 'excitement'], // Filter by emotions
clipMode: 'ai', // 'ai' (smart), 'divide' (equal parts), 'range' (custom time)
startTime: 0, // Optional: start processing from this time (seconds)
endTime: 300, // Optional: end processing at this time (seconds)
skipSubtitles: false, // Skip subtitle generation for faster processing
subtitleLanguage: 'auto' // Auto-detect or specify language code (en, es, fr, etc.)
}Processing Modes:
- AI Mode - Gemini AI analyzes content and identifies viral moments
- Divide Mode - Splits video into equal-duration clips
- Range Mode - Creates clips from specific time ranges
POST /api/auth/register
Content-Type: application/json
{
"name": "Dipendra Kumar",
"email": "dipendrastm03@gmail.com",
"password": "SecurePass123!"
}POST /api/auth/login
Content-Type: application/json
{
"email": "dipendrastm03@gmail.com",
"password": "SecurePass123!"
}POST /api/auth/google
Content-Type: application/json
{
"credential": "google-oauth-token"
}GET /api/videos/my-videos
Authorization: Bearer <access_token>GET /api/videos/:videoId
Authorization: Bearer <access_token>DELETE /api/videos/:videoId
Authorization: Bearer <access_token>GET /api/clips/my-clips
Authorization: Bearer <access_token>GET /api/clips/video/:videoId
Authorization: Bearer <access_token>GET /api/clips/:clipId/download
Authorization: Bearer <access_token>POST http://localhost:5001/download
Content-Type: application/json
{
"url": "https://youtube.com/watch?v=...",
"quality": "720p"
}POST http://localhost:5001/upload
Content-Type: multipart/form-data
video: <file>POST http://localhost:5001/process
Content-Type: application/json
{
"videoId": "uuid",
"userId": "uuid",
"clipDuration": 45,
"numClips": 5,
"quality": "720p",
"clipMode": "ai",
"minViralScore": 0.5,
"emotions": ["joy", "excitement"],
"skipSubtitles": false,
"subtitleLanguage": "auto",
"startTime": 0,
"endTime": 300
}Response:
{
"success": true,
"videoId": "uuid",
"status": "completed",
"videoInfo": {
"duration": 300,
"width": 1280,
"height": 720,
"fps": 30
},
"detectedLanguage": "en",
"subtitleUrl": "http://localhost:5001/video/uuid.vtt",
"thumbnailUrl": "http://localhost:5001/video/uuid_thumb.jpg",
"clips": [
{
"clipNumber": 1,
"title": "Amazing Moment",
"startTime": 45.5,
"endTime": 90.5,
"duration": 45,
"emotion": "joy",
"viralScore": 0.85,
"reason": "High energy and engaging content",
"clipUrl": "http://localhost:5001/video/uuid_clip_1.mp4"
}
]
}GET http://localhost:5001/progress/:videoIdError: FFmpeg not found in PATH
Solution:
- Download FFmpeg from ffmpeg.org
- Add to system PATH
- Verify:
ffmpeg -version
Issue: First processing takes 5+ minutes
Explanation: Whisper downloads model on first run (~140MB for base model)
Solution: Wait for initial download, subsequent runs will be faster
Error: Connection refused or ECONNREFUSED
Solution:
- Verify PostgreSQL is running
- Check
DATABASE_URLin.env - Test connection:
psql -d clipforge
Error: API key not valid
Solution:
- Verify
GEMINI_API_KEYin.env - Check API key at Google AI Studio
- Ensure billing is enabled
Error: Sign in to confirm or Bot detection
Solutions:
- Update yt-dlp:
pip install --upgrade yt-dlp - Try a different video
- Use shorter videos (under 10 minutes)
- Consider using Vimeo or Dailymotion instead
Error: EADDRINUSE: address already in use
Solution:
# Find process using port
lsof -i :5000 # or :5001, :5173
# Kill process
kill -9 <PID>Error: Invalid login or Authentication failed
Solution:
- Use Gmail App Password (not regular password)
- Enable 2FA on Google account
- Generate app password at myaccount.google.com/apppasswords
- Use smaller Whisper model (
tinyinstead ofbase) invideo_processor.pyline 27 - Enable "Skip Subtitles" mode for 50% faster processing (no subtitle generation)
- Download source video at lower quality (720p or 480p)
- Process shorter videos (under 10 minutes recommended)
- Use faster FFmpeg preset (
ultrafastorveryfast) - Increase server resources (RAM and CPU)
- First run is always slower (Whisper model download ~140MB)
- Download source video at lower quality (480p or 360p instead of 1080p/4K)
- Adjust CRF value in
video_processor.py(increase from 23 to 26-28 for smaller files) - Use faster preset (
ultrafastinstead offast) for quicker encoding - Enable Cloudinary storage to automatically delete local files after upload
- Close other applications
- Increase Node.js memory:
NODE_OPTIONS=--max-old-space-size=4096 - Process videos sequentially, not in parallel
Error: File too large or Invalid file type
Solution:
- Check file size (default max: 500MB)
- Verify file format (supported: MP4, MOV, AVI, MKV, WEBM)
- Adjust limits in
.env:MAX_FILE_SIZE=500 # in MB ALLOWED_EXTENSIONS=mp4,mov,avi,mkv,webm
- For larger files:
- Compress video before upload
- Use YouTube download instead
- Enable Cloudinary for better handling
cd server
node migrations/run-migrations.jscd server
node scripts/createAdmin.jsnode scripts/verifyAdmin.jsnode scripts/clearVideoData.jsnode scripts/resetDatabase.js-
Create Railway Account
- Sign up at railway.app
-
Create New Project
- Click "New Project"
- Select "Deploy from GitHub repo"
- Connect your repository
-
Add PostgreSQL
- Click "New"
- Select "Database" β "PostgreSQL"
- Copy
DATABASE_URL
-
Configure Environment Variables
- Go to project settings
- Add all variables from
.env.example - Set
NODE_ENV=production
-
Deploy
- Railway auto-deploys on git push
- Monitor logs in dashboard
- Install Vercel CLI
npm install -g vercel- Deploy
cd client
vercel- Configure Environment
- Add
VITE_API_URLin Vercel dashboard - Point to your Railway backend URL
- Add
NODE_ENV=production
FRONTEND_URL=https://your-domain.com
DATABASE_URL=postgresql://... # From Railway/Neon
JWT_SECRET=<strong-random-string>
JWT_REFRESH_SECRET=<strong-random-string>
# ... other variablesWe welcome contributions! Here's how you can help:
- Check existing issues
- Create detailed bug report
- Include steps to reproduce
- Add screenshots if applicable
- Open an issue with
[Feature Request]tag - Describe the feature
- Explain use case
- Discuss implementation
- Fork the repository
- Create 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 Pull Request
- Follow existing code style
- Write clear commit messages
- Add comments for complex logic
- Test thoroughly before submitting
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI Whisper - Speech recognition AI
- Google Gemini - Video analysis AI
- FFmpeg - Video processing
- yt-dlp - YouTube downloader
- React - Frontend framework
- Express.js - Backend framework
- PostgreSQL - Database
- Tailwind CSS - CSS framework
Built for content creators who want to maximize their reach across social media platforms with AI-powered automation.
- GitHub Issues: Report bugs or request features
- Discussions: Ask questions and share ideas
- Email: support@clipforge.ai
- Twitter: @clipforgeai
- Discord: Join our community
- β AI-powered video clipping
- β Multi-platform authentication
- β Social media OAuth integration
- β Post scheduling
- β Analytics dashboard
- β Admin panel
- π Batch video processing
- π Advanced subtitle customization
- π More platform integrations (LinkedIn, Pinterest)
- π Team collaboration features
- π API for third-party integrations
- π AI-generated captions and hashtags
- π A/B testing for posts
- π Advanced analytics with ML insights
- π Mobile app (iOS/Android)
- π White-label solution
- Languages: JavaScript, Python, SQL
- Frameworks: React, Express, Flask
- AI Models: Whisper, Gemini
- Database: PostgreSQL
- Lines of Code: ~15,000+
- Files: 100+
Made with β€οΈ for content creators worldwide
Transform your long-form content into viral clips with the power of AI