Skip to content

aayushbaluni/Video-Automation-Creation

🎬 AI Video Automation

Fully automated YouTube Shorts generation with AI - From text prompt to published video in minutes.

License: MIT Node.js TypeScript Next.js


✨ Features

🎯 Complete Pipeline

  • AI Script Generation - Uses Perplexity AI for engaging, factual scripts
  • Text-to-Speech - Google Cloud TTS with natural Neural2 voices
  • AI Image Generation - Pollinations.ai (100% FREE, no API key)
  • Stock Videos - Pexels integration for B-roll
  • Video Rendering - FFmpeg with transitions, captions, and effects
  • Auto Upload - Direct YouTube Shorts publishing

πŸ–₯️ Modern Dashboard

  • Beautiful Next.js 14 frontend with dark mode
  • Real-time video generation progress
  • API key management with rate limiting
  • Usage analytics and cost tracking
  • User authentication (JWT + Sessions)

πŸ€– MCP Integration

  • Model Context Protocol server for AI agents
  • Claude Desktop compatible
  • Full API access through natural language

πŸ’° Cost Efficient

Service Cost per Video
Perplexity AI ~$0.02
Google TTS ~$0.01
Pexels FREE
Pollinations AI FREE
Total ~$0.03/video

πŸš€ Quick Start

Prerequisites

  • Node.js 20+
  • pnpm 10.28.0+ (required - npm not supported)
  • PostgreSQL 16+
  • FFmpeg (for video rendering)
# Install pnpm
npm install -g pnpm

# Install FFmpeg (macOS)
brew install ffmpeg

# Install FFmpeg (Ubuntu)
sudo apt install ffmpeg

Installation

# Clone the repository
git clone https://github.com/aayushbaluni/Video-Automation-Creation.git
cd Video-Automation-Creation

# Install dependencies
cd backend && pnpm install
cd ../frontend && pnpm install
cd ..

# Configure environment
cp backend/env.template backend/.env
# Edit backend/.env with your API keys

# Setup database
cd backend
pnpm run db:migrate

# Start everything
cd ..
./start-local.sh

Opens:


βš™οΈ Configuration

Copy backend/env.template to backend/.env and configure:

Required

Variable Description Get it from
DATABASE_URL PostgreSQL connection Your PostgreSQL instance
JWT_SECRET Auth secret (32+ chars) openssl rand -hex 32
PERPLEXITY_API_KEY Script generation perplexity.ai
GOOGLE_CLOUD_TTS_API_KEY Text-to-speech Google Cloud Console
PEXELS_API_KEY Stock videos pexels.com/api

Optional

Variable Description
YOUTUBE_* YouTube upload (OAuth)
AWS_* S3 video storage
SMTP_* Email verification
HUGGINGFACE_TOKEN Additional AI images

πŸ“ Project Structure

Video-Automation-Creation/
β”œβ”€β”€ backend/                 # Node.js/Express/TypeScript API
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ api/            # REST API routes
β”‚   β”‚   β”œβ”€β”€ mcp/            # MCP server for AI agents
β”‚   β”‚   β”œβ”€β”€ pipeline/       # Video generation pipeline
β”‚   β”‚   β”œβ”€β”€ services/       # External service integrations
β”‚   β”‚   └── db/             # Database migrations
β”‚   └── env.template        # Environment template
β”œβ”€β”€ frontend/               # Next.js 14 React dashboard
β”‚   └── src/
β”‚       β”œβ”€β”€ app/            # App router pages
β”‚       β”œβ”€β”€ components/     # React components
β”‚       └── lib/            # Utilities
β”œβ”€β”€ documentation/          # Project documentation
β”œβ”€β”€ start-local.sh          # Start all services
└── stop-local.sh           # Stop all services

πŸ“‹ Available Commands

Backend (backend/)

pnpm run dev:api       # Start API server (development)
pnpm run dev:mcp       # Start MCP server for Claude
pnpm run db:migrate    # Run database migrations
pnpm run db:seed       # Seed initial data
pnpm run build         # Build for production
pnpm run generate      # CLI: Generate video

Frontend (frontend/)

pnpm run dev           # Start development server
pnpm run build         # Build for production
pnpm run lint          # Run linter

πŸ”Œ API Usage

Authentication

# Login to get session token
curl -X POST http://localhost:8000/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "password": "your-password"}'

Generate Video

# Start video generation
curl -X POST http://localhost:8000/api/v1/pipeline/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "topic": "5 Amazing Facts About Space",
    "style": "educational",
    "duration": 60
  }'

Check Job Status

curl http://localhost:8000/api/v1/pipeline/jobs/JOB_ID \
  -H "Authorization: Bearer YOUR_API_KEY"

See API Documentation for full API reference.


πŸ€– MCP Integration (Claude Desktop)

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "video-automation": {
      "command": "pnpm",
      "args": ["run", "dev:mcp"],
      "cwd": "/absolute/path/to/Video-Automation-Creation/backend",
      "env": {
        "API_KEY": "your-api-key-here"
      }
    }
  }
}

Then ask Claude: "Generate a 60-second video about AI trends in 2026"


πŸ”’ Security

  • βœ… JWT authentication with refresh tokens
  • βœ… API key management with scoped permissions
  • βœ… Rate limiting per key/IP
  • βœ… Email verification
  • βœ… Password hashing (bcrypt)
  • βœ… CORS configuration
  • βœ… Helmet security headers
  • βœ… Input validation (Zod schemas)

πŸ› οΈ Tech Stack

Layer Technology
Backend Node.js 20, TypeScript, Express.js
Frontend Next.js 14, React 18, Tailwind CSS
Database PostgreSQL 16
Video FFmpeg
AI Perplexity, Google TTS, Pollinations.ai
Storage AWS S3 (optional)
Package Manager pnpm 10.28.0

πŸ› Troubleshooting

Port Already in Use

./stop-local.sh && ./start-local.sh

Database Connection Failed

# macOS
brew services start postgresql@16

# Or check if running
pg_isready

FFmpeg Not Found

# macOS
brew install ffmpeg

# Ubuntu/Debian
sudo apt install ffmpeg

# Verify
ffmpeg -version

"pnpm: command not found"

npm install -g pnpm
# OR
brew install pnpm

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Use pnpm exclusively (not npm or yarn)
  • Follow TypeScript strict mode
  • Write meaningful commit messages
  • Add tests for new features
  • Update documentation as needed

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments


πŸ“Š Project Status

Component Status
Backend API βœ… Production Ready
Frontend Dashboard βœ… Production Ready
MCP Server βœ… Complete
Documentation βœ… Complete
Tests 🚧 In Progress

Ready to generate videos? Run ./start-local.sh and visit http://localhost:3000 πŸš€

About

Fully automated YouTube Shorts generation with AI - From text prompt to published video in minutes.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors