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.
- Features
- Architecture
- Technology Stack
- Installation & Setup
- Project Structure
- API Documentation
- Database Schema
- Workflow
- Environment Configuration
- Development
- Deployment
-
Video Ingestion
- Accept videos via URL
- Automatic download and storage
- Support for multiple formats
- File size and duration validation
-
AI Video Analysis
- Automated viral moment detection
- Confidence scoring for each moment
- Keyframe identification
- Content tagging and categorization
- Time-coded segment analysis
-
Content Creation
- Automatic clip generation from viral moments
- Vertical video format conversion (Shorts/Reels)
- Smart thumbnail generation
- Multiple resolution support
- Batch processing capabilities
-
User Approval Workflow
- Review clips before publishing
- Approval/rejection with notes
- Batch approval operations
- Content curation dashboard
-
Multi-Platform Distribution
- YouTube integration (upload, schedule, publish)
- Twitch integration (stream, upload VOD)
- Rumble integration (content upload)
- Platform-specific formatting
- Simultaneous multi-platform publishing
-
Analytics & Management
- Real-time view counts
- Engagement metrics
- Distribution history
- Platform-specific analytics
- Content performance tracking
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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 β
ββββββββββ ββββββββββ ββββββββββ
- Runtime: Node.js (v18+)
- Framework: Express.js
- Language: TypeScript
- Database: SQLite 3
- API Clients: Axios
- Video Processing: FFmpeg (integrated via Node.js)
- Transpiler: TypeScript Compiler (tsc)
- Dev Server: ts-node
- Linting: ESLint
- Testing: Jest
- YouTube Data API v3
- Twitch API
- Rumble API
- Node.js v18 or higher
- npm or yarn
- FFmpeg installed on system
- Git
cd c:\Users\wflor\OneDrive\StudioBot.ai
git initnpm install# Copy environment template
cp .env.example .env
# Edit .env with your configurationnpm run buildThe database is automatically initialized on server startup.
npm run devnpm run build
npm startQuick 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 devStart 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.ps1Start both (cross-platform) from repo root:
npm run dev:allNotes:
dev:allusesconcurrently(added to rootdevDependencies).ui/desktop/scripts/run-electron.jsandrun-electron.ps1wait for the web URL before launching Electron.
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
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"
}
}
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..."
}
}
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 /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": [...]
}
}
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"
}
}
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"
}
}
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"
}
}
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"
}
}
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"
}
}
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"
}
}
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
);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)
);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)
);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)
);Stores user platform credentials, API keys, and tracks all content distributions across platforms with view counts and engagement data.
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
# 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 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- 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
All errors are caught and properly formatted:
{
"status": "error",
"message": "Human readable error message",
"statusCode": 400
}- Set
NODE_ENV=production - Generate strong secrets for JWT_SECRET and SESSION_SECRET
- Configure database path for persistent storage
- Set up FFmpeg on production server
- Configure platform API credentials
- Set up CDN for video storage (optional)
- 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
- Application logs:
./logs/app.log - Error tracking: (Future: Sentry integration)
- Performance monitoring: (Future: New Relic)
- Uptime monitoring: (Future: Pingdom)
- Real-time WebSocket Updates: Live progress on video processing
- Advanced AI Analysis: ML models for better viral moment detection
- Scheduled Publishing: Schedule content distribution for optimal times
- Batch Operations: Process multiple videos simultaneously
- Custom Branding: Watermarks and intro/outro sequences
- Team Collaboration: Multiple users per organization
- Advanced Analytics: Detailed performance dashboards
- Content Library: Store and manage templates and presets
- API Rate Limiting: Prevent abuse
- OAuth2 Integration: Streamlined platform authentication
For issues, feature requests, or questions, please refer to the documentation or contact the development team.
MIT License - See LICENSE file for details
Version: 1.0.0
Last Updated: February 8, 2026
Status: Production Ready