Skip to content

eu-lee/adify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Adify

AI-powered video ad generator for Shopify merchants. Paste a store URL, pick a product, and get a TikTok-ready video ad in under a minute β€” no filming, editing, or design skills required.

Adify analyzes your product video with Google Gemini, writes a script that matches what's on screen, generates a professional voiceover, composes mood-matched background music, and assembles everything into a polished vertical video with broadcast-quality audio mixing.

Devpost

Key Features

  • Two ad formats β€” Narrated ads (AI voiceover + ducked music) and Music-Only ads (beat-synced cuts + text overlays)
  • Gemini video intelligence β€” Script and mood are generated after watching the footage, so narration matches the visuals
  • Professional audio β€” Sidechain ducking, stereo imaging, and transition SFX
  • AI music generation β€” Google Lyria creates unique, mood-matched tracks with known BPM for beat-synced editing
  • Works with any Shopify store β€” Just paste the URL, no OAuth or app install needed
  • Multiple durations β€” 15s (Stories/Reels), 30s (TikTok), or 60s (YouTube)

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Next.js Frontend                    β”‚
β”‚                      (App Router)                       β”‚
β”‚                                                         β”‚
β”‚  Landing Page ─► Product Grid ─► Ad Builder ─► Preview  β”‚
β”‚  (app/page)      (app/products)               (ad-prev) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ API Routes ──────────────────────────┐
β”‚                                                         β”‚
β”‚  POST /api/analyze-video   β†’ Compress + Gemini analysis β”‚
β”‚  POST /api/generate-audio  β†’ ElevenLabs TTS narration   β”‚
β”‚  POST /api/generate-music  β†’ Google Lyria music gen     β”‚
β”‚  POST /api/compose-video   β†’ FFmpeg final composition   β”‚
β”‚                                                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚          β”‚          β”‚          β”‚
         β–Ό          β–Ό          β–Ό          β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ Gemini β”‚ β”‚Eleven-  β”‚ β”‚ Lyria β”‚ β”‚ FFmpeg β”‚
    β”‚  2.0   β”‚ β”‚ Labs    β”‚ β”‚       β”‚ β”‚        β”‚
    β”‚ Flash  β”‚ β”‚ TTS     β”‚ β”‚(music)β”‚ β”‚(video) β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜

    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚             Supabase                    β”‚
    β”‚ PostgreSQL (analytics) + Storage (broll)β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚         Shopify Public API              β”‚
    β”‚  Product catalog (no auth required)     β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Ad Generation Pipeline

1. User selects product + ad type + duration
2. Video compressed (640p, CRF 28) + audio analyzed for silence/speech
3. Gemini analyzes video β†’ generates script/cuts + picks voice + determines mood
4. [Narrated] ElevenLabs generates voiceover (per-sentence speed control)
   [Music-Only] Cut boundaries snapped to beat grid
5. Google Lyria generates mood-matched music (fallback: bundled tracks)
6. FFmpeg composes final 1080x1920 MP4:
   - Narrated: video + voice + ducked music + whoosh SFX
   - Music-Only: beat-synced cuts + music + text overlays + riser SFX

Tech Stack

Layer Technology
Framework Next.js 16, React 19, TypeScript
Styling Tailwind CSS 4
Video Intelligence Google Gemini 2.0 Flash
Voice ElevenLabs (Multilingual v2, 6 voice profiles)
Music Google Lyria RealTime
Video Composition FFmpeg (sidechain compression, concat, drawtext)
Database Supabase PostgreSQL
File Storage Supabase Storage (b-roll clips)
Product Data Shopify Storefront / Public API

Project Structure

adify/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ page.tsx                  # Landing page (store connection)
β”‚   β”œβ”€β”€ products/page.tsx         # Product grid + ad builder
β”‚   β”œβ”€β”€ ad-preview/page.tsx       # Video preview player
β”‚   └── api/
β”‚       β”œβ”€β”€ analyze-video/        # Gemini video analysis
β”‚       β”œβ”€β”€ generate-audio/       # ElevenLabs TTS
β”‚       β”œβ”€β”€ generate-music/       # Lyria music generation
β”‚       └── compose-video/        # FFmpeg composition
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ gemini.ts                 # Gemini client + prompts
β”‚   β”œβ”€β”€ elevenlabs.ts             # TTS generation + speed control
β”‚   β”œβ”€β”€ lyria.ts                  # Music generation (streaming)
β”‚   β”œβ”€β”€ ffmpeg.ts                 # Video composition commands
β”‚   β”œβ”€β”€ audio-analysis.ts         # Silence/volume detection
β”‚   β”œβ”€β”€ beats.ts                  # Beat-snap algorithm
β”‚   β”œβ”€β”€ supabase.ts               # Supabase client
β”‚   β”œβ”€β”€ shopify.ts                # Public product API
β”‚   β”œβ”€β”€ storefront.ts             # Shopify Storefront GraphQL
β”‚   └── adStore.ts                # localStorage state
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ music/                    # Fallback background tracks
β”‚   └── sfx/                      # Transition sound effects
└── backend/                      # Optional Express server
    └── src/
        β”œβ”€β”€ server.ts
        β”œβ”€β”€ routes/
        └── lib/

Setup

Prerequisites

  • Node.js 18+
  • FFmpeg with drawtext, silencedetect, sidechaincompress, and concat filters
    # macOS
    brew install ffmpeg
    
    # Ubuntu/Debian
    sudo apt-get install ffmpeg

Install

git clone <repo-url>
cd adify
npm install

Environment Variables

Create a .env file in the project root:

# --- Required ---

# Google Gemini (video analysis + Lyria music generation)
GEMINI_API_KEY_1=your_gemini_api_key

# ElevenLabs (text-to-speech narration)
ELEVENLABS_API_KEY_1=your_elevenlabs_api_key

# Supabase (analytics + b-roll storage)
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key

# --- Optional ---

# Second ElevenLabs key for redundancy
ELEVENLABS_API_KEY_2=

# Supabase direct connection (analytics DB)
DATABASE_URL=postgresql://postgres.[ref]:[password]@aws-0-[region].pooler.supabase.com:5432/postgres

# Custom FFmpeg binary path (defaults to system ffmpeg)
FFMPEG_PATH=/usr/local/bin/ffmpeg

# Backend Express server port (default: 3001)
PORT=3001

External Service Setup

Service What to do
Google Gemini Create a Google Cloud project, enable the Generative AI API, generate an API key
ElevenLabs Create an account at elevenlabs.io, copy your API key from the dashboard
Supabase Create a project at supabase.com, grab the URL and anon key from Settings > API
Shopify No setup needed β€” uses the public /products.json endpoint

Run

# Development (port 3000)
npm run dev

# Production
npm run build && npm start

Optional: Backend Server

The Express backend at backend/ mirrors the video composition endpoint and can run standalone:

cd backend
npm install
npm run dev    # dev (port 3001)
npm run build && npm start  # production

About

πŸ“Ί Adify: turn b-roll into polished ads with dynamic audio | πŸ₯‡ Shopify track @ ListenHacks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors