Building Desktop Apps with C++ & WebView: 48KB Binary, Instant

NL Tech October 26, 2025
Video Thumbnail
NL Tech Logo

NL Tech

@nltech1

About

Welcome to NL Tech. This is an educational channel focused on Computer Science and Software Engineering.

Video Description

Build truly minimal cross-platform desktop applications with C++ and native system WebView components—no bloated browser engines required. In this video, I show you how to create a complete desktop app in just 48 kilobytes, with instant startup times and native performance. Unlike Electron (150-200MB), this approach uses WebView2 on Windows, WebKit on macOS, and GTK WebKit on Linux—exactly like Rust's Tauri, but with C++. You'll learn the entire workflow: from CMake configuration to Vite frontend bundling to seamless C++ and JavaScript bindings. We'll cover: ✅ Why WebView is more performant than bundled browser engines ✅ Project structure with CMake and Vite ✅ Exposing C++ functions to JavaScript ✅ Building performant web UI applications ✅ When to use this vs Dear ImGui or Egui ✅ Best practices for keeping bundles small The key principle? Treat the web layer as your UI thread. Keep UI logic in JavaScript, push everything else—file operations, data processing, system integration—to native C++. Repository with working example: https://github.com/nikelaz/cpp-webview-gui Perfect for developers building production desktop tools, internal utilities, or anyone tired of Electron bloat. 🔥 Topics Covered: ✅ C++ webview library setup with CMake ✅ Vite frontend bundling and integration ✅ C++ function bindings in JavaScript ✅ Multi-platform native WebView rendering ✅ Performance optimization & binary size reduction ✅ When to use WebView vs native frameworks 📚 Contents: 0:00 - Intro 0:40 - How C++ WebView Works 0:58 - Executable Size & Startup Time 1:31 - Creating a WebView Window in C++ 3:01 - How the UI is Build 6:30 - How the App is Build with CMake 5:12 - Performance 5:50 - Bindings: JavaScript/C++ Communication 7:44 - Should you use a Web View as a UI Renderer? Alternatives. 9:37 - Conclusion 🔗 Resources: 📦 Repository: https://github.com/nikelaz/cpp-webview-gui 🔧 WebView Library: https://github.com/webview/webview 📚 nlohmann/json: https://github.com/nlohmann/json 📹 How I Structure Cross-Platform C++ Projects with CMake: https://youtu.be/qjHf_S_PxSw