Electron AppStack

Electron + tRPC v11 · free and open source

Electron tRPC boilerplate for type-safe IPC

No channel strings. No hand-written preload API. Just procedures.

tRPC v11 over Electron IPC: zod-validated inputs in the main process, typed calls and TanStack Query hooks in React, subscriptions for events pushed by the main process.

$ npx degit nick-keller/electron-appstack/template my-app
  • tRPC
  • Zod
  • TanStack Query
  • TypeScript
  • React
  • SQLite
  • Drizzle ORM
  • Electron

tRPC setup

Electron IPC without the boilerplate

ipcMain.handle, channel names and a preload API to keep in sync are replaced by one typed router.

One router, both processes

Define it in the main process, call it from React

A procedure is validated, typed and autocompleted on both sides. superjson keeps Date, Map and Set intact, and licensedProcedure gates it behind a valid license.

Read the IPC guide
// src/main/trpc/routers/todos.ts (main process)
export const todosRouter = router({
  create: licensedProcedure
    .input(z.object({ title: z.string().trim().min(1).max(200) }))
    .mutation(({ ctx, input }) =>
      ctx.db.insert(todos).values(input).returning().get()
    )
})

// src/renderer/src/routes/index.tsx (renderer)
const create = useMutation(trpc.todos.create.mutationOptions())
create.mutate({ title: 'Ship v1' }) // typed, validated, autocompleted

And much more

Much more than an Electron tRPC boilerplate

tRPC is only the start. Electron AppStack includes 20 of the 22 features we compare boilerplates on, where the most popular other Electron boilerplates with type-safe IPC average 10: a typed backend, a database, auto update, signed releases, source code protection and license keys, all wired together and documented.

Compare

Electron AppStack vs other boilerplates with type-safe IPC

The most popular maintained Electron boilerplates with type-safe IPC, side by side. Electron AppStack is #1 of 19 in our ranking.

FeatureElectron AppStackelectron-shadcnElectron React BoilerplateElectron React App
Developer experience
AI agent instructionsAGENTS.md or rules so coding agents follow the conventions.✓×××
Frontend
UI componentsA component library or design system.✓✓×✓
Backend
Typed IPCCalls from the renderer to the main process are typed end to end.✓✓–✓
Local databaseAn embedded database with migrations.✓×××
Shipping
Auto updateThe app downloads and installs new versions.✓✓✓×
Release workflowCI builds and publishes installers for every platform.✓✓✓–
Code signingSigning and notarization wired into the build.✓×✓×
Selling
Source code protectionBytecode compilation, Electron fuses or ASAR integrity.✓–××
License keysActivation, validation and offline use of license keys.✓×××

✓Included–Partial or manual setup×Not includedHover a cell for details.

One command

Create your tRPC Electron app

Copy the template, install, run. Hot reload starts with the example app: a todo list stored in SQLite and a settings page with light and dark themes.

Read the getting started guide
npx degit nick-keller/electron-appstack/template my-app
cd my-app
npm install
npm run dev

FAQ

Frequently asked questions

Which tRPC version and IPC link does it use?

tRPC v11 with trpc-electron, which carries tRPC calls over Electron IPC. On the renderer side, @trpc/tanstack-react-query gives every procedure TanStack Query options.

Is tRPC over IPC secure?

The renderer is sandboxed with context isolation and no Node.js, and the preload script only exposes the tRPC link. Every input is validated with zod in the main process before your code runs.

Can I restrict procedures to licensed users?

Yes. licensedProcedure only runs when the app has a valid license key, so paid features are enforced in the main process, not only hidden in the UI.

Can I still use ipcMain and ipcRenderer?

Yes, nothing prevents it, but tRPC covers requests, mutations and events pushed from the main process, so you rarely need to.

Is it really free?

Yes. Electron AppStack is open source under the MIT License, with no paid tier. Use it for commercial apps and sell them. LicenseManager is free up to 100 active licenses, and Stripe only charges a fee on the payments you receive.

Is it a framework I depend on?

No. You copy the template once with degit and the code is yours. There is no package to update and nothing to eject.

Same template

Looking for another stack?

One boilerplate covers all of them: pick the page that matches your search.

Start your tRPC desktop app today

Free, production-ready, and yours from the first command.

$ npx degit nick-keller/electron-appstack/template my-app