Skip to content

wflores9/StudioBot.ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

StudioBot.ai - AI-Powered Video Analysis & Multi-Platform Distribution

StudioBot.ai is a sophisticated AI software platform that analyzes videos submitted via URL, automatically identifies viral moments, creates optimized clips and shorts, generates compelling thumbnails, and distributes content across multiple platforms (YouTube, Twitch, Rumble) with user approval workflows.

πŸ“‹ Table of Contents

✨ Features

Core Capabilities

  1. Video Ingestion

    • Accept videos via URL
    • Automatic download and storage
    • Support for multiple formats
    • File size and duration validation
  2. AI Video Analysis

    • Automated viral moment detection
    • Confidence scoring for each moment
    • Keyframe identification
    • Content tagging and categorization
    • Time-coded segment analysis
  3. Content Creation

    • Automatic clip generation from viral moments
    • Vertical video format conversion (Shorts/Reels)
    • Smart thumbnail generation
    • Multiple resolution support
    • Batch processing capabilities
  4. User Approval Workflow

    • Review clips before publishing
    • Approval/rejection with notes
    • Batch approval operations
    • Content curation dashboard
  5. Multi-Platform Distribution

    • YouTube integration (upload, schedule, publish)
    • Twitch integration (stream, upload VOD)
    • Rumble integration (content upload)
    • Platform-specific formatting
    • Simultaneous multi-platform publishing
  6. Analytics & Management

    • Real-time view counts
    • Engagement metrics
    • Distribution history
    • Platform-specific analytics
    • Content performance tracking

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   StudioBot.ai Platform                       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚            Express.js API Server (Node.js)              β”‚  β”‚
β”‚  β”‚  Port: 3000 (configurable via .env)                     β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                          β”‚                                    β”‚
β”‚        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                 β”‚
β”‚        β”‚                 β”‚                 β”‚                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚  β”‚ Auth Routes  β”‚  β”‚ Video Routes β”‚ β”‚ Clip Routes  β”‚        β”‚
β”‚  β”‚ /api/auth    β”‚  β”‚ /api/videos  β”‚ β”‚ /api/clips   β”‚        β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β”‚        β”‚                 β”‚                 β”‚                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚  β”‚Short Routes  β”‚  β”‚Thumbnail Rtesβ”‚ β”‚Platform Rtes β”‚        β”‚
β”‚  β”‚/api/shorts   β”‚  β”‚/api/thumbnls β”‚ β”‚/api/platformsβ”‚        β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β”‚                                                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚              Service Layer (Business Logic)             β”‚  β”‚
β”‚  β”‚  β€’ VideoService    β€’ ClipService                        β”‚  β”‚
β”‚  β”‚  β€’ ShortService    β€’ ThumbnailService                   β”‚  β”‚
β”‚  β”‚  β€’ PlatformService β€’ AuthService                        β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                          β”‚                                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚            Data Layer (SQLite Database)                 β”‚  β”‚
β”‚  β”‚  β€’ Users β€’ Videos β€’ Clips β€’ Shorts                      β”‚  β”‚
β”‚  β”‚  β€’ Thumbnails β€’ Platforms β€’ Distributions              β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚           File Storage & Processing                     β”‚  β”‚
β”‚  β”‚  β€’ FFmpeg (video processing)                            β”‚  β”‚
β”‚  β”‚ β€’ Temp storage: ./temp/videos                          β”‚  β”‚
β”‚  β”‚  β€’ Output: ./output/{clips,shorts,thumbnails}          β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                          β”‚                                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚                 β”‚                 β”‚
    β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”        β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”       β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”
    β”‚ YouTube β”‚        β”‚ Twitch β”‚       β”‚ Rumble β”‚
    β”‚   API   β”‚        β”‚  API   β”‚       β”‚  API   β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ’» Technology Stack

Backend

  • Runtime: Node.js (v18+)
  • Framework: Express.js
  • Language: TypeScript
  • Database: SQLite 3
  • API Clients: Axios
  • Video Processing: FFmpeg (integrated via Node.js)

Development

  • Transpiler: TypeScript Compiler (tsc)
  • Dev Server: ts-node
  • Linting: ESLint
  • Testing: Jest

External Integration

  • YouTube Data API v3
  • Twitch API
  • Rumble API

πŸš€ Installation & Setup

Prerequisites

  • Node.js v18 or higher
  • npm or yarn
  • FFmpeg installed on system
  • Git

Step 1: Clone Repository

cd c:\Users\wflor\OneDrive\StudioBot.ai
git init

