Skip to content

ajooda/quick-byte

Repository files navigation

QuickByteFacts 🎬

Automated AI-Powered News-to-Video Content Creation System

Transform trending news articles into engaging short-form videos and automatically publish them across YouTube, TikTok, and Instagram.

⚠️ Notice: This is proprietary software shared for portfolio/demonstration purposes. Commercial use, copying, or distribution without permission is prohibited. See LICENSE for full terms.

Laravel Version PHP Version License

🎬 See It In Action
YouTube Instagram


πŸ“‹ Table of Contents

🎯 Overview

QuickByteFacts is an enterprise-grade Laravel application that automates the entire content creation pipelineβ€”from news aggregation to video production and multi-platform distribution. The system uses cutting-edge AI technologies to classify news, generate scripts, create video assets, and intelligently schedule uploads across major social media platforms.

Key Capabilities

  • πŸ”„ Automated News Aggregation: Fetches trending news from multiple sources (NewsAPI, GNews)
  • πŸ€– AI-Powered Classification: Uses OpenAI GPT-4 to categorize and filter news content
  • 🎭 Smart Content Filtering: Vector embeddings with Pinecone to eliminate duplicate content
  • ✍️ Script Generation: AI-generated video scripts optimized for short-form content
  • 🎨 Asset Creation: Automatic generation of visuals and voiceovers for each scene
  • 🎬 Video Assembly: Professional video composition with transitions, subtitles, and background music
  • πŸ“… Intelligent Scheduling: Optimized posting times based on platform best practices
  • πŸš€ Multi-Platform Upload: Automated uploads to YouTube, TikTok, and Instagram Reels

🎬 Live Examples

This project is currently in production and actively generating content! Check out the automated videos created by this system:

These channels are fully automated and showcase the complete pipeline in actionβ€”from news fetching to video generation and publishing.

✨ Features

News Processing Pipeline

  • Multi-source News Fetching: Aggregates news from NewsAPI and GNews with configurable adapters
  • AI Classification: Categorizes news articles using OpenAI GPT-4
  • Novelty Filtering: Uses Pinecone vector database to prevent duplicate content
  • Article Extraction: Intelligent content scraping with Readability parser
  • AI Summarization: Automatic article summarization using Hugging Face models

Content Generation

  • Batch Script Generation: Efficient OpenAI batch API integration for script creation
  • Scene-based Structure: Multi-scene video scripts with hooks, transitions, and metadata
  • Visual Asset Generation: AI-powered video generation using Google Cloud Veo
  • Voiceover Synthesis: ElevenLabs integration for natural-sounding narration
  • Background Music: Intelligent music selection and mixing

Video Production

  • Professional Video Assembly: FFmpeg-based video composition with transitions
  • Word-level Subtitles: Dynamic ASS subtitle generation with precise timing
  • Audio Mixing: Background music and sound effects integration
  • Vertical Format: Optimized for 9:16 aspect ratio (TikTok, Reels, Shorts)

Distribution & Scheduling

  • Platform Integration: OAuth2 authentication for YouTube, TikTok, and Instagram
  • Smart Scheduling: Optimal posting times based on platform analytics
  • Upload Management: Queue-based upload system with retry logic
  • Status Tracking: Real-time monitoring of upload status and responses

Developer Experience

  • Laravel Horizon: Beautiful queue monitoring dashboard
  • Laravel Telescope: Comprehensive debugging and monitoring
  • Docker Support: Full containerization with Laravel Sail
  • Model Caching: Performance optimization with intelligent caching

πŸ›  Tech Stack

Backend

  • Framework: Laravel 12.x
  • Language: PHP 8.2+
  • Queue System: Redis + Laravel Horizon
  • Database: MySQL 8.0
  • Cache: Redis

AI & ML

  • OpenAI API: GPT-4 for classification and script generation
  • Pinecone: Vector database for embeddings and similarity search
  • Hugging Face: Article summarization models
  • Google Cloud Veo: AI video generation
  • ElevenLabs: Voice synthesis
  • PHP-ML: Machine learning utilities

Media Processing

  • FFmpeg: Video composition, transitions, and audio mixing
  • Browsershot: Web scraping and screenshot capabilities
  • Google Cloud Storage: Media asset storage

Frontend

  • Tailwind CSS 4: Modern, utility-first CSS framework
  • Vite: Next-generation frontend build tool
  • Axios: HTTP client for API requests

Infrastructure

  • Docker: Containerization with Laravel Sail
  • ngrok: Local development tunneling
  • Google Cloud Platform: Cloud storage and AI services

πŸ— Architecture

Pipeline Flow

News Fetching β†’ Classification β†’ Novelty Filtering β†’ Article Extraction 
β†’ Summarization β†’ Script Generation β†’ Asset Generation β†’ Video Assembly 
β†’ Upload Scheduling β†’ Multi-Platform Distribution

Event-Driven Architecture

