I built this because I wanted a clean, low-latency starting point for anyone looking to build their own remote control or screen-sharing tools. Most existing solutions are either too complex to dive into or too proprietary to modify. This is a "stripped-to-the-bones" boilerplate that gives you the essentials: real-time signaling, WebRTC streams, and remote input simulation.
Whether you're trying to build an alternative to TeamViewer, a specialized support tool, or just learning how low-level input works in Electron, this is for you.
I chose these specific technologies because they balance performance with ease of deployment:
- Electron: For the cross-platform shell and native system access (keyboard/mouse control).
- WebRTC: For peer-to-peer screen streaming with minimal lag.
- Supabase: My go-to for handling the session database and auth. It’s fast to set up and scales perfectly.
- Koyeb: Recommended for hosting the signaling server. It handles WebSockets and global routing effortlessly.
The app needs to know where your signaling server is hosted.
- Open
electron/preload.jsand updatehttps://your-signaling-server.comto your URL. - Open
src/index.htmland update theContent-Security-Policymeta tag to allow connections to your domain.
This project uses electron-builder to package the app into a production-ready installer.
To build for Windows:
npm run build:winThe output will be in the /dist folder. You'll find a portable version and a standard NSIS installer.
The boilerplate is pre-configured with electron-updater to handle background updates via GitHub Releases.
- Repository Setup: Ensure your
package.jsonandelectron-builder.ymlpoint to your actual GitHub repository. - Generate a Token: Create a GitHub Personal Access Token (classic) with
repopermissions. - CI/CD or Local Publish:
- Set an environment variable:
GH_TOKEN=your_token_here. - Run the publish command:
npx electron-builder --win -p always
- Set an environment variable:
This will build the app and automatically upload the artifacts to a "Draft" release on GitHub. Once you publish that release, users running previous versions will automatically detect and download the update on their next startup.
I'm using a fork of nut-js to handle the mouse and keyboard events. It’s powerful but can be finicky on different OS permissions. If you're building for production, make sure to handle the Accessibility/Screen Recording permissions on macOS particularly well.
Feel free to fork this, tear it apart, and build something better.
— Mohamed Yassin