- Node.js 18+ (Download)
- npm or yarn package manager
- FFmpeg (Installation Guide)
- Git (optional, for version control)
-
Clone or extract the project
cd StudioBot.ai -
Install dependencies
npm install
-
Configure environment
cp .env.example .env # Edit .env with your configuration -
Build the project
npm run build
-
Start the server
npm start
-
Access the API
curl http://localhost:3000/health # Should return: {"status":"ok","timestamp":"..."}
| Requirement | Minimum | Recommended |
|---|---|---|
| Node.js | 18.0 | 20.0+ |
| npm | 9.0 | 10.0+ |
| RAM | 2GB | 8GB+ |
| Disk | 1GB | 10GB+ |
| FFmpeg | Required | Latest |
# Using Homebrew
brew install ffmpeg
brew install node
# Verify installations
ffmpeg -version
node --version
npm --version-
Download & Install Node.js
- Visit https://nodejs.org/
- Download LTS version
- Run installer and follow prompts
-
Download & Install FFmpeg
- Option A: Using Chocolatey
choco install ffmpeg
- Option B: Manual download
- Download from https://ffmpeg.org/download.html
- Extract to
C:\Program Files\ffmpeg - Add
C:\Program Files\ffmpeg\binto PATH
- Option A: Using Chocolatey
-
Verify installation
node --version npm --version ffmpeg -version
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install nodejs npm ffmpeg
# Fedora
sudo dnf install nodejs npm ffmpeg
# Arch
sudo pacman -S nodejs npm ffmpeg
# Verify
node --version
npm --version
ffmpeg -versionCreate a .env file in the project root:
# Basic Configuration
PORT=3000
NODE_ENV=development
LOG_LEVEL=debug
# Database (SQLite is default, PostgreSQL for production)
DB_TYPE=sqlite
DB_PATH=./data/studiobot.db
# For PostgreSQL:
# DB_TYPE=postgres
# DB_HOST=localhost
# DB_PORT=5432
# DB_NAME=studiobot
# DB_USER=studiobot
# DB_PASSWORD=strong_password
# YouTube
YOUTUBE_CLIENT_ID=your_client_id
YOUTUBE_CLIENT_SECRET=your_client_secret
YOUTUBE_API_KEY=your_api_key
YOUTUBE_REDIRECT_URI=http://localhost:3000/api/platforms/callback/youtube
# Twitch
TWITCH_CLIENT_ID=your_client_id
TWITCH_CLIENT_SECRET=your_client_secret
TWITCH_REDIRECT_URI=http://localhost:3000/api/platforms/callback/twitch
# Rumble
RUMBLE_API_KEY=your_api_key
RUMBLE_CHANNEL_ID=your_channel_id
# AI Services (Optional)
OPENAI_API_KEY=your_api_key
AWS_ACCESS_KEY_ID=your_key_id
AWS_SECRET_ACCESS_KEY=your_secret_key
ANTHROPIC_API_KEY=your_api_key
# JWT
JWT_SECRET=your_secret_key_min_32_characters_long
JWT_EXPIRE=7d
# Storage
TEMP_VIDEO_DIR=./temp/videos
OUTPUT_DIR=./output
FFMPEG_PATH=/usr/bin/ffmpeg # or C:\Program Files\ffmpeg\bin\ffmpeg.exe on Windows# With hot-reload
npm run dev
# Watch TypeScript changes
npm run watch# Build
npm run build
# Start
npm start
# Or use PM2 for process management
npm install -g pm2
pm2 start dist/index.js --name "studiobot"# Build Docker image
docker build -t studiobot:latest .
# Run container
docker run -p 3000:3000 \
-e YOUTUBE_CLIENT_ID=your_id \
-e YOUTUBE_CLIENT_SECRET=your_secret \
studiobot:latest
# Using Docker Compose (with PostgreSQL, Redis, Nginx)
docker-compose up -dcurl http://localhost:3000/healthExpected response:
{
"status": "ok",
"timestamp": "2024-02-08T12:34:56.789Z"
}curl -X POST http://localhost:3000/api/auth/register \
-H "Content-Type: application/json" \
-d '{
"username": "testuser",
"email": "test@example.com",
"password": "Password123!"
}'curl -X POST http://localhost:3000/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "test@example.com",
"password": "Password123!"
}'Save the token from the response.
TOKEN="your_token_from_login"
curl -X POST http://localhost:3000/api/videos/upload \
-H "Authorization: Bearer $TOKEN" \
-F "title=My First Video" \
-F "sourceUrl=https://example.com/video.mp4" \
-F "file=@video.mp4"TOKEN="your_token_from_login"
curl http://localhost:3000/api/videos \
-H "Authorization: Bearer $TOKEN"# Run Node.js API tests
node test-api.js
# Run Jest unit tests (if configured)
npm test
# Run with coverage
npm test -- --coverage# Build CLI
npm run build
# Install globally (optional)
npm link
# Or use directly with npx
npx ts-node cli/studiobot-cli.ts help# Register new user
studiobot-cli auth:register
# Login
studiobot-cli auth:login
# Upload video from URL
studiobot-cli video:upload
# List your videos
studiobot-cli video:list
# Create clip from video
studiobot-cli clip:create
# Check API status
studiobot-cli status
# Help
studiobot-cli helpnpm install -g create-react-app# Create React app
npx create-react-app dashboard
# Or use Vite for faster development
npm create vite@latest dashboard -- --template react-ts
# Install dependencies
cd dashboard
npm install
# Add SDK package
npm install ../sdk/studiobot-sdk.tsdashboard/
βββ src/
β βββ components/
β β βββ Dashboard.tsx
β β βββ VideoUpload.tsx
β β βββ ClipEditor.tsx
β β βββ PlatformConnect.tsx
β β βββ Analytics.tsx
β βββ hooks/
β β βββ useAuth.ts
β β βββ useVideos.ts
β β βββ useClips.ts
β βββ services/
β β βββ api.ts
β βββ App.tsx
β βββ index.tsx
βββ public/
βββ package.json
cd dashboard
npm start
# Access at http://localhost:3000 (make sure API runs on :3001 or different port)- Create Google Cloud project
- Enable YouTube Data API
- Create OAuth 2.0 credentials
- Add to
.env:YOUTUBE_CLIENT_ID=your_id YOUTUBE_CLIENT_SECRET=your_secret YOUTUBE_API_KEY=your_api_key
- Register at Twitch Developer
- Create application
- Get Client ID and Secret
- Add to
.env:TWITCH_CLIENT_ID=your_id TWITCH_CLIENT_SECRET=your_secret
- Create Rumble Creator account
- Generate API key
- Get Channel ID
- Add to
.env:RUMBLE_API_KEY=your_key RUMBLE_CHANNEL_ID=your_id
TOKEN="your_token"
# Create a clip first
curl -X POST http://localhost:3000/api/clips \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"videoId": "video-123",
"startTime": 10,
"endTime": 25,
"title": "Awesome Moment"
}'
# Publish to YouTube
curl -X POST http://localhost:3000/api/distributions/publish \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"contentId": "clip-123",
"contentType": "clip",
"platformName": "youtube"
}'# Automatically created on first run at ./data/studiobot.db
# Check database:
sqlite3 data/studiobot.db ".tables"# Using Docker
docker run -d \
--name studiobot-db \
-e POSTGRES_DB=studiobot \
-e POSTGRES_USER=studiobot \
-e POSTGRES_PASSWORD=strongpassword \
-p 5432:5432 \
postgres:15
# Update .env
DB_TYPE=postgres
DB_HOST=localhost
DB_PORT=5432
DB_NAME=studiobot
DB_USER=studiobot
DB_PASSWORD=strongpassword
# Run migrations
npm run migrate:updocker build -t studiobot:latest .
docker run -p 3000:3000 studiobot:latestdocker-compose up -d
# Check status
docker-compose ps
# View logs
docker-compose logs -f api
# Stop
docker-compose downServices included:
- API: Node.js Express server
- PostgreSQL: Main database
- Redis: Caching & job queue
- Nginx: Reverse proxy & load balancer
Configure logging in .env:
LOG_LEVEL=debug # trace, debug, info, warn, error
LOG_FORMAT=json # json or textAccess logs:
tail -f logs/app.log# Get overall analytics
curl http://localhost:3000/api/distributions/analytics
# Get platform-specific stats
curl http://localhost:3000/api/distributions/analytics \
-H "Authorization: Bearer $TOKEN"# Using PM2
pm2 plus login
pm2 link <secret_key> <public_key>
pm2 start dist/index.jsIssue: ENOENT: no such file or directory
# Solution: Create required directories
mkdir -p data temp/videos output logsIssue: Error: EACCES: permission denied
# Solution: Fix permissions
chmod -R 755 data temp output logsIssue: Error: listen EADDRINUSE :::3000
# Solution: Change port or kill existing process
lsof -ti:3000 | xargs kill -9 # macOS/Linux
netstat -ano | findstr :3000 # WindowsIssue: FFmpeg not found
# Solution: Set correct path
# macOS/Linux
which ffmpeg
# Windows
where ffmpeg
# Update .env with full path
FFMPEG_PATH=/usr/local/bin/ffmpeg# View database schema
sqlite3 data/studiobot.db ".schema"
# Clear database
rm data/studiobot.db
# Reset all logs
rm logs/*
# Check disk usage
du -sh data/ temp/ output/
# Monitor processes
top # macOS/Linux
tasklist # Windows- Set
NODE_ENV=production - Use PostgreSQL instead of SQLite
- Set strong
JWT_SECRET(32+ characters) - Configure all platform API keys
- Set up SSL/TLS certificates
- Enable CORS for your domain
- Setup database backups
- Configure monitoring & alerts
- Setup error tracking (Sentry)
- Enable rate limiting
- Setup CI/CD pipeline
- Test disaster recovery
- Document runbooks
- Documentation: See README.md
- API Reference: See API.md
- Architecture: See ARCHITECTURE.md
- Platform Integration: See PLATFORM_INTEGRATION.md
- GitHub Issues: Report bugs or request features
- Discord Community: Join our community for support
- β Complete setup & test API
- β Configure platform integrations
- β Build React dashboard
- β Create sample clips & publish
- β Monitor analytics
- β Deploy to production
- β Scale infrastructure
Happy clipping! π¬