Cheat Sheet

Quick reference for the entire ClipDesk platform — all endpoints, formulas, and config at a glance.

API Endpoints

Base path: /api/clipdesk

MethodPathAuthPurpose
POST/auth/request-otpPublicRequest OTP via email
POST/auth/verify-otpPublicVerify OTP, get JWT
POST/clients/registerPublicRegister client/business
POST/clients/:id/campaignsJWT ClientCreate campaign
GET/clients/:id/dashboardJWT ClientClient dashboard & stats
POST/clippers/registerPublicRegister clipper
GET/clippers/marketplaceJWTBrowse active campaigns
POST/clippers/:id/campaigns/:cid/joinJWT ClipperJoin campaign, get affiliate link
POST/clippers/:id/clips/submitJWT ClipperSubmit clip for phi scoring
GET/clippers/:id/earningsJWT ClipperEarnings dashboard
GET/clippers/:id/intelligenceJWT ClipperWorld Model intelligence
GET/creators/:id/intelligenceJWTCreator analytics & DNA
GET/track/:affiliateCodePublicAffiliate link redirect
GET/admin/revenueAdmin KeyPlatform revenue analytics
GET/admin/campaignsAdmin KeyAll campaigns overview
POST/admin/conversions/processAdmin KeyProcess conversion manually
POST/admin/outreach/pitchAdmin KeyGenerate sales pitch
POST/whop/webhookPublicWhop payment webhook
POST/whop/checkoutJWTCreate Whop checkout link
POST/whop/checkout-configJWTEmbedded checkout config
GET/healthPublicHealth check + config verify

Phi Scoring Formula

Viral Score = (0.40 × Engagement Velocity) + (0.25 × View-to-Like Ratio) + (0.20 × Retention Rate) + (0.10 × Hashtag Relevance) + (0.05 × Soundtrack/Filter Impact) Threshold: φ = 1.618033988875 (Golden Ratio) Qualified: score ≥ φ Gap: phi_gap = φ - score (for non-qualified clips)
MetricWeightWhat It Measures
Engagement Velocity40%Speed of engagement growth after posting
View-to-Like Ratio25%Percentage of viewers who liked
Retention Rate20%How much of the video viewers watch
Hashtag Relevance10%Campaign & trend alignment
Soundtrack/Filter Impact5%Trending sounds & effects usage

Commission Splits

Clipper 20%
Platform 10%
Client 70%
Product PriceClipper (20%)ViralVid (10%)Client (70%)
R149R29.80R14.90R104.30
R299R59.80R29.90R209.30
R2,500R500.00R250.00R1,750.00

Payout threshold: R50 ZAR minimum pending before payout eligible.

OTP Authentication Flow

1. Client/Clipper registers (POST /clients/register or /clippers/register) 2. Request OTP (POST /auth/request-otp) Body: { email, userType: "client" | "clipper" } 3. System generates 6-digit OTP → hashes with SHA-256 → stores hash + expiry (10 min) 4. OTP emailed via Resend (from: noreply@viralvid.io) 5. Verify OTP (POST /auth/verify-otp) Body: { email, otp, userType } 6. System hashes input → compares → checks expiry 7. On success: OTP cleared, JWT issued (7-day expiry) Response: { token, user: { id, role, email } } Rate limits: 5 OTP requests/hour per email | 100 verifications/15 min global

Role Permissions Matrix

ActionClientClipperAdmin
RegisterN/A (key-based)
OTP LoginN/A
Create Campaigns
View Client Dashboard
Browse Marketplace
Join Campaigns
Submit Clips
View Earnings
View Intelligence
Process Conversions
View Revenue
View All Campaigns
Generate Pitches

Environment Variables

VariableRequiredDefaultNotes
DATABASE_URLYesPostgreSQL connection string
JWT_SECRETYesMin 32 characters
JWT_EXPIRYNo7dToken expiration
PORTNo3001Server port
NODE_ENVNodevelopmentdevelopment | production
PHINo1.618033988875Hardcoded, throws if changed
CLIPPER_COMMISSION_PERCENTNo20Must sum to 100 with others
VIRALVID_REV_SHARE_PERCENTNo10Must sum to 100 with others
CLIENT_KEEP_PERCENTNo70Must sum to 100 with others
PAYOUT_THRESHOLD_ZARNo50Min ZAR for payout
RESEND_API_KEYYesEmail service API key
EMAIL_FROMNonoreply@viralvid.ioOTP sender address
OTP_EXPIRY_MINUTESNo10OTP validity window
ADMIN_API_KEYYesAdmin authentication
ALLOWED_ORIGINSNohttp://localhost:3000CORS origins (comma-sep)
WHOP_API_KEYNo""Whop MoR API key
WHOP_BUSINESS_IDNo""Whop business ID

Key URLs & Health Check

URLPurpose
http://localhost:3001/Marketing landing page
http://localhost:3001/training/Training hub
http://localhost:3001/cheatsheet.htmlThis cheat sheet
http://localhost:3001/api/clipdesk/healthAPI health check
http://localhost:3001/robots.txtRobots.txt
http://localhost:3001/llms.txtAI discoverability metadata
http://localhost:3001/schema.jsonSchema.org markup
http://localhost:3001/legal/terms.htmlTerms of Service
http://localhost:3001/legal/privacy.htmlPrivacy Policy
http://localhost:3001/legal/rev-share.htmlRev Share Agreement

Health Check Response

GET /api/clipdesk/health { "status": "ok", "database": "connected", "phi": 1.618033988875, "phiVerified": true, "splits": { "clipper": 20, "platform": 10, "client": 70 }, "uptime": 12345, "timestamp": "2026-02-26T..." }