Step 2: Install Dependencies

npm install

Step 3: Configure Environment

# Copy environment template
cp .env.example .env

# Edit .env with your configuration

Step 4: Build Project

npm run build

Step 5: Initialize Database

The database is automatically initialized on server startup.

Step 6: Start Development Server

npm run dev

Step 7: Start Production Server

npm run build
npm start

πŸ–₯️ UI Development β€” Web + Desktop

Quick commands to run the Next web UI and Electron desktop app locally.

Start the web dev server (Next.js, port 3001):

cd ui/web
npm run dev

Start Electron after the web server is ready (Windows PowerShell):

cd ui/desktop
npm run dev:wait
# or run the small PowerShell helper directly:
# .\scripts\run-electron.ps1

Start both (cross-platform) from repo root:

npm run dev:all

Notes:

  • dev:all uses concurrently (added to root devDependencies).
  • ui/desktop/scripts/run-electron.js and run-electron.ps1 wait for the web URL before launching Electron.

πŸ“ Project Structure

StudioBot.ai/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts                 # Main application entry point
β”‚   β”œβ”€β”€ database/
β”‚   β”‚   └── init.ts             # Database initialization & schema
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ auth.routes.ts       # Authentication endpoints
β”‚   β”‚   β”œβ”€β”€ video.routes.ts      # Video management endpoints
β”‚   β”‚   β”œβ”€β”€ clip.routes.ts       # Clip management endpoints
β”‚   β”‚   β”œβ”€β”€ short.routes.ts      # Shorts/Vertical video endpoints
β”‚   β”‚   β”œβ”€β”€ thumbnail.routes.ts  # Thumbnail generation endpoints
β”‚   β”‚   └── platform.routes.ts   # Platform integration endpoints
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ auth.service.ts      # Authentication logic
β”‚   β”‚   β”œβ”€β”€ video.service.ts     # Video processing logic
β”‚   β”‚   β”œβ”€β”€ clip.service.ts      # Clip generation logic
β”‚   β”‚   β”œβ”€β”€ short.service.ts     # Shorts conversion logic
β”‚   β”‚   β”œβ”€β”€ thumbnail.service.ts # Thumbnail generation logic
β”‚   β”‚   └── platform.service.ts  # Platform publishing logic
β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   └── errorHandler.ts      # Global error handling
β”‚   β”œβ”€β”€ types/
β”‚   β”‚   └── models.ts            # TypeScript type definitions
β”‚   └── utils/
β”‚       └── logger.ts            # Logging utility
β”œβ”€β”€ dist/                        # Compiled JavaScript (generated)
β”œβ”€β”€ temp/                        # Temporary video storage
β”œβ”€β”€ output/                      # Output files (clips, shorts, thumbnails)
β”œβ”€β”€ logs/                        # Application logs
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ .env.example
└── README.md

πŸ“‘ API Documentation

Authentication Endpoints

Register User

POST /api/auth/register
Content-Type: application/json

{
  "username": "john_doe",
  "email": "john@example.com",
  "password": "SecurePassword123"
}

Response: 201 Created
{
  "status": "success",
  "data": {
    "id": "uuid",
    "username": "john_doe",
    "email": "john@example.com",
    "created_at": "2024-02-08T10:30:00Z"
  }
}

Login

POST /api/auth/login
Content-Type: application/json

{
  "email": "john@example.com",
  "password": "SecurePassword123"
}

Response: 200 OK
{
  "status": "success",
  "data": {
    "user": {
      "id": "uuid",
      "username": "john_doe",
      "email": "john@example.com"
    },
    "token": "eyJhbGc..."
  }
}

Video Endpoints

Upload Video from URL

POST /api/videos/upload
Content-Type: application/json

{
  "user_id": "user_uuid",
  "source_url": "https://example.com/video.mp4",
  "title": "Amazing Action Video",
  "description": "Optional video description"
}

Response: 201 Created
{
  "status": "success",
  "data": {
    "id": "video_uuid",
    "user_id": "user_uuid",
    "title": "Amazing Action Video",
    "source_url": "https://example.com/video.mp4",
    "status": "pending",
    "created_at": "2024-02-08T10:30:00Z"
  },
  "message": "Video upload initiated. Processing started."
}

Get Video Analysis

GET /api/videos/:videoId/analysis

