/
/

Let's Build SomeThing Legendary together

Second Screen App

A real-time display extension system that allows tablets or secondary devices to act as an additional screen for a desktop using WebRTC.

Overview

The Second Screen App enables users to extend their desktop display to another device such as a tablet. Instead of relying on cables or proprietary software, this application streams the desktop screen in real time using WebRTC. A desktop client built with Electron captures the screen and streams it to connected devices through peer-to-peer communication. Devices connect using a secure session code, allowing quick pairing between the desktop and the secondary device.

Problem

Many professionals and developers benefit from multiple monitors, but not everyone has access to extra displays. Tablets and other devices are often available but cannot easily function as extended monitors. Existing solutions are often proprietary, expensive, or require complicated setup processes.

Solution

The Second Screen App provides a lightweight system that converts any device with a browser into a secondary display. The desktop application captures the screen and streams it using WebRTC, while the receiving device simply joins a session using a generated pairing code. This eliminates complex configuration and reduces latency through peer-to-peer streaming.

Key Features

Tech Stack

Electron.js
WebRTC
React
React Native
Supabase
TypeScript
STUN Servers

System Architecture

The system uses WebRTC for peer-to-peer media streaming while Supabase acts as a signaling layer for exchanging connection information such as offers, answers, and ICE candidates.

Second Screen Architecture Diagram

How It Works

  1. User logs into the desktop application.
  2. The desktop starts screen capture using Electron’s desktopCapturer API.
  3. A WebRTC session is created and a 6-digit code is generated.
  4. The secondary device enters the code and joins the session.
  5. Supabase exchanges signaling data between devices.
  6. A direct peer-to-peer connection is established.
  7. The desktop screen begins streaming to the secondary device.

Demo

Challenges

Key Learnings

Building this project deepened my understanding of WebRTC, peer-to-peer networking, and real-time media streaming. I also gained experience designing signaling systems, managing cross-device communication, and optimizing performance for real-time applications.