The application uses Laravel's event system to create a decoupled, scalable pipeline:

  1. FetchNewsJob β†’ Triggers NewsFetchedEvent
  2. ClassifyNewsJob β†’ Processes and classifies news
  3. NewsEmbeddingsJob β†’ Creates vector embeddings
  4. NewsNoveltyFilterJob β†’ Filters duplicate content
  5. FetchArticleSummaryJob β†’ Extracts and summarizes articles
  6. GenerateScriptJob β†’ Creates video scripts via OpenAI batch API
  7. StoreGeneratedScriptJob β†’ Saves and processes scripts
  8. GenerateAssetsJob β†’ Creates visuals and voiceovers
  9. ComposeVideoJob β†’ Assembles final video
  10. ScheduleVideoUploadJob β†’ Schedules uploads
  11. UploadVideoJob β†’ Publishes to platforms

Scheduled Tasks

  • Daily: FetchNewsJob - Fetch new news articles
  • Every 5 minutes: Process OpenAI batches, queued assets, and ready scripts
  • Every minute: Process scheduled uploads

πŸ“¦ Requirements

  • PHP 8.2 or higher
  • Composer 2.x
  • Node.js 18+ and npm
  • MySQL 8.0+
  • Redis 6.0+
  • FFmpeg 5.0+ (with libass support)
  • Docker & Docker Compose (optional, for Sail)

πŸš€ Installation

Prerequisites

Ensure you have PHP 8.2+, Composer, Node.js, and MySQL installed on your system.

Step 1: Clone the Repository

git clone git@github.com:AbdAlhadiJ/quick-byte.git
cd QuickByteFacts

Step 2: Install Dependencies

# Install PHP dependencies
composer install

# Install Node.js dependencies
npm install

Step 3: Environment Configuration

# Copy environment file
cp .env.example .env

# Generate application key
php artisan key:generate

Step 4: Configure Environment Variables

Edit .env file with your configuration (see Configuration section).

Step 5: Database Setup

# Run migrations
php artisan migrate

# (Optional) Seed database with sample data
php artisan db:seed

Step 6: Build Frontend Assets

# Development
npm run dev

# Production
npm run build

Step 7: Start Queue Workers

# Start Horizon dashboard
php artisan horizon

# Or use queue:work in development
php artisan queue:work

Step 8: Start Development Server

php artisan serve

The application will be available at http://localhost:8000

Using Docker (Laravel Sail)

# Start containers
./vendor/bin/sail up -d

# Install dependencies
./vendor/bin/sail composer install
./vendor/bin/sail npm install

# Run migrations
./vendor/bin/sail artisan migrate

# Access application at http://localhost

βš™οΈ Configuration

Required Environment Variables

Application

APP_NAME="QuickByteFacts"
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

Database

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=quickbytefacts
DB_USERNAME=root
DB_PASSWORD=

Redis (Queue & Cache)

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

OpenAI

OPENAI_API_KEY=your_openai_api_key
OPENAI_BATCH_SIZE=50
OPENAI_CHAT_ENDPOINT=/v1/chat/completions

Pinecone (Vector Database)

PINECONE_API_KEY=your_pinecone_api_key
PINECONE_INDEXHOST=your_index_host

News Sources

# NewsAPI
NEWSAPI_ENABLED=true
NEWSAPI_API_KEY=your_newsapi_key
NEWSAPI_LIMIT=25

# GNews
GNEWS_ENABLED=true
GNEWS_API_KEY=your_gnews_key
GNEWS_LIMIT=25

Google Cloud (Video Generation & Storage)

GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
GCP_PROJECT_ID=your_project_id
GCP_LOCATION=us-central1
GCP_RESULTS_BUCKET=your_bucket_name
GCP_MODEL=veo-2.0-generate-001

ElevenLabs (Voice Synthesis)

ELEVENLABS_API_KEY=your_elevenlabs_key

Platform OAuth Credentials

YouTube:

YOUTUBE_APPLICATION_CREDENTIALS=/path/to/youtube-credentials.json
YOUTUBE_REFRESH_TOKEN=your_refresh_token

TikTok:

TIKTOK_CLIENT_KEY=your_client_key
TIKTOK_CLIENT_SECRET=your_client_secret
TIKTOK_REDIRECT_URI=http://localhost/oauth2/tiktok/callback

Instagram:

IG_APP_ID=your_app_id
IG_APP_SECRET=your_app_secret
IG_REDIRECT_URI=http://localhost/oauth2/instagram/callback

Other Services

# Article Scraping
SCRAPDO_API_KEY=your_scrapdo_key

# Summarization
HUGGINGFACE_API_KEY=your_huggingface_key
HUGGINGFACE_MODEL=facebook/bart-large-cnn

# Upload Schedule
UPLOAD_SCHEDULE_MODE=weekly  # or 'daily'

πŸ“– Usage

Dashboard

Access the dashboard at /dashboard after logging in to:

  • Monitor upload status
  • Retry failed uploads
  • Manage scheduled content
  • Configure platform settings