Response: 200 OK
{
  "status": "success",
  "data": {
    "viralMoments": [
      {
        "startTime": 15,
        "endTime": 45,
        "confidence": 0.95,
        "description": "High-energy action sequence",
        "tags": ["action", "engaging", "viral"]
      }
    ],
    "summary": "Video contains 2 major viral moments",
    "estimatedLength": 300,
    "keyframes": [...]
  }
}

Clip Endpoints

Create Clip

POST /api/clips/create
Content-Type: application/json

{
  "video_id": "video_uuid",
  "user_id": "user_uuid",
  "title": "Epic Moment",
  "description": "Extracted viral moment",
  "start_time": 15,
  "end_time": 45
}

Response: 201 Created
{
  "status": "success",
  "data": {
    "id": "clip_uuid",
    "video_id": "video_uuid",
    "user_id": "user_uuid",
    "title": "Epic Moment",
    "start_time": 15,
    "end_time": 45,
    "duration": 30,
    "status": "pending",
    "approved": false,
    "created_at": "2024-02-08T10:30:00Z"
  }
}

Approve Clip

PATCH /api/clips/:clipId/approve
Content-Type: application/json

{
  "approved": true,
  "approval_notes": "Great content, ready to publish"
}

Response: 200 OK
{
  "status": "success",
  "data": {
    "id": "clip_uuid",
    "approved": true,
    "approval_notes": "Great content, ready to publish",
    "updated_at": "2024-02-08T10:35:00Z"
  }
}

Shorts Endpoints

Convert Clip to Short

POST /api/shorts/create-from-clip
Content-Type: application/json

{
  "clip_id": "clip_uuid",
  "user_id": "user_uuid",
  "title": "Epic Short",
  "description": "Vertical format short"
}

Response: 201 Created
{
  "status": "success",
  "data": {
    "id": "short_uuid",
    "clip_id": "clip_uuid",
    "title": "Epic Short",
    "duration": 30,
    "resolution": "1080x1920",
    "status": "pending",
    "created_at": "2024-02-08T10:30:00Z"
  }
}

Thumbnail Endpoints

Generate Thumbnail

POST /api/thumbnails/generate
Content-Type: application/json

{
  "source_id": "video_uuid",
  "source_type": "video",
  "timestamp": 15
}

Response: 201 Created
{
  "status": "success",
  "data": {
    "id": "thumbnail_uuid",
    "source_id": "video_uuid",
    "source_type": "video",
    "size": "1280x720",
    "status": "pending",
    "created_at": "2024-02-08T10:30:00Z"
  }
}

Platform Endpoints

Connect Platform

POST /api/platforms/youtube/connect
Content-Type: application/json

{
  "user_id": "user_uuid",
  "credentials": {
    "access_token": "youtube_access_token",
    "refresh_token": "youtube_refresh_token",
    "channel_id": "UCxxxxx"
  }
}

Response: 201 Created
{
  "status": "success",
  "data": {
    "id": "platform_uuid",
    "user_id": "user_uuid",
    "platform_name": "youtube",
    "channel_id": "UCxxxxx",
    "is_connected": true,
    "created_at": "2024-02-08T10:30:00Z"
  }
}

Publish Content

POST /api/platforms/youtube/publish
Content-Type: application/json

{
  "user_id": "user_uuid",
  "content_id": "short_uuid",
  "content_type": "short",
  "metadata": {
    "title": "Epic Moment",
    "description": "Auto-generated viral short",
    "tags": ["viral", "action"],
    "visibility": "public"
  }
}

Response: 201 Created
{
  "status": "success",
  "data": {
    "id": "distribution_uuid",
    "content_id": "short_uuid",
    "content_type": "short",
    "platform_name": "youtube",
    "status": "publishing",
    "created_at": "2024-02-08T10:30:00Z"
  }
}

πŸ—„οΈ Database Schema

Users Table

CREATE TABLE users (
  id TEXT PRIMARY KEY,
  username TEXT UNIQUE NOT NULL,
  email TEXT UNIQUE NOT NULL,
  password_hash TEXT NOT NULL,
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);

Videos Table

CREATE TABLE videos (
  id TEXT PRIMARY KEY,
  user_id TEXT NOT NULL,
  title TEXT NOT NULL,
  description TEXT,
  source_url TEXT NOT NULL,
  local_path TEXT,
  duration INTEGER,
  file_size INTEGER,
  status TEXT DEFAULT 'pending',
  analysis_data TEXT,
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY (user_id) REFERENCES users(id)
);

Clips Table

