A batteries-included starter template for building native desktop apps with Electrobun, React 19, TanStack Router, and Tailwind CSS v4.
Electrobun = Bun + WKWebView β blazing fast, zero-Electron desktop apps for macOS (Linux & Windows coming soon).
| Layer | Tech | Role |
|---|---|---|
| Runtime | Electrobun | Native window, webview, menus, file dialogs |
| Backend | Bun | Backend process with typed RPC handlers |
| Frontend | React 19 + React Compiler | UI with automatic memoization |
| Routing | TanStack Router | Type-safe, code-based routing |
| Data | TanStack Query | Async state management for RPC calls |
| Styling | Tailwind CSS v4 | Utility-first CSS |
| Build | Vite 7 | HMR dev server + production bundling |
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β BrowserWindow (native frame, titleBarStyle) β
β βββββββββββββββββββββββββββββββββββββββββββββ β
β β mainview (shell) β β
β β β’ Tab bar UI β β
β β β’ Keyboard shortcuts β β
β β β’ Manages <electrobun-webview> tags β β
β β βββββββββββββββββββββββββββββββββββββββ β β
β β β tabview (per-tab OOPIF webview) β β β
β β β β’ TanStack Router + Query β β β
β β β β’ Your app pages live here β β β
β β βββββββββββββββββββββββββββββββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β² β²
β Shell RPC β Tab RPC
βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Bun process (src/bun/index.ts) β
β β’ Tab state management β
β β’ Application menu β
β β’ RPC handlers (ping, system info, dialogs) β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
Two RPC channels keep things clean:
- Shell RPC β Bun β mainview: pushes tab state, receives tab actions
- Tab RPC β Bun β each tab webview: handles app-level requests (ping, system info, file dialogs)
- macOS (Electrobun currently supports macOS, with Linux & Windows on the roadmap)
- Bun β₯ 1.1
# Clone the template
gh repo create my-app --template Ataraxy-Labs/electrobun-react-starter --clone
cd my-app
# Install dependencies
bun install
# Start developing (Vite HMR + Bun watcher in one process)
bun run devOr use the two-terminal workflow for more control:
# Terminal 1: Vite dev server with HMR
bun run dev:vite
# Terminal 2: Bun backend with auto-rebuild on save
bun run dev:bunbun run buildsrc/
βββ bun/
β βββ index.ts # Bun backend β tab manager, menus, RPC handlers
βββ mainview/
β βββ App.tsx # Shell β tab bar + webview container
β βββ main.tsx # Shell entrypoint
β βββ index.html
β βββ index.css
βββ tabview/
β βββ tabview-main.tsx # Tab entrypoint β sets up RPC, Query, Router
β βββ index.html
β βββ app/
β βββ router.tsx # TanStack Router config
β βββ rpc.ts # RPC bridge with browser-mode mock fallbacks
β βββ index.css
β βββ pages/
β βββ HomePage.tsx
β βββ PingPage.tsx
β βββ SystemInfoPage.tsx
βββ stubs/
βββ types.ts # Shared RPC type contracts (Tab, ShellRPC, TabRPC)
The starter ships with three demo pages to show how things work:
| Page | What it shows |
|---|---|
| Home | Landing page with links to demos and a stack overview |
| Ping | Round-trip RPC β send a message to Bun, get a response back |
| System Info | TanStack Query fetching system details from Bun (platform, arch, PID, etc.) |
- Create
src/tabview/app/pages/MyPage.tsx - Add an RPC handler in
src/bun/index.ts(if it needs backend data) - Add the RPC call in
src/tabview/app/rpc.ts - Register the route in
src/tabview/app/router.tsx
The RPC bridge (src/tabview/app/rpc.ts) includes mock fallbacks so you can develop the frontend in a regular browser without running Electrobun β just open http://localhost:5173/tabview/index.html directly.
| Command | Description |
|---|---|
bun run dev |
Start everything (Vite + Bun watcher) in one process |
bun run dev:vite |
Start only the Vite dev server |
bun run dev:bun |
Start only the Bun backend with file watching |
bun run build |
Production build (Vite bundle + Electrobun package) |
MIT
Built with π© by Ataraxy Labs