π¬ VideoGenius AI - YouTube Video Generator SaaS
Transform any topic into viral YouTube content with the power of AI
π Live Demo β’ π Documentation β’ π οΈ Installation β’ π€ Contributing
Transform any topic into viral YouTube content with the power of AI
π Live Demo β’ π Documentation β’ π οΈ Installation β’ π€ Contributing
VideoGenius AI is a revolutionary SaaS platform that automates the entire YouTube video creation process. From script generation to final upload, our AI-powered system handles everything, enabling creators to scale from weekly uploads to daily content production effortlessly.
Backend:
Frontend:
AI & APIs:
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Frontend β β Backend β β AI Services β
β (Vue.js) βββββΊβ (Laravel) βββββΊβ (GPT-4, TTS) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Web Server β β Database β β Media APIs β
β (Nginx) β β (MySQL) β β (Pexels) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
βΌ
βββββββββββββββββββ
β Docker β
β Compose β
βββββββββββββββββββ
VideoGenius AI leverages n8n as the core automation engine that orchestrates the entire video creation pipeline. The workflow handles AI service coordination, media processing, and YouTube publishing in a visual, node-based environment.
The complete video generation workflow is defined in complete_video_generator.json. This workflow must be imported into your n8n instance to enable automated video creation.
To import the workflow:
Access n8n Dashboard
http://localhost:5678
Import Workflow
workflows/complete_video_generator.jsonWorkflow Configuration
# No API credentials needed in n8n!
# Laravel handles all external API integrations:
# - OpenAI/GEMINI API (configured in Laravel .env)
# - Pexels API (configured in Laravel .env)
# - Google Cloud TTS (configured in Laravel .env)
# - YouTube API (OAuth handled by Laravel)
#
# n8n only needs Laravel webhook endpoints
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Trigger β β Script Gen β β Media Search β
β (Webhook) βββββΊβ (OpenAI) βββββΊβ (Pexels API) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Status Update β β Voice Gen β β Media Filter β
β (Laravel API) ββββββ (TTS API) ββββββ (Processing) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Video Compile β β SEO Optimize β β YouTube Uploadβ
β (Python Script)βββββΊβ (AI Generated)βββββΊβ (API v3) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
βΌ
βββββββββββββββββββ
β Final Status β
β (Webhook) β
βββββββββββββββββββ
1. Webhook Trigger
2. Script Generation (Laravel API Call)
3. Media Selection (Laravel API Call)
4. Voiceover Generation (Laravel API Call)
5. Video Compilation (Laravel Queue Job)
6. SEO Optimization (Laravel AI Service)
7. YouTube Upload (Laravel OAuth)
8. Status Updates (Laravel Webhooks)
LARAVEL_APP_URL=http://app:9000 N8N_WEBHOOK_URL=http://n8n:5678/webhook
GEMINI_ENDPOINT=https://api.openai.com/v1 PEXELS_ENDPOINT=https://api.pexels.com/v1 YOUTUBE_ENDPOINT=https://www.googleapis.com/upload/youtube/v3
### π Workflow Monitoring
Monitor your n8n workflows through:
- **Execution History**: Track success/failure rates
- **Performance Metrics**: Average processing times
- **Error Logs**: Debug failed executions
- **Resource Usage**: CPU and memory consumption
### π Workflow Customization
The `complete_video_generator.json` workflow can be customized for:
- **Different Content Types**: Educational, entertainment, news
- **Brand Guidelines**: Add custom intro/outro sequences
- **Publishing Schedules**: Set automated upload timing
- **Quality Settings**: Adjust video resolution and bitrate
**Advanced Customization:**
```javascript
// Example: Custom script generation prompt
{
"prompt": "Create a {{$json.style}} YouTube script about {{$json.topic}} that is {{$json.duration}} long, includes viral hooks, and targets {{$json.audience}} audience.",
"max_tokens": 1500,
"temperature": 0.7
}
Clone the repository
git clone https://github.com/MohamedElaassal/youtubeVideoGenerator.git
cd youtubeVideoGenerator
Environment Configuration
cp .env.example .env
Configure your environment variables
# Database
DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=youtube_generator
DB_USERNAME=root
DB_PASSWORD=secret
GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret GOOGLE_REDIRECT_URI=http://localhost:8000/auth/google/callback
OPENAI_API_KEY=your_openai_api_key PEXELS_API_KEY=your_pexels_api_key
TTS_SERVICE=gTTS TTS_LANGUAGE=en
4. **Build and start the application**
```bash
docker-compose up -d --build
# Install PHP dependencies
docker-compose exec app composer install
docker-compose exec app npm install --legacy-peer-deps
docker-compose exec app php artisan key:generate
docker-compose exec app php artisan migrate
docker-compose exec app npm run build
6. **Access the application**
- **Frontend:** http://localhost:8000
- **n8n Workflow:** http://localhost:5678
- **Database:** localhost:3306
## π Project Structure
youtubeVideoGenerator/ βββ app/ β βββ Http/Controllers/ # Application controllers β βββ Models/ # Eloquent models β βββ Services/ # Business logic services β βββ Jobs/ # Queue jobs for video processing βββ resources/ β βββ js/ β β βββ Pages/ # Vue.js pages β β βββ Components/ # Reusable Vue components β β βββ Layouts/ # Application layouts β βββ css/ # Stylesheets with animations βββ scripts/ β βββ video_generator.py # Python video assembly β βββ tts_generator.py # Text-to-speech generation β βββ requirements.txt # Python dependencies βββ workflows/ β βββ complete_video_generator.json # n8n workflow (REQUIRED IMPORT) βββ docker-compose.yml # Container orchestration βββ Dockerfile # Application container βββ README.md # This file
### π¨ Important: n8n Workflow Setup
**The `complete_video_generator.json` file contains the core automation logic and MUST be imported into your n8n instance for the platform to function properly.**
## π― Usage
### Basic Workflow
1. **Sign in with Google** - Connect your YouTube channel
2. **Create a Video** - Provide a topic or keyword
3. **AI Processing** - Watch as AI generates script, selects visuals, and creates voiceover
4. **Review & Edit** - Make any necessary adjustments
5. **Publish** - Upload directly to your YouTube channel
### Autopilot Mode
1. **Configure Channel Settings** - Set your niche and preferences
2. **Enable Autopilot** - Choose your publishing schedule
3. **Relax** - AI creates and publishes videos automatically
### Advanced Features
- **Bulk Video Creation** - Generate multiple videos from a list of topics
- **Custom Voice Selection** - Choose from 40+ AI voices
- **Brand Customization** - Add your logo and brand colors
- **Analytics Dashboard** - Track performance across all videos
## π§ Configuration
### Google OAuth Setup
1. Go to [Google Cloud Console](https://console.cloud.google.com/)
2. Create a new project or select existing
3. Enable YouTube Data API v3
4. Create OAuth 2.0 credentials
5. Add authorized redirect URIs:
- `http://localhost:8000/auth/google/callback`
- `https://yourdomain.com/auth/google/callback`
### AI Service Configuration
#### Gemini or OpenAI API
- Sign up at [OpenAI Platform](https://platform.openai.com/)
- Generate API key
- Add to `.env` file
#### Pexels API
- Register at [Pexels](https://www.pexels.com/api/)
- Get free API key (50,000 requests/month)
- Add to `.env` file
## π Deployment
### Production Deployment
1. **Prepare production environment**
```bash
# Set production environment
APP_ENV=production
APP_DEBUG=false
Optimize for production
docker-compose exec app php artisan config:cache
docker-compose exec app php artisan route:cache
docker-compose exec app php artisan view:cache
docker-compose exec app npm run build
SSL Configuration (recommended)
POST /api/videos
Content-Type: application/json
Authorization: Bearer {token}
{
"topic": "How to learn programming",
"style": "educational",
"duration": "5-10 minutes",
"voice": "en-US-female-1"
}
{
"id": "uuid",
"status": "processing",
"topic": "How to learn programming",
"estimated_completion": "2024-01-01T12:00:00Z",
"progress": 0
}
# Run PHP tests
docker-compose exec app php artisan test
# Run JavaScript tests
docker-compose exec app npm run test
# Run integration tests
docker-compose exec app php artisan test --testsuite=Feature
We welcome contributions! Please see our Contributing Guide for details.
Built with β€οΈ by Mohamed Elaassal
β Star this repository if you find it helpful!