CREATE TABLE clips (
  id TEXT PRIMARY KEY,
  video_id TEXT NOT NULL,
  user_id TEXT NOT NULL,
  title TEXT NOT NULL,
  description TEXT,
  start_time REAL NOT NULL,
  end_time REAL NOT NULL,
  duration REAL NOT NULL,
  output_path TEXT,
  status TEXT DEFAULT 'pending',
  approved BOOLEAN DEFAULT 0,
  approval_notes TEXT,
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY (video_id) REFERENCES videos(id),
  FOREIGN KEY (user_id) REFERENCES users(id)
);

Shorts Table

CREATE TABLE shorts (
  id TEXT PRIMARY KEY,
  clip_id TEXT NOT NULL,
  user_id TEXT NOT NULL,
  title TEXT NOT NULL,
  description TEXT,
  output_path TEXT,
  duration REAL,
  resolution TEXT DEFAULT '1080x1920',
  status TEXT DEFAULT 'pending',
  approved BOOLEAN DEFAULT 0,
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY (clip_id) REFERENCES clips(id),
  FOREIGN KEY (user_id) REFERENCES users(id)
);

Platforms & Distributions

Stores user platform credentials, API keys, and tracks all content distributions across platforms with view counts and engagement data.

πŸ”„ Workflow

Complete Content Processing Workflow

1. USER UPLOADS VIDEO
   ↓
   POST /api/videos/upload
   β”œβ”€ Validate URL and metadata
   β”œβ”€ Create video record (status: pending)
   └─ Trigger async download

2. VIDEO PROCESSING (Async)
   β”œβ”€ Download from source URL
   β”œβ”€ Update status: downloading
   β”œβ”€ AI Analysis on video content
   β”œβ”€ Identify viral moments
   β”œβ”€ Extract keyframes
   β”‚  
   β”œβ”€ Update status: analyzed
   β”œβ”€ Store analysis data in database
   └─ Notify user of completion

3. USER REVIEWS ANALYSIS
   β”œβ”€ GET /api/videos/:videoId/analysis
   β”œβ”€ View identified viral moments
   β”œβ”€ View confidence scores
   └─ View suggested time ranges

4. USER CREATES CLIPS
   β”œβ”€ POST /api/clips/create
   β”œβ”€ Specify start_time and end_time
   β”œβ”€ Add title and description
   β”œβ”€ Create clip record (status: pending)
   └─ Trigger async clip generation

5. CLIP GENERATION (Async)
   β”œβ”€ Extract segment from video using FFmpeg
   β”œβ”€ Apply optimizations
   β”œβ”€ Update status: ready
   └─ Store output path

6. USER CREATES SHORTS
   β”œβ”€ POST /api/shorts/create-from-clip
   β”œβ”€ Convert to vertical format (1080x1920)
   β”œβ”€ Create short record (status: pending)
   └─ Trigger async conversion

7. SHORT CONVERSION (Async)
   β”œβ”€ Resize and reformat to 9:16 aspect ratio
   β”œβ”€ Add padding/letterboxing if needed
   β”œβ”€ Apply any effects
   β”œβ”€ Update status: ready
   └─ Store output path

8. THUMBNAIL GENERATION
   β”œβ”€ POST /api/thumbnails/generate
   β”œβ”€ Extract keyframe from clip/short
   β”œβ”€ Create thumbnail (1280x720)
   β”œβ”€ Update status: ready
   └─ Store output path

9. USER APPROVAL
   β”œβ”€ PATCH /api/clips/:clipId/approve (approved: true)
   β”œβ”€ PATCH /api/shorts/:shortId/approve (approved: true)
   β”œβ”€ Thumbnail auto-approved with clip
   └─ Add approval notes (optional)

10. PLATFORM CONNECTION
    β”œβ”€ POST /api/platforms/youtube/connect
    β”œβ”€ POST /api/platforms/twitch/connect
    β”œβ”€ POST /api/platforms/rumble/connect
    β”œβ”€ Validate credentials
    β”œβ”€ Store encrypted tokens
    └─ Mark as connected

11. CONTENT DISTRIBUTION
    β”œβ”€ POST /api/platforms/youtube/publish
    β”œβ”€ POST /api/platforms/twitch/publish
    β”œβ”€ POST /api/platforms/rumble/publish
    β”œβ”€ Create distribution records
    └─ Trigger async multi-platform publishing

