Turn your long videos into short viral clips β automatically, with full control, and optional NFT ownership.
ClipCash helps content creators (YouTubers, podcasters, gamers, coachesβ¦) save many hours of work by turning one long video into dozens or hundreds of short clips ready for TikTok, Instagram Reels, YouTube Shorts, and more.
You always stay in control: β Preview every clip β Choose which ones you like β Delete the bad ones β Then post only the good ones automatically
Bonus: you can also turn your best clips into NFTs on the Stellar network (very cheap & fast) so you truly own them and can earn royalties forever.
- Full preview & selection β most tools post random clips. ClipCash lets you see and pick only the best ones.
- Automatic posting to 7+ platforms (TikTok, Instagram, YouTube Shorts, Facebook Reels, Snapchat Spotlight, Pinterest, LinkedIn)
- Web2 + Web3 in one app β normal accounts + optional Stellar NFTs with royalties
- Simple & beautiful interface β dark mode, clean design, easy to use
- AI-powered clip detection β Claude analyzes video content to find the most engaging moments (15β60 seconds each)
- Fallback strategies β if AI fails, uses fixed-chunk splitting to ensure something is always generated
- Multi-source support β upload local video, YouTube, TikTok, or any public video URL
- Video metadata extraction β automatic duration, resolution, quality detection via FFmpeg
- Preview interface β watch each generated clip before posting
- Bulk actions β select/deselect/delete multiple clips at once
- Metadata editing β customize title, caption, hashtags per clip
- Viral scoring β AI assigns engagement scores to help you pick winners
- One-click posting β publish to TikTok, Instagram Reels, YouTube Shorts, Facebook Reels, Snapchat, Pinterest, LinkedIn
- Platform-specific formatting β auto-adjust duration, aspect ratio, captions
- Scheduled posting β queue clips to publish at optimal times
- Post tracking β monitor views, likes, comments per platform
- Optional NFT minting β turn clips into NFTs on Stellar's Soroban network
- Built-in royalties β earn a percentage on secondary sales (customizable)
- Very low fees β Stellar transactions cost ~$0.00001 (1 stroops)
- User-controlled wallets β all signing happens in user's browser with Freighter or Albedo
- Earnings dashboard β aggregate earnings from all platforms in one place
- Payout system β withdraw earnings in XLM (Stellar lumens) to your wallet
- Subscription plans β flexible tiers (Basic / Pro / Enterprise)
- Public leaderboard (optional) β showcase top creators
- Upload long video or paste YouTube/TikTok link
- AI creates 50β200 short clips (15β60 seconds each)
- Preview screen: watch short previews, select / deselect / bulk delete
- One-click post selected clips to multiple platforms
- Earnings dashboard (shows money from all platforms)
- Optional: mint selected clips as NFTs on Stellar (Soroban smart contracts)
- Subscription plans + small revenue share (we take 5β10% only if you want)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (Next.js + React) β
β - Video upload / YouTube import UI β
β - Clip preview & selection β
β - Multi-platform posting dashboard β
β - Wallet integration & NFT mint β
βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββ
β HTTP/WebSocket
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Backend API (NestJS + TypeScript) β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Controllers: β β
β β - Auth (login, signup, social OAuth) β β
β β - Videos (upload, list, detect viral moments) β β
β β - Clips (preview, select, post, mint as NFT) β β
β β - Wallets (connect Stellar) β β
β β - Earnings & Payouts (track, payout to users) β β
β β - Queue Dashboard (inspect/retry failed jobs) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Services: β β
β β - VideoService (AI detection via Claude, FFmpeg) β β
β β - ClipsService (CRUD, filter, generate) β β
β β - SocialService (Ayrshare integration) β β
β β - NftMintService (Soroban contract calls) β β
β β - PayoutService (Stellar XLM transfers) β β
β β - PrismaService (database abstraction) β β
β β - JWTService (authentication & tokens) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Job Queues (BullMQ + Redis): β β
β β - clip-generation (FFmpeg β Cloudinary) β β
β β - clip-posting (post to TikTok, Instagram, etc.) β β
β β - nft-mint (Soroban contract interaction) β β
β β - email-delivery (transactional emails) β β
β β - payout-retry (Stellar payments) β β
β β - anomaly-detection (fraud detection) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββΌβββββββββββββ¬βββββββββββββββ
β β β β
βΌ βΌ βΌ βΌ
ββββββββββ ββββββββββ ββββββββββββ βββββββββββββ
β Redis β β DB β β External β β Blockchain
β(BullMQ)β β(Postgres) βServices β β(Stellar)
β(Cache) β β β β β β
ββββββββββ ββββββββββ ββββββββββββ βββββββββββββ
β
ββββββββββββββββββββββΌβββββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββ βββββββββββ ββββββββββββ
βAyrshare β βCloudinary βPinata
β(Social β β(CDN for β(IPFS for
βPosting) β βclips/thumbnails) βmetadata)
βββββββββββ βββββββββββ ββββββββββββ
β
βββββββββ΄ββββββββ¬βββββββββββββ¬βββββββββββ¬ββββββββββ
β β β β β
βΌ βΌ βΌ βΌ βΌ
ββββββββββ ββββββββββββββ ββββββββ ββββββββ ββββββββββββ
βTikTok β βInstagram β βYouTubeβ βTwitterβ βFacebook
βReels β βReels β βShorts β β β βReels
ββββββββββ ββββββββββββββ ββββββββ ββββββββ ββββββββββββ
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | Next.js 15, React 19, TypeScript, Tailwind CSS | Modern, responsive UI with SSR |
| Backend | NestJS, TypeScript, Node.js 18+ | Type-safe, modular API server |
| Database | PostgreSQL 14+, Prisma ORM | ACID compliance, schema migrations |
| Caching | Redis 7+ | Session storage, rate limiting, queue backing |
| Component | Technology | Purpose |
|---|---|---|
| Job Queue | BullMQ | Queue manager with retries and scheduling |
| Backing Store | Redis | Persistent job storage and locking |
| Processors | TypeScript classes | Workers that execute queued jobs |
| Service | Purpose | Key Feature |
|---|---|---|
| Claude / Anthropic SDK | Analyze videos, detect viral moments | Vision analysis + JSON parsing |
| Ayrshare | Post clips to multiple platforms | Single API for 10+ social networks |
| Cloudinary | Video hosting, CDN, thumbnails | Automatic format conversion |
| Pinata | IPFS storage for NFT metadata | Decentralized metadata hosting |
| Stellar Soroban RPC | Blockchain smart contract calls | NFT minting, XLM transfers |
| Freighter / Albedo | Web3 wallet integration | User-controlled key signing |
| Layer | Technology | Purpose |
|---|---|---|
| Blockchain | Stellar Public Network | Low-fee transactions |
| Contract Lang | Soroban (Rust) | Smart contracts for NFT minting |
| Token Standard | Stellar Native XLM | User payouts in XLM |
| NFT Implementation | Soroban contract | Customizable royalties & metadata |
- Node.js 18+
- npm 9+
- Git
- Docker and Docker Compose (optional, recommended for PostgreSQL and Redis)
git clone https://github.com/devpragya8081/clips-backend.git
cd clips-backendAdd the upstream remote if you are contributing:
git remote add upstream https://github.com/ANYTECHS/clips-backend.gitStart PostgreSQL and Redis:
docker compose up -dCopy environment defaults and set DATABASE_URL to match Docker:
cp .env.example .envUse this DATABASE_URL when running the compose file above:
DATABASE_URL="postgresql://postgres:password@localhost:5432/clipscash?schema=public"
REDIS_HOST=localhost
REDIS_PORT=6379Install dependencies, run migrations, and start the API:
npm install
npx prisma migrate dev
npm run start:devAPI: http://localhost:3000
Swagger (development): http://localhost:3000/api/docs
- Install and run PostgreSQL 14+ and create a database (e.g.
clipscash). - Install and run Redis 7+ on
localhost:6379. - Copy
.env.exampleto.envand setDATABASE_URL,REDIS_HOST, andJWT_SECRET. - Run
npm install,npx prisma migrate dev, andnpm run start:dev.
| Command | Description |
|---|---|
npm run start:dev |
Start API with hot reload |
npm test |
Unit tests |
npm run test:e2e |
End-to-end tests |
npm run lint |
ESLint |
npx prisma studio |
Browse database |
| Problem | What to check |
|---|---|
Can't reach database server |
PostgreSQL is running; DATABASE_URL host/port/user/password match your instance |
| Redis / BullMQ connection errors | Redis is running; REDIS_HOST and REDIS_PORT in .env |
SOROBAN_NFT_CONTRACT_ID errors on NFT routes |
Set a deployed testnet contract ID or avoid NFT endpoints until configured |
| Prisma migration failures | Database exists and credentials are correct; try npx prisma migrate reset only on a local dev DB |
| Port 3000 already in use | Stop the other process or set PORT in .env |
| JWT / 401 on protected routes | Obtain a token via auth endpoints; send Authorization: Bearer <token> |
Stellar-specific integration (wallets, mint, royalties) is documented in docs/stellar-integration.md.
ClipCash provides comprehensive API documentation via Swagger UI.
When running in development mode (NODE_ENV !== 'production'):
- Swagger UI: http://localhost:3000/api/docs
- OpenAPI JSON: http://localhost:3000/api/docs-json (or
openapi.jsonfile) - Rate Limits: See docs/rate-limits.md for detailed rate limiting documentation
Most endpoints require a Bearer token. To authenticate in Swagger UI:
- Click the Authorize button (π) at the top of the page
- Enter your JWT token:
Bearer your_token_here - Click Authorize and close the dialog
- All subsequent requests will include the token automatically
To export the OpenAPI JSON spec for external use:
# During development (automatically exported on start)
npm run start:dev
# Or manually export
npm run openapi:exportThis creates openapi.json in the project root, which can be used with:
- Postman (Import β File)
- Insomnia
- Code generators (OpenAPI Generator)
- Frontend client SDKs
# Disable Swagger UI in production (default: true in prod)
ENABLE_SWAGGER_UI=false
# Or enable it even in production (not recommended for public APIs)
ENABLE_SWAGGER_UI=trueCopy .env.example to .env and fill in the values:
cp .env.example .env| Variable | Required | Description |
|---|---|---|
DATABASE_URL |
β | PostgreSQL connection string |
ENCRYPTION_SECRET |
β | Min 32-char secret for encrypting sensitive data |
JWT_SECRET |
β | Secret for signing JWT access tokens |
REDIS_HOST / REDIS_PORT |
β | Redis connection (used by BullMQ and rate limiting) |
STELLAR_NETWORK |
β | testnet (dev) or public (production) |
SOROBAN_NFT_CONTRACT_ID |
β | Deployed Soroban NFT contract ID |
CLOUDINARY_CLOUD_NAME |
β | Cloudinary cloud name for video/thumbnail CDN |
CLOUDINARY_API_KEY |
β | Cloudinary API key |
CLOUDINARY_API_SECRET |
β | Cloudinary API secret |
AYRSHARE_API_KEY |
β | Ayrshare key for multi-platform social posting |
PINATA_JWT |
β | Pinata JWT for uploading NFT metadata to IPFS |
WEBHOOK_SECRET |
β | HMAC-SHA256 secret for Stellar payment webhooks |
METRICS_TOKEN |
β | Bearer token protecting the /metrics endpoint |
BULLMQ_CLIP_GENERATION_CONCURRENCY |
β | Parallel clip jobs (default: 2) |
BULLMQ_EMAIL_DELIVERY_CONCURRENCY |
β | Parallel email jobs (default: 5) |
MIN_PAYOUT_USD / MAX_PAYOUT_USD |
β | Payout limits in USD (default: 5 / 10000) |
LEADERBOARD_ENABLED |
β | Enable public earnings leaderboard (default: false) |
For detailed BullMQ concurrency tuning, see BULLMQ_WORKER_SCALING.md.
The backend supports switching between Stellar testnet and mainnet (public network) via an environment variable.
| Value | Network | RPC URL | Use when |
|---|---|---|---|
testnet |
Stellar Testnet (SDF) | https://soroban-testnet.stellar.org |
Development / staging |
public |
Stellar Mainnet | https://soroban-rpc.stellar.org |
Production |
Default: testnet
Set in your .env:
# Development
STELLAR_NETWORK=testnet
# Production
STELLAR_NETWORK=publicThe StellarService reads this variable at startup and exposes the correct rpcUrl and networkPassphrase to all services that perform Stellar operations (minting, payouts).
Minimum payout amount in USD equivalent. Requests below this threshold are rejected with a 400 error to prevent fee-wasting micro-transactions.
MIN_STELLAR_PAYOUT=5 # default: 5 USDPrometheus-compatible metrics are exposed at /metrics and protected with METRICS_TOKEN.
- Send header:
x-metrics-token: <METRICS_TOKEN> - This route is not guarded by JWT, but returns
403when token is missing/invalid.
Tracked metrics:
clipcash_clips_generated_total{status="success|failure"}clipcash_nft_mints_total{status="success|failure"}clipcash_job_queue_depth{queue="clip-generation"}clipcash_http_request_duration_seconds{method,route,status_code}clipcash_stellar_rpc_errors_totalclipcash_cloudinary_upload_errors_total
Wallet addresses are partially masked in all responses for user privacy. Only the last 6 characters of the address are shown (e.g. ******KPRQ6A).
| Method | Endpoint | Description |
|---|---|---|
| GET | /wallets |
List current user's wallets |
| GET | /wallets/:id |
Get a single wallet by ID |
Mint a clip as an NFT on Stellar. Clips that have already been auto-posted (postStatus = "posted") cannot be minted and will return 400.
| Method | Endpoint | Description |
|---|---|---|
| POST | /clips/:id/mint |
Mint clip as NFT |
Initiate a Stellar payout. Returns 400 if the amount is below MIN_STELLAR_PAYOUT.
| Method | Endpoint | Body | Description |
|---|---|---|---|
| POST | /payouts |
{ amount, walletId? } |
Initiate Stellar payout |
clips-backend/
βββ src/
β βββ auth/ # JWT, Google OAuth, magic links
β βββ clips/ # Clip generation & management
β βββ videos/ # Video upload & processing
β βββ wallet/ # Wallet listing with masked addresses
β βββ mint/ # NFT minting (Stellar Soroban)
β βββ payout/ # Stellar payouts with minimum threshold
β βββ stellar/ # Stellar SDK configuration (network switching)
β βββ jobs/ # BullMQ job management
β βββ earnings/ # Earnings dashboard
β βββ prisma/ # Database connection
βββ prisma/
β βββ schema.prisma
βββ .env.example
Run the subscription integration flow and existing e2e suites with:
npm run test:e2eThe subscription integration scenarios live in test/subscription-flow.e2e-spec.ts and cover:
- intent creation with memo and destination
- activation on matching memo+amount
- rejection on wrong amount
- idempotency on duplicate transaction id
- rejection of expired intents (>15 minutes)