How I built an open-source, BYOK desktop interview copilot with Electron, Next.js 16, and Cloudflare Workers
Most AI interview and meeting assistants are closed-source subscriptions that route your audio,...
Most AI interview and meeting assistants are closed-source subscriptions that route your audio, resume, and API keys through someone else's backend. I wanted something different: an open-source desktop app where all AI and speech-to-text requests run directly from your own machine using your own API keys.
So I built Realtime Interview Copilot (Apache 2.0, macOS and Windows). You can also read the full project write-up on my site: https://vedgupta.in/projects/realtime-interview-copilot-desktop/
Here is a look under the hood at the interesting engineering problems we had to solve.
1. Native System Audio Loopback (No Virtual Drivers)
Normally, capturing system audio on macOS or Windows in an Electron app forces users to install virtual audio cables like BlackHole or VB-Audio. That kills onboarding for most people.
Instead, we used Electron's setDisplayMediaRequestHandler returning audio: "loopback". That lets the app capture system audio directly out of the box, alongside a spacebar push-to-talk mic mode in the Ask AI drawer.
2. Keeping API Keys Strictly Local (BYOK)
In an earlier version, the Cloudflare Worker backend proxied /api/completion and /api/deepgram. We recently retired those server endpoints (they now return 410 BYOK_REQUIRED) and moved all AI and STT execution client-side.
- Keys are encrypted locally on disk using Electron's
safeStorage(byok.enc/byok.key). - Requests go straight from your machine to OpenAI, Gemini, Groq, OpenRouter, Together, Deepgram, or a local Ollama / LM Studio server.
- The Cloudflare Worker (
realtime-worker-api) only handles Better Auth desktop SSO, account approval, optional cloud-synced notes, and anonymized usage counts using D1 + Drizzle ORM.
3. Stealth Overlay and Screen-Share Hiding
A live copilot is useless if it steals focus from your editor or shows up when you share your screen.
We built a frameless, transparent, always-on-top compact overlay with:
setContentProtection(true)so screen sharing hides the window on macOS and Windows.setFocusable(false)in Stealth Mode (Cmd+Shift+E/Ctrl+Shift+E) so your active window never loses focus.- Click-through empty space and a global screenshot-and-ask shortcut (
Cmd+Shift+1/Ctrl+Shift+1).
4. Next.js 16 Static Export in Electron + Shared CSP
The UI is built with Next.js 16 (output: "export" with assetPrefix: "./" so file:// loading works cleanly in Electron), React 19, Tailwind CSS v4, and Radix UI.
One small pattern that saved a lot of headaches: keeping Content Security Policy in a single plain-JS source of truth (lib/csp.mjs) that both Next.js and Electron's session.defaultSession.webRequest import directly.
5. Token-Budgeted Conversation Memory
Long interviews blow past context limits fast. We wrote a token-budgeted prompt builder (lib/interview-memory.ts, 24k default budget with a 6k compact fallback using gpt-tokenizer) that pins your parsed PDF/DOCX resume and job description, deduplicates VAD/Deepgram utterances, and stores turns in IndexedDB.
Try It or Contribute
- Project page: https://vedgupta.in/projects/realtime-interview-copilot-desktop/
- GitHub Repo (Apache 2.0): https://github.com/innovatorved/realtime-interview-copilot
Quick install:
- macOS (Homebrew):
brew tap innovatorved/tap && brew install --cask realtime-interview-copilot - Windows (WinGet):
irm https://raw.githubusercontent.com/innovatorved/winget/main/install-realtime-interview-copilot.ps1 | iex
If you work with Electron, Next.js, or Cloudflare Workers and want to check out the code, open an issue, or drop a star on the repo, I would genuinely appreciate the feedback!
Sumber artikel open-source oleh Ved Gupta di DEV Community — Baca artikel asli. Topik:
#opensource#electron#nextjs#ai

Komentar