12. MULTI-PLATFORM PUBLISHING (Async)
    β”œβ”€ YouTube
    β”‚  β”œβ”€ Upload short video
    β”‚  β”œβ”€ Set title, description, tags
    β”‚  β”œβ”€ Set thumbnail
    β”‚  β”œβ”€ Configure visibility
    β”‚  └─ Publish to channel
    β”œβ”€ Twitch
    β”‚  β”œβ”€ Upload as VOD
    β”‚  β”œβ”€ Set title and tags
    β”‚  β”œβ”€ Configure category
    β”‚  └─ Publish to channel
    └─ Rumble
       β”œβ”€ Upload video
       β”œβ”€ Set metadata
       β”œβ”€ Configure settings
       └─ Publish to channel

13. ANALYTICS TRACKING
    β”œβ”€ GET /api/platforms/:platformName/analytics/:userId
    β”œβ”€ Track view counts
    β”œβ”€ Monitor engagement metrics
    β”œβ”€ Compare performance across platforms
    └─ Store engagement data in distributions table

14. CONTENT MANAGEMENT
    β”œβ”€ GET /api/videos/user/:userId
    β”œβ”€ GET /api/clips/user/:userId
    β”œβ”€ GET /api/shorts/user/:userId
    β”œβ”€ DELETE /api/clips/:clipId
    β”œβ”€ DELETE /api/shorts/:shortId
    └─ Manage entire content library

βš™οΈ Environment Configuration

Required Environment Variables

# Server
PORT=3000
NODE_ENV=development

# Paths
DATABASE_PATH=./data/studiobot.db
TEMP_VIDEO_DIR=./temp/videos
OUTPUT_CLIPS_DIR=./output/clips
OUTPUT_SHORTS_DIR=./output/shorts
OUTPUT_THUMBNAILS_DIR=./output/thumbnails

# AI Service
AI_SERVICE_URL=https://api.example.com/analyze
AI_SERVICE_KEY=your_key

# YouTube
YOUTUBE_API_KEY=your_key
YOUTUBE_CLIENT_ID=your_id
YOUTUBE_CLIENT_SECRET=your_secret

# Twitch
TWITCH_CLIENT_ID=your_id
TWITCH_ACCESS_TOKEN=your_token

# Rumble
RUMBLE_API_KEY=your_key

# Security
JWT_SECRET=your_secret
SESSION_SECRET=your_secret

# Logging
LOG_LEVEL=debug
LOG_FILE=./logs/app.log

πŸ› οΈ Development

Available Scripts

# Development server with hot reload
npm run dev

# Build TypeScript to JavaScript
npm run build

# Run production build
npm start

# Lint code
npm run lint

# Run tests
npm test

# Watch mode for development
npm run watch

Code Structure Best Practices

  • Services: Contain all business logic
  • Routes: Define API endpoints and handle HTTP
  • Middleware: Handle cross-cutting concerns
  • Types: Centralized TypeScript definitions
  • Database: Handle all data persistence

Error Handling

All errors are caught and properly formatted:

{
  "status": "error",
  "message": "Human readable error message",
  "statusCode": 400
}

🚒 Deployment

Environment Setup for Production

  1. Set NODE_ENV=production
  2. Generate strong secrets for JWT_SECRET and SESSION_SECRET
  3. Configure database path for persistent storage
  4. Set up FFmpeg on production server
  5. Configure platform API credentials
  6. Set up CDN for video storage (optional)

Scaling Considerations

  • Use Redis for caching (future enhancement)
  • Implement job queue for video processing (BullMQ)
  • Use reverse proxy (Nginx) for load balancing
  • Setup database replication for reliability
  • Consider microservices for video processing

Monitoring

  • Application logs: ./logs/app.log
  • Error tracking: (Future: Sentry integration)
  • Performance monitoring: (Future: New Relic)
  • Uptime monitoring: (Future: Pingdom)

πŸ“ Future Enhancements

  1. Real-time WebSocket Updates: Live progress on video processing
  2. Advanced AI Analysis: ML models for better viral moment detection
  3. Scheduled Publishing: Schedule content distribution for optimal times
  4. Batch Operations: Process multiple videos simultaneously
  5. Custom Branding: Watermarks and intro/outro sequences
  6. Team Collaboration: Multiple users per organization
  7. Advanced Analytics: Detailed performance dashboards
  8. Content Library: Store and manage templates and presets
  9. API Rate Limiting: Prevent abuse
  10. OAuth2 Integration: Streamlined platform authentication

πŸ“ž Support & Contact

For issues, feature requests, or questions, please refer to the documentation or contact the development team.

πŸ“„ License

MIT License - See LICENSE file for details


Version: 1.0.0
Last Updated: February 8, 2026
Status: Production Ready

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors