A cross-platform mobile video calling app built entirely on open-source technology — an alternative to Twilio, Agora, or LiveKit Cloud for teams who want to own their stack. The full pipeline (mobile client, signaling, media SFU, auth) runs on infrastructure you control, with no SaaS dependency and zero per-minute fees.
The demo above is a coded mockup rendered from the actual app styles in
app/src/screens/— useful for previewing the UI without installing. Real device screenshots/recordings welcome via PR.
Looking for a working reference of how React Native, LiveKit, and Node.js fit together for video calling? This repo is a real, end-to-end implementation you can clone and run on a single Mac in 10 minutes.
| Layer | Technology | Role |
|---|---|---|
| Mobile app | React Native 0.85 (bare, no Expo) | iOS + Android shared codebase, native modules for WebRTC |
| WebRTC client | @livekit/react-native + react-native-webrtc | Manages peer connection, captures camera/mic, renders remote video |
| Media server | LiveKit (Go, Apache 2.0) — runs in Docker | SFU (Selective Forwarding Unit) routes media between participants without transcoding → low CPU, scales well |
| Signaling | WebSocket + LiveKit signaling protocol (Protocol Buffers) | SDP/ICE negotiation, room and participant events |
| Media transport | WebRTC over UDP (port 7882), TCP fallback (7881) | RTP for audio/video, end-to-end DTLS-SRTP encryption |
| Auth backend | Node.js + Express + livekit-server-sdk | Issues HS256 JWT tokens with room grants for clients to connect to LiveKit |
| Container runtime | Docker (tested with OrbStack) | Isolates the LiveKit server, exposes ports to the LAN |
| Build infra | Xcode 26 (iOS, CocoaPods + Swift), Gradle 9 (Android, Kotlin + CMake) | Compile native code, package APK/IPA |
┌──────────┐ ┌──────────────┐
│ iPhone │ ──── ws/UDP ───► │ │
└──────────┘ │ LiveKit │ media SFU
│ (Docker) │
┌──────────┐ │ │
│ Android │ ──── ws/UDP ───► └──────┬───────┘
└──────────┘ │
│ │
│ ── HTTP POST /token ──► ┌───────┴───────┐
│ │ Backend │ issues JWT,
└───────────────────────► │ (Node.js) │ hardcoded
└───────────────┘ user list
- App ↔ Backend: HTTP — login (mock) and request a LiveKit JWT token
- App ↔ LiveKit: WebSocket signaling + UDP media — direct, never goes through the backend
- Backend never sees media — it only signs short-lived JWTs
- 3 hardcoded users (Alice / Bob / Charlie) — no DB, no real auth (intentional for a quickstart)
- Ad-hoc rooms by name — anyone with the same room name joins the same call
- N-participant video call (tested with 2-3 devices simultaneously)
- Mic mute, camera on/off, camera flip (front/back)
- Self-view mirror like a real selfie camera (FaceTime-style); remote view is unmirrored
- macOS with Xcode and/or Android Studio
- Node 22+, npm
- Docker — Docker Desktop, Colima, or OrbStack (tested with OrbStack)
- A real iPhone / Android device or an Android emulator with webcam (iOS simulators have no camera)
git clone https://github.com/linhh-phv/call-me.git
cd call-meFind the IP your phone can reach over Wi-Fi:
ipconfig getifaddr en0 # e.g. 192.168.1.42Update both:
- Root:
cp .env.example .env, then setLIVEKIT_NODE_IP=192.168.1.42(this is what LiveKit advertises in WebRTC ICE candidates) - App: open app/src/config.ts and set
HOST_IP = '192.168.1.42'
docker compose up -d
curl http://localhost:7880 # should return "OK"LiveKit runs in --dev mode with built-in API key devkey / secret secret (already wired in backend/.env.example).
cd backend
npm install
cp .env.example .env # pre-filled for local LiveKit
npm run dev # http://localhost:3000Endpoints:
GET /users— hardcoded user listPOST /token{ userId, room }— returns a LiveKit JWT for the client
cd app
npm install
cd ios && bundle install && bundle exec pod install && cd ..
npm startThen in another terminal:
# iOS simulator (NO real camera — only good for testing signaling)
npx react-native run-ios
# Real iOS device (requires free Apple ID + USB cable)
npx react-native run-ios --device "Your iPhone"
# Android emulator
npx react-native run-androidFirst time on a real iPhone: open Xcode → click the
CallMeAppproject → Signing & Capabilities → pick a Team (Add Apple ID if needed) → change the Bundle Identifier to something unique likecom.yourname.callmeapp. After installing, go to Settings → General → VPN & Device Management on the iPhone and trust the developer certificate.
Open the app on two devices → pick two different users → enter the same room name → Join.
LiveKit is Apache 2.0 — fully self-hostable with no commercial fees and no user limits. Realistic path to prod:
| Stage | Infrastructure | Estimated cost |
|---|---|---|
| Dev / local | Docker on your machine (this repo) | $0 |
| Beta (<100 concurrent users) | 1 Hetzner/DO VPS + coturn co-located + Caddy for TLS | $5–20 / month |
| Scale (cluster) | Multi-node LiveKit + Redis + dedicated coturn | $50–200 / month |
| No-ops | LiveKit Cloud (free 50GB/mo, Build tier $50/mo) | $0–50+ |
Bandwidth is the dominant cost for video calls (~1.5 Mbps per user). Providers like Hetzner / OVH don't bill bandwidth → self-hosting is significantly cheaper than AWS/GCP. Cloud's value-add is global edge + included TURN — only worth it when users are scattered across continents or your team has no DevOps capacity.
If you Google any of these errors, this section may save you hours.
- Android Camera2 + LiveKit: livekit-client defaults to
deviceId="default"for video tracks, which Camera2 rejects withfailed to find device with id: default. SetvideoCaptureDefaults.facingModeat theRoomoptions level — do not passdeviceIdinsetCameraEnabled(). - Race condition on join: calling
setCameraEnabled(true)immediately afterLiveKitRoommounts silently fails because the track publisher isn't ready yet. Wait foruseConnectionState() === ConnectionState.Connectedbefore enabling. - iOS simulator camera: there's no webcam access on iOS simulators — self-view tile is black. Test video on a real device, or use an Android emulator with
hw.camera.front=webcam0in the AVD config. - async-storage 3.x maven repo:
shared_storageis shipped as an AAR insidenode_modules/.../local_repo. You'll getCould not find org.asyncstorage.shared_storage:storage-android:1.0.0until you register that path as a maven repo inandroid/build.gradle. - LiveKit in Docker on macOS: the container needs
--node-ip <your-mac-LAN-IP>for ICE candidate advertising — without it, LiveKit advertises a Docker-internal address and real devices can't reach the media port. - Front camera mirror: WebRTC publishes the raw frame; mirroring is a render-time concern. Set
<VideoTrack mirror={participant.isLocal && facingMode === 'user'} />so only the local front-camera preview is mirrored. Remote viewers always see the unmirrored stream.
MIT — see LICENSE. LiveKit itself is Apache 2.0.
🇻🇳 Tiếng Việt — bản đầy đủ
Một ứng dụng video call mobile, build từ các công nghệ open-source. Toàn bộ pipeline — từ client mobile, signaling, đến media server — đều chạy được trên hạ tầng tự host, không phụ thuộc SaaS, không tốn phí per-minute.
Repo này là một implementation thật, end-to-end của React Native + LiveKit + Node.js cho video call. Clone về chạy trên 1 con Mac trong 10 phút.
Xem bảng "Tech stack" phía trên — vai trò từng layer (React Native, LiveKit SFU, signaling Protobuf, transport WebRTC over UDP, JWT backend, Docker, Xcode/Gradle).
- 3 user hardcoded (Alice / Bob / Charlie) — không có DB, không có auth thật (cố ý cho quickstart)
- Tạo room ad-hoc theo tên
- Video call N-người (test với 2-3 device cùng lúc)
- Mute mic, on/off camera, flip camera trước/sau
- Self-view mirror như selfie chuẩn (FaceTime-style), người khác thấy chiều thật
ipconfig getifaddr en0 # ví dụ: 192.168.1.42Cập nhật ở 2 nơi: root .env (LIVEKIT_NODE_IP) và app/src/config.ts (HOST_IP).
docker compose up -d
curl http://localhost:7880 # phải trả "OK"cd backend && npm install && cp .env.example .env && npm run devcd app && npm install
cd ios && bundle install && bundle exec pod install && cd ..
npm start
# terminal khác:
npx react-native run-ios --device "Tên iPhone" # iPhone thật
npx react-native run-android # Android emulatorLần đầu trên iPhone thật: mở Xcode → tab Signing & Capabilities → chọn Team (Apple ID free OK) → đổi Bundle ID. Sau khi cài, Settings → General → VPN & Device Management trên iPhone để Trust dev cert.
Mở app trên 2 device → chọn 2 user khác nhau → cùng tên room → Join.
| Quy mô | Hạ tầng | Chi phí |
|---|---|---|
| Dev local | Docker trên máy bạn | $0 |
| Beta < 100 user | 1 VPS Hetzner/DO + coturn + Caddy TLS | $5–20 / tháng |
| Scale | Multi-node LiveKit + Redis + coturn riêng | $50–200 / tháng |
| Không lo ops | LiveKit Cloud | $0–50+ |
Bandwidth là chi phí chính (~1.5 Mbps/user). Hetzner/OVH không tính phí bandwidth → self-host rẻ hơn AWS/GCP nhiều. Cloud bù lại bằng global edge + TURN sẵn — chỉ cần khi user ở nhiều quốc gia hoặc team không có DevOps.
- Android Camera2 + LiveKit: livekit-client mặc định gắn
deviceId="default"→ Camera2 reject vớifailed to find device with id: default. Phải setvideoCaptureDefaults.facingModeởRoomoptions, KHÔNG pass deviceId trongsetCameraEnabled(). - Race condition: gọi
setCameraEnabled(true)ngay sau khiLiveKitRoommount sẽ fail thầm lặng. Phải đợiuseConnectionState() === ConnectionState.Connected. - iOS simulator: không có webcam → self-view tile đen. Test video phải dùng device thật hoặc Android emulator (cấu hình
hw.camera.front=webcam0). - async-storage 3.x: ship
shared_storageAAR trongnode_modules/.../local_repo, phải add maven repo vàoandroid/build.gradlemới resolve được. - LiveKit Docker trên Mac: container cần
--node-ip <Mac LAN IP>cho ICE — nếu không thì advertise IP nội bộ Docker, device thật không reach được. - Front camera mirror: WebRTC publish frame thô; mirror là render-side. Set
<VideoTrack mirror={participant.isLocal && facingMode === 'user'} />để chỉ self-view (cam trước) bị mirror.
