vault-video-processor / docs /project-overview.md
dvijaykrishnan's picture
docs: Introduce comprehensive technical documentation and update planning artifacts to reflect MVP completion and detailed FR implementation status.
d03d74d
|
Raw
History Blame Contribute Delete
14.1 kB

Vault - Project Overview

Generated: 2026-02-11
Project Type: SaaS / Web Application
Domain: E-Commerce / Creator Economy
Complexity: Medium-High


Executive Summary

Vault is an AI-powered e-commerce platform that transforms YouTube video archives into shoppable experiences. The platform automatically detects products featured in videos, matches them to marketplace listings (Amazon, eBay, Etsy), and creates passive revenue streams for content creators through affiliate marketing.

Core Value Proposition

  • For Creators: Monetize historical video content without manual tagging
  • For Viewers: Discover and purchase products from trusted creators
  • For Marketplaces: High-intent traffic from engaged audiences

Business Goals

Success Criteria

Metric Target
First affiliate revenue (video >12 months old) Within 7 days of archive activation
Viewer product discovery Under 3 clicks to find specific item
Creator passive revenue (Standard tier) >$100/month average (12-month goal)
AI matching accuracy >85% precision
Vault grid load time <1.5 seconds on 4G
Archive processing 1,000 videos within 48 hours

Innovation: "Lost Intent" Capture

Vault captures unmet demand for discontinued or out-of-stock items mentioned in historical media. When products are unavailable, viewers can click "I want this" to join a waitlist, creating valuable demand data for:

  • Creators (sourcing opportunities)
  • Resellers (market insights)
  • Brands (demand signals)

Architecture Overview

High-Level Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        VAULT PLATFORM                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚  β”‚   Vercel    β”‚    β”‚   Railway   β”‚    β”‚   Supabase  β”‚        β”‚
β”‚  β”‚  (Frontend) β”‚    β”‚  (Workers)  β”‚    β”‚  (Database) β”‚        β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜        β”‚
β”‚         β”‚                  β”‚                  β”‚                β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β”‚
β”‚                            β”‚                                   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚  β”‚                   Inngest                          β”‚        β”‚
β”‚  β”‚         (Durable Workflow Orchestration)           β”‚        β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β”‚                            β”‚                                   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚  β”‚              External Integrations                 β”‚        β”‚
β”‚  β”‚  YouTube β”‚ Amazon β”‚ eBay β”‚ Etsy β”‚ Gemini β”‚ Redis  β”‚        β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β”‚                                                                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Technology Decisions

Decision Choice Rationale
Framework Next.js 15 (App Router) SSR for SEO, Server Actions for mutations
Database Supabase Postgres Managed Postgres with built-in auth options
ORM Drizzle Type-safe, lightweight, migration support
Background Jobs Inngest Durable workflows, automatic retries, observability
Caching Upstash Redis TTL-based caching, serverless-friendly
Auth Better Auth Next.js 15 App Router compatibility, YouTube OAuth
AI Vision Gemini + HuggingFace Multi-provider flexibility, cost optimization
Deployment Vercel + Railway Hybrid: Edge frontend + persistent workers

Feature Modules

1. Discovery Pipeline (src/features/discovery/)

Purpose: AI-powered video scanning and object detection

Components:

  • YouTube OAuth integration
  • Video archive scanning (Inngest workflow)
  • Frame extraction (FFmpeg)
  • AI vision analysis (Gemini/HuggingFace)
  • Thumbnail storage (Supabase Storage)

Key Files:

2. Marketplace Integration (src/features/marketplace/)

Purpose: Product matching and affiliate link generation

Supported Marketplaces:

  • Amazon (PA-API 5.0)
  • eBay (Finding API)
  • Etsy (Open API v3)

Key Files:

3. Vault Experience (src/features/vault/)

Purpose: Public-facing product discovery interface

Features:

  • Mobile-first responsive grid
  • Category filtering
  • Product search
  • Affiliate redirect tracking
  • Interest capture for out-of-stock items

Key Files:

4. Moderation System (src/features/moderation/)

Purpose: Creator review and curation of AI detections

