AI-driven YouTube video generator that creates viral content automatically - from script to upload in minutes. Modern SaaS platform built with Laravel, Vue.js, n8n and Docker, featuring intelligent automation and seamless YouTube integration.
the docker-compose is working now
Mohamed El aassal52b3e272fdea
diff --git a/Dockerfile b/Dockerfileindex f5ce1b7..cbd7af4 100644--- a/Dockerfile+++ b/Dockerfile@@ -1,4 +1,4 @@-FROM php:8.2+FROM php:8.2-fpm# Install system dependenciesRUN apt-get update && apt-get install -y \@@ -54,7 +54,7 @@ RUN npm install --legacy-peer-deps && npm run buildRUN chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache# Expose port-EXPOSE 8000+EXPOSE 9000# Start application-CMD php artisan serve --host=0.0.0.0 --port=8000+CMD ["php-fpm"]diff --git a/STARTUP_GUIDE.md b/STARTUP_GUIDE.mdindex 0c02991..e69de29 100644--- a/STARTUP_GUIDE.md+++ b/STARTUP_GUIDE.md@@ -1,187 +0,0 @@-# 🎉 YouTube Video Generator - Your System is RUNNING!--## ✅ **CONGRATULATIONS! Your YouTube Video Generator is fully operational!**--All containers are up and running successfully. You can now start generating videos immediately.--## 🌐 **Access Your Application Right Now:**--### **Main Application**-**🔗 http://localhost:8000** ← Click to start!--### **n8n Automation Platform**-**🔗 http://localhost:5678** (admin/n8npassword)--## 🚀 **What's Already Working:**--✅ **Laravel Application** - Running on port 8000-✅ **Database** - MySQL with all tables migrated-✅ **Redis** - For caching and queues-✅ **Queue Worker** - Processing video generation jobs-✅ **Nginx** - Web server configured-✅ **n8n** - Automation workflows ready-✅ **FFmpeg** - Video processing enabled-✅ **Python Scripts** - TTS and video generation ready-✅ **API Keys** - All configured and working--## 🎬 **Generate Your First Video (3 Steps):**--### **Step 1: Access the App**-Visit **http://localhost:8000** in your browser--### **Step 2: Create Account**-- Click "Register" to create your account-- Or login if you already have one--### **Step 3: Generate Video**-1. Click "Generate Video" or "Create Video"-2. Enter a topic (e.g., "Benefits of Solar Energy")-3. Choose duration (30 seconds - 10 minutes)-4. Click "Generate"--The system will automatically:-- ✨ Generate AI script using Gemini-- 🎙️ Create voiceover with TTS-- 🖼️ Find relevant images from Pixabay/Unsplash-- 🎬 Assemble video with FFmpeg-- 📺 Upload to YouTube (if connected)-- Login: `admin` / `password123`--**All Services Status:**-```bash-docker-compose ps-```--## 🎬 **Generate Your First Video:**--### **Method 1: Via Laravel Dashboard**-1. Login to http://localhost:8000-2. Click **"Generate Video"**-3. Enter topic: "AI Technology Trends 2025"-4. Click **"Start Generation"**-5. Watch real-time progress!--### **Method 2: Direct n8n Webhook**-```bash-curl -X POST http://localhost:5678/webhook/complete-video-generation \- -H "Content-Type: application/json" \- -d '{- "topic": "Artificial Intelligence in 2025",- "duration": 3,- "user_id": 1,- "video_id": "test-video-001",- "api_token": "demo-token"- }'-```--## 🔍 **Monitor & Debug:**--### **View Logs:**-```bash-# All services-docker-compose logs -f--# Specific service-docker-compose logs -f app-docker-compose logs -f n8n-```--### **Check Container Status:**-```bash-# List all containers-docker-compose ps--# Execute commands in containers-docker-compose exec app bash-docker-compose exec n8n sh-```--### **Test Components:**-```bash-# Test Python scripts-docker-compose exec app python3 /app/scripts/gtts_client.py "Hello world" /tmp/test.mp3--# Test FFmpeg-docker-compose exec app ffmpeg -version--# Test API endpoints-curl http://localhost:8000/api/health-```--## 🎯 **Expected Results:**--**Video Generation Process:**-1. **Script Generation** (30s) - Gemini AI creates YouTube script-2. **Media Fetching** (45s) - Downloads videos/images from Pixabay/Unsplash-3. **Voiceover Creation** (20s) - gTTS generates speech audio-4. **Video Assembly** (60s) - FFmpeg combines everything-5. **Final Video** - Ready for download/YouTube upload!--**Generated Files:**-- Script: Stored in database-- Voiceover: `/tmp/voiceover_{video_id}.mp3`-- Final Video: `/tmp/final_video_{video_id}.mp4`--## 🔧 **Troubleshooting:**--### **If containers won't start:**-```bash-# Clean rebuild-docker-compose down -v-docker-compose up -d --build --force-recreate-```--### **If workflow fails:**-1. Check n8n workflow is **activated**-2. Verify API keys in Laravel `.env`-3. Check container logs: `docker-compose logs -f n8n`--### **If Python scripts fail:**-```bash-# Check Python packages-docker-compose exec app pip3 list | grep -E "gtts|requests"--# Test manually-docker-compose exec app python3 -c "import gtts; print('gTTS OK')"-```--### **If database errors:**-```bash-# Reset database-docker-compose exec app php artisan migrate:fresh --force-```--## 🎉 **Success Indicators:**--- ✅ **http://localhost:8000** shows Laravel welcome page-- ✅ **http://localhost:5678** shows n8n login-- ✅ Demo login works without Google OAuth-- ✅ Workflow webhook responds with JSON-- ✅ Generated video files appear in `/tmp/`--## 🚀 **Production Deployment:**--When ready for production:-1. Set `APP_ENV=production` in `.env`-2. Configure actual Google OAuth credentials-3. Set up YouTube API for each user-4. Use cloud storage for video files-5. Set up monitoring and logging--## 💰 **Cost Summary:**--**Development (FREE):**-- Gemini AI: 1M tokens/day free-- Pixabay: 5000 requests/hour free-- Unsplash: 50 requests/hour free-- gTTS: Unlimited free-- Docker: Free local hosting--**Monthly Production Estimate:**-- Gemini Pro: ~$10-20/month-- Pixabay Pro: $9.99/month-- Unsplash+: $10/month-- Server hosting: $20-50/month-- **Total: ~$50-90/month for unlimited videos**--Your YouTube Video Generator SaaS is now **fully operational** with 100% free APIs for development! 🎉diff --git a/database/migrations/2024_01_02_000000_add_youtube_oauth_to_users_table.php b/database/migrations/2024_01_02_000000_add_youtube_oauth_to_users_table.phpindex 5527b02..021ae13 100644--- a/database/migrations/2024_01_02_000000_add_youtube_oauth_to_users_table.php+++ b/database/migrations/2024_01_02_000000_add_youtube_oauth_to_users_table.php@@ -12,7 +12,13 @@ return new class extends Migrationpublic function up(): void{Schema::table('users', function (Blueprint $table) {- $table->text('youtube_access_token')->nullable()->after('remember_token');+ $table->string('google_id')->nullable()->after('remember_token');+ $table->text('google_access_token')->nullable()->after('google_id');+ $table->text('google_refresh_token')->nullable()->after('google_access_token');+ $table->timestamp('google_token_expires_at')->nullable()->after('google_refresh_token');+ $table->json('google_scopes')->nullable()->after('google_token_expires_at');+ $table->string('avatar_url')->nullable()->after('google_scopes');+ $table->text('youtube_access_token')->nullable()->after('avatar_url');$table->text('youtube_refresh_token')->nullable()->after('youtube_access_token');$table->timestamp('youtube_token_expires_at')->nullable()->after('youtube_refresh_token');});@@ -25,9 +31,15 @@ return new class extends Migration{Schema::table('users', function (Blueprint $table) {$table->dropColumn([+ 'google_id',+ 'google_access_token',+ 'google_refresh_token',+ 'google_token_expires_at',+ 'google_scopes',+ 'avatar_url','youtube_access_token','youtube_refresh_token',- 'youtube_token_expires_at'+ 'youtube_token_expires_at',]);});}diff --git a/database/migrations/2025_08_02_160807_add_oauth_fields_to_users_table.php b/database/migrations/2025_08_02_160807_add_oauth_fields_to_users_table.phpdeleted file mode 100644index 84bcc2a..0000000--- a/database/migrations/2025_08_02_160807_add_oauth_fields_to_users_table.php+++ /dev/null@@ -1,50 +0,0 @@-<?php--use Illuminate\Database\Migrations\Migration;-use Illuminate\Database\Schema\Blueprint;-use Illuminate\Support\Facades\Schema;--return new class extends Migration-{- /**- * Run the migrations.- */- public function up(): void- {- Schema::table('users', function (Blueprint $table) {- $table->string('google_id')->nullable()->index();- $table->text('google_access_token')->nullable();- $table->text('google_refresh_token')->nullable();- $table->timestamp('google_token_expires_at')->nullable();- $table->json('google_scopes')->nullable();- $table->string('avatar_url')->nullable();- $table->enum('subscription_plan', ['free', 'basic', 'pro', 'enterprise'])->default('free');- $table->integer('monthly_video_quota')->default(5);- $table->integer('videos_generated_this_month')->default(0);- $table->timestamp('quota_reset_at')->nullable();- $table->boolean('is_admin')->default(false);- });- }-- /**- * Reverse the migrations.- */- public function down(): void- {- Schema::table('users', function (Blueprint $table) {- $table->dropColumn([- 'google_id',- 'google_access_token',- 'google_refresh_token',- 'google_token_expires_at',- 'google_scopes',- 'avatar_url',- 'subscription_plan',- 'monthly_video_quota',- 'videos_generated_this_month',- 'quota_reset_at',- 'is_admin'- ]);- });- }-};diff --git a/docker-compose.yml b/docker-compose.ymlindex 8722c74..e18f198 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -7,6 +7,8 @@ services:container_name: youtube_generator_apprestart: unless-stoppedworking_dir: /var/www+ expose:+ - "9000"volumes:- ./:/var/www- ./docker/php/local.ini:/usr/local/etc/php/conf.d/local.inidiff --git a/docker/nginx/app.conf b/docker/nginx/app.confindex 2de4867..8a3da94 100644--- a/docker/nginx/app.conf+++ b/docker/nginx/app.conf@@ -6,10 +6,18 @@ server {root /var/www/public;location / {- proxy_pass http://app:8000;- proxy_set_header Host $host;- proxy_set_header X-Real-IP $remote_addr;- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;- proxy_set_header X-Forwarded-Proto $scheme;+ try_files $uri $uri/ /index.php?$query_string;+ }++ location ~ \.php$ {+ include fastcgi_params;+ fastcgi_pass app:9000;+ fastcgi_index index.php;+ fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;+ fastcgi_param DOCUMENT_ROOT $realpath_root;+ }++ location ~ /\.ht {+ deny all;}}diff --git a/package-lock.json b/package-lock.jsonindex 0808035..7712570 100644--- a/package-lock.json+++ b/package-lock.json@@ -1,5 +1,5 @@{- "name": "youtubeVideoGenerator",+ "name": "www","lockfileVersion": 3,"requires": true,"packages": {diff --git a/public/info.php b/public/info.phpnew file mode 100644index 0000000..61ace19--- /dev/null+++ b/public/info.php@@ -0,0 +1,2 @@+<?php+phpinfo();diff --git a/test-system.bat b/test-system.batindex b9d2446..e69de29 100644--- a/test-system.bat+++ b/test-system.bat@@ -1,27 +0,0 @@-@echo off-echo ============================================-echo Testing YouTube Video Generator System-echo ============================================-echo.--echo Testing API endpoints...-echo.--echo 1. Testing Laravel health...-curl -s http://localhost:8000/api/health || echo "Laravel not ready yet"--echo.-echo 2. Testing n8n health...-curl -s http://localhost:5678/health || echo "N8n not ready yet"--echo.-echo 3. Testing video generation webhook...-curl -X POST http://localhost:5678/webhook/complete-video-generation ^- -H "Content-Type: application/json" ^- -d "{\"topic\":\"Test Video\",\"duration\":2,\"user_id\":1,\"video_id\":\"test-123\",\"api_token\":\"test-token\"}" || echo "Webhook not ready yet"--echo.-echo ============================================-echo Test completed!-echo ============================================-pause