Platform Authorization

Authorize platforms via the integrations page:

  • Navigate to /admin/authorize/{platform} (youtube, tiktok, instagram)
  • Complete OAuth flow
  • Credentials are stored automatically

Manual Job Execution

# Fetch news manually
php artisan queue:work --queue=default

# Process OpenAI batches
php artisan batches:process

# Process queued assets
php artisan assets:process

# Process ready scripts
php artisan scripts:process

# Process scheduled uploads (with force option)
php artisan uploads:query --force

Monitoring

  • Horizon Dashboard: /horizon - Queue monitoring
  • Telescope Dashboard: /telescope - Application debugging

πŸ“ Project Structure

QuickByteFacts/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ Console/          # Artisan commands
β”‚   β”œβ”€β”€ Contracts/        # Service interfaces
β”‚   β”œβ”€β”€ Enums/            # Enumeration classes
β”‚   β”œβ”€β”€ Events/           # Event classes
β”‚   β”œβ”€β”€ Http/             # Controllers, middleware
β”‚   β”œβ”€β”€ Jobs/             # Queue jobs
β”‚   β”œβ”€β”€ Listeners/        # Event listeners
β”‚   β”œβ”€β”€ Models/           # Eloquent models
β”‚   β”œβ”€β”€ Services/         # Business logic services
β”‚   β”‚   β”œβ”€β”€ Embeddings/   # Vector embedding services
β”‚   β”‚   β”œβ”€β”€ Media/        # Media processing
β”‚   β”‚   β”œβ”€β”€ News/         # News fetching & processing
β”‚   β”‚   β”œβ”€β”€ OpenAi/       # OpenAI integration
β”‚   β”‚   β”œβ”€β”€ PlatformAuth/ # OAuth implementations
β”‚   β”‚   β”œβ”€β”€ Scrappers/    # Web scraping
β”‚   β”‚   β”œβ”€β”€ Script/       # Script generation
β”‚   β”‚   β”œβ”€β”€ Uploader/     # Platform uploaders
β”‚   β”‚   └── VideoAssembler/ # Video composition
β”‚   └── Providers/        # Service providers
β”œβ”€β”€ config/               # Configuration files
β”œβ”€β”€ database/
β”‚   β”œβ”€β”€ migrations/       # Database migrations
β”‚   └── seeders/          # Database seeders
β”œβ”€β”€ resources/
β”‚   β”œβ”€β”€ views/            # Blade templates
β”‚   β”œβ”€β”€ css/              # Stylesheets
β”‚   └── js/               # JavaScript
β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ web.php           # Web routes
β”‚   └── console.php       # Scheduled tasks
└── tests/                # Test suite

πŸ’» Development

Running the Development Environment

# Using Composer script (runs all services concurrently)
composer dev

# This runs:
# - Laravel development server
# - Queue worker
# - Laravel Pail (logs)
# - Vite dev server

Code Style

The project uses Laravel Pint for code formatting:

./vendor/bin/pint

Testing

# Run tests
php artisan test

# Or with PHPUnit
./vendor/bin/phpunit

Database Migrations

# Create migration
php artisan make:migration create_example_table

# Run migrations
php artisan migrate

# Rollback
php artisan migrate:rollback

🀝 Contributing

This repository is a portfolio project. While contributions are appreciated, please note:

  • This is proprietary software - all contributions become the property of the copyright holder
  • For substantial contributions, please contact me first to discuss terms
  • Small bug fixes and improvements are welcome via pull requests
  • By contributing, you agree that your contributions may be used under the same proprietary license

Contact

For collaboration or contribution inquiries, please contact: abdalhadijouda@gmail.com

Code of Conduct

Please be respectful and professional in all interactions. Harassment or discriminatory behavior will not be tolerated.

πŸ“ License

Copyright (c) 2024 AbdAlhadi Jouda. All Rights Reserved.

This software is proprietary and confidential.

This repository is made available for portfolio and demonstration purposes only.

Permitted Uses:

  • βœ… Viewing and examining the code for learning purposes
  • βœ… Reference in portfolio/showcase contexts
  • βœ… Evaluation by potential employers or collaborators

Prohibited Uses:

  • ❌ Commercial use without explicit permission
  • ❌ Copying, modifying, or creating derivative works
  • ❌ Redistribution or sublicensing
  • ❌ Using this code in competing products

Commercial Licensing:

For commercial use or licensing inquiries, please contact: abdalhadijouda@gmail.com

See the LICENSE file for complete terms and conditions.

πŸ™ Acknowledgments

  • Laravel - The PHP Framework for Web Artisans
  • OpenAI - AI-powered script generation
  • Pinecone - Vector database for embeddings
  • FFmpeg - Multimedia framework
  • All the amazing open-source contributors

πŸ“§ Support

For issues, questions, or contributions, please use the GitHub Issues page.


Made with ❀️ using Laravel

About

AI-Powered Automated News-to-Video Content Creation Platform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published