Features:

  • Approval/rejection workflow
  • Bulk operations
  • Detection editing (name, category, links)
  • Manual product addition
  • Admin moderation for high-ambiguity items

Key Files:

5. Interest Capture (src/features/interest/)

Purpose: "Lost Intent" demand capture

Features:

  • Email waitlist for unavailable items
  • GDPR/CCPA compliant consent
  • Duplicate prevention (email hashing)
  • Notification system

Key Files:

6. Analytics (src/features/analytics/)

Purpose: Creator insights and metrics

Features:

  • Click tracking
  • Interest pledge counts
  • Revenue attribution
  • Key metrics dashboard

Key Files:


User Roles

Role Description Key Permissions
Anonymous Viewer Public visitor Browse vaults, search products, click affiliate links
Registered Creator Content creator Connect YouTube, moderate detections, view analytics
Admin Platform operator All creator permissions + admin moderation, user management

Data Flow

Video Processing Pipeline

YouTube Video
     β”‚
     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Scan      β”‚ ◄── Inngest: scan-video-archive
β”‚   Archive   β”‚
β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
      β”‚
      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Extract   β”‚ ◄── FFmpeg frame extraction
β”‚   Frames    β”‚
β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
      β”‚
      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Detect    β”‚ ◄── Inngest: detect-objects
β”‚   Objects   β”‚     (Gemini/HuggingFace)
β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
      β”‚
      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Match     β”‚ ◄── Inngest: match-marketplace
β”‚  Products   β”‚     (Amazon/eBay/Etsy)
β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
      β”‚
      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Moderate   β”‚ ◄── Creator review
β”‚   Queue     β”‚
β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
      β”‚
      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Public    β”‚ ◄── Vault grid display
β”‚   Vault     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Security & Compliance

Authentication

  • Google OAuth with YouTube readonly scope
  • Better Auth session management
  • Secure cookie handling (production)

Data Protection

  • PII encryption (emails) at rest
  • AES-256 encrypted email storage
  • SHA-256 hashing for deduplication
  • Unsubscribe tokens for GDPR compliance

API Security

  • YouTube API ToS compliance
  • Marketplace API rate limit handling
  • Sentry error tracking
  • Input validation on all server actions

Performance Targets

Metric Target Strategy
LTI (Load-to-Interactivity) <1.5s on 4G SSR + ISR + Edge caching
Search latency <300ms Redis caching, indexed queries
Traffic spike handling 10x surge <10% degradation CDN, connection pooling
Uptime 99.9% Multi-region deployment, health checks

Deployment Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      PRODUCTION                              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”‚
β”‚  β”‚     Vercel       β”‚         β”‚     Railway      β”‚         β”‚
β”‚  β”‚   (Edge/Server)  β”‚         β”‚   (Background)   β”‚         β”‚
β”‚  β”‚                  β”‚         β”‚                  β”‚         β”‚
β”‚  β”‚  β€’ Next.js App   β”‚         β”‚  β€’ Inngest       β”‚         β”‚
β”‚  β”‚  β€’ SSR/ISR       β”‚         β”‚    Functions     β”‚         β”‚
β”‚  β”‚  β€’ API Routes    β”‚         β”‚  β€’ FFmpeg        β”‚         β”‚
β”‚  β”‚  β€’ Server        β”‚         β”‚    Processing    β”‚         β”‚
β”‚  β”‚    Actions       β”‚         β”‚                  β”‚         β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β”‚
β”‚           β”‚                            β”‚                    β”‚
β”‚           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                    β”‚
β”‚                        β”‚                                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”             β”‚
β”‚  β”‚              External Services              β”‚             β”‚
β”‚  β”‚                                             β”‚             β”‚
β”‚  β”‚  β€’ Supabase (Postgres + Storage)           β”‚             β”‚
β”‚  β”‚  β€’ Upstash Redis (Caching)                 β”‚             β”‚
β”‚  β”‚  β€’ Inngest Cloud (Workflow orchestration)  β”‚             β”‚
β”‚  β”‚  β€’ Sentry (Error monitoring)               β”‚             β”‚
β”‚  β”‚  β€’ Google Cloud (YouTube API, Gemini)      β”‚             β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β”‚
β”‚                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Related Documentation