2026-02-07 19:27:26 -08:00
ugh
2026-02-07 19:24:16 -08:00
ugh
2026-02-07 19:24:16 -08:00
ugh
2026-02-07 19:24:16 -08:00
ugh
2026-02-07 19:24:16 -08:00
2026-02-07 19:27:26 -08:00
2026-02-07 17:28:14 -08:00
2026-02-07 17:28:14 -08:00
2026-02-07 19:27:26 -08:00
ugh
2026-02-07 19:24:16 -08:00

Electron TODO Monorepo (Turborepo + Bun)

A long-lived Electron starter focused on:

  1. Performance: Vite renderer, small typed IPC surface, serialized persistence writes.
  2. Maintainability: strict TypeScript, explicit package boundaries, isolated renderer.
  3. Modern best practices: Bun workspaces, Turborepo task graph, shared contracts.

Workspace layout

  • apps/desktop: Electron main + preload process.
  • apps/renderer: React + Vite + Tailwind renderer UI.
  • packages/contracts: shared runtime-validated schemas and IPC/type contracts.

Security and boundary model

  • nodeIntegration: false
  • contextIsolation: true
  • sandbox: true
  • Renderer talks only to window.nativeApi exposed by preload.
  • Preload and main both validate inputs using shared Zod schemas.

Scripts

  • bun run dev: starts contract build/watch, renderer dev server, and Electron process.
  • bun run build: builds contracts, renderer, and desktop bundles through Turbo.
  • bun run typecheck: strict TypeScript checks for all packages.

Optional:

  • ELECTRON_RENDERER_PORT=5180 bun run dev if 5173 is already in use.

Notes for future native bindings

Add new main-process capabilities by extending packages/contracts first:

  1. Add schema + types for payload/result.
  2. Add an IPC channel constant.
  3. Implement ipcMain.handle in apps/desktop/src/main.ts.
  4. Expose a typed preload wrapper in apps/desktop/src/preload.ts.
  5. Consume only via window.nativeApi in renderer.

This keeps native concerns out of React and makes refactors low risk.

S
Description
T3 Code fork for Android and server fixes
Readme MIT
902 MiB
0 Stars 1 Watchers 0 Forks
2026-09-20 14:36:07 +02:00
Languages
TypeScript 95.5%
MDX 2.1%
JavaScript 0.7%
Astro 0.3%
CSS 0.3%
Other 0.9%