DEV Community

Cover image for I Built a Random Video Chat App with a Custom Video Streaming Engine Written in Rust
Emylton Leunufna
Emylton Leunufna

Posted on

I Built a Random Video Chat App with a Custom Video Streaming Engine Written in Rust

THE PROBLEM

The world is more digitally connected than ever — but more humanly disconnected.

We have thousands of online friends. But how many do we actually talk to... face to face?

I wanted to build something different. Not another swipe app. Not another DM that never gets a reply. A real, instant, face-to-face connection with a stranger — anywhere in the world, in any language.

That's how PairLive was born.

WHAT IS PAIRLIVE?

PairLive is a random 1-on-1 video chat app. Tap one button, get instantly connected with someone from the other side of the planet. No swiping. No matching algorithms. Just raw, real human connection.

But here's what makes it different from Omegle clones:

🚀 Custom video streaming engine — not WebRTC
🌍 Real-time translation in 10 languages — self-hosted
🎁 Virtual gift system with custom-designed animated icons
🏆 Pioneer Badge for the first 100 beta testers
🔒 Cryptographic identity per user — privacy by design

THE TECH STACK

Here's everything under the hood.

Mobile App

  • React Native (New Architecture enabled)
  • Hermes Engine for JS performance
  • react-native-reanimated for 60fps animations
  • Redux Toolkit + redux-persist (MMKV) for state
  • i18next for 10-language internationalization
  • Camera2 API (native) for camera access
  • Google ML Kit for offline face detection and beauty filters

Backend

  • Fastify + PostgreSQL — main API
  • Express + Socket.IO — real-time gift server and chat
  • LibreTranslate — self-hosted translation (10 language models always loaded)
  • Redis — session caching and rate limiting
  • PM2 cluster mode — zero-downtime deploys

Video Engine: ELARA Protocol

  • Written in Rust
  • Peer-to-peer video streaming — no relay servers
  • Compiled as a native library (.so) running directly on ARM hardware
  • Each user gets a unique cryptographic identity
  • Not a WebRTC wrapper — built from scratch

Infrastructure

  • Single hardened VPS
  • SSL everywhere
  • Fail2ban + UFW firewall
  • Custom monitoring dashboard (12 pages, real-time)

WHY NOT JUST USE WEBRTC?

Every video chat app uses WebRTC. It works. It's battle-tested.

But I wanted more control.

WebRTC comes with a massive dependency tree, SRTP overhead, and ICE negotiation complexity that's overkill for 1-on-1 random pairing. I wanted:

  1. Direct peer-to-peer — video bytes flow between devices, not through a media server
  2. Minimal latency — native Rust code running on ARM, not a JS bridge
  3. Privacy first — cryptographic identity baked into the protocol, not bolted on

So I wrote ELARA Protocol in Rust. It handles:

  • Peer discovery and NAT traversal
  • Encrypted video/audio streaming
  • Connection quality monitoring
  • Graceful fallback when P2P fails

Is it production-ready at WebRTC's scale? No. But for a focused 1-on-1 use case, it's faster and leaner.

REAL-TIME TRANSLATION: THE MAGIC FEATURE

This is the feature that makes people stay.

Imagine: you're video chatting with someone from Tokyo. They speak Japanese. You speak English. But the chat messages are automatically translated — in both directions, in real-time.

Here's how it works:

User A types: "こんにちは、元気ですか?"
Server detects: Japanese
Translates to User B's language: "Hello, how are you?"
User B sees translated message instantly

User B types: "I'm great! Where are you from?"
Server detects: English
Translates to User A's language: "元気です!どこから来ましたか?"

10 supported languages:
Indonesian, English, Japanese, Korean, Chinese, Thai, Vietnamese, Arabic, French, Spanish.

We self-host LibreTranslate with all 10 models loaded in memory. No data goes to Google or Microsoft. Your conversations stay on our server and nowhere else.

Don't want to type? PairLive also has speech-to-text — speak, and your words get transcribed, translated, and sent.

THE GIFT SYSTEM

During a live video session, you can send virtual gifts to your partner. Each gift has a custom-designed animated icon — not generic emoji.

🌊 Ripple — a greeting wave (Common, 5 coins)
🔥 Flame — a burning flame (Common, 10 coins)
🪐 Orbit — an orbiting star (Rare, 25 coins)
💎 Nexus — an energy prism (Epic, 50 coins)
🌌 Aurora — an aurora crystal (Epic, 100 coins)
💫 Zenith — a supernova explosion (Legendary, 200 coins)

Each gift triggers a full-screen particle animation — colored bursts, ring effects, and the gift icon dramatically appearing on both screens.

Free coins are earned through:

  • Daily login (streak bonuses up to 50/day)
  • Completing video sessions
  • Rating your partner
  • Watching reward videos

PIONEER BADGE: FIRST 100 USERS

The first 100 users get a Pioneer Badge — a futuristic animated badge on their profile with:

  • Rotating neon gradient ring around their profile photo
  • Scanning beam effect
  • Holographic shimmer
  • Breathing glow animation
  • Their unique pioneer number (#1, #2, ... #100)

It's automatically assigned on first profile visit. No action needed. The server tracks how many pioneers exist and stops at 100.

Pioneer users also get 500 bonus coins — a one-time reward for being early.

ARCHITECTURE DECISIONS I'D MAKE DIFFERENTLY

  1. Start with WebRTC, optimize later
    Building a custom video engine was an incredible learning experience. But if I were building for speed-to-market, I'd start with WebRTC and replace it later. ELARA took months.

  2. Use a managed database earlier
    Running PostgreSQL on the same VPS as everything else works for beta. But I should have separated it from day one.

  3. TypeScript everywhere
    The gift server started as plain JavaScript. Converting it to TypeScript mid-project was painful. Start with TS.

CURRENT STATUS

PairLive is in Closed Beta on Google Play.

🔗 Website: pairlive.xyz
📱 Google Play: Search "PairLive" (beta access required)
📧 Contact: support@pairlive.xyz

We're actively looking for beta testers — especially developers who can give technical feedback.

If you join during beta, you'll automatically get the Pioneer Badge (if you're within the first 100) and 500 bonus coins.

WHAT'S NEXT

🎯 Open Beta — expanding to more testers
🍎 iOS version — React Native makes this straightforward
🗣️ More languages — Arabic and Hindi translation models
📹 Group video — 2-4 person rooms
🤖 AI moderation — automated content safety

FINAL THOUGHTS

Building PairLive taught me that the best way to learn a technology is to build something real with it. Writing a video engine in Rust, self-hosting translation models, designing animated gift systems — none of this was in a tutorial.

If you're a developer thinking about building something ambitious: just start. The first version will be ugly. The architecture will be wrong. But you'll learn more in 3 months of building than in 3 years of tutorials.

One Random. One Live. One Connection.

If you found this interesting, follow me for more updates on PairLive's development journey. Drop a comment if you have questions about the tech stack — happy to go deeper on any topic.

Join the PairLive Beta: pairlive.xyz/beta

Top comments (0)