explaingit

electron/minimal-repro

11,447JavaScriptAudience · developerComplexity · 1/5Setup · easy

TLDR

A minimal Electron app template maintained by the Electron team for creating stripped-down bug reproductions, containing only the four essential files that make an Electron desktop app run.

Mindmap

mindmap
  root((electron minimal-repro))
    Purpose
      Bug reproduction
      Minimal test case
      Electron learning
    Files
      main.js main process
      index.html renderer
      preload.js bridge
      package.json config
    Requirements
      Node.js
      Git
      npm install
    Not For
      Full app scaffolding
      Production projects
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Create a minimal reproduction of an Electron bug by cloning this template and adding only the code that demonstrates the specific problem.

USE CASE 2

Understand how an Electron app's main process, renderer process, and preload script connect by reading the four template files.

USE CASE 3

Quickly test whether a specific Electron API behaves as expected without setting up a full Electron Forge project.

Tech stack

JavaScriptElectronNode.jsHTML

Getting it running

Difficulty · easy Time to first run · 5min

For building a real Electron app, use Electron Forge instead, this template is for bug reports only.

In plain English

This repository is a minimal starter template for Electron apps, maintained by the Electron team itself. Electron is a framework that lets developers build desktop applications using web technologies, meaning the same kind of code used to build websites can be used to make apps that run on Windows, macOS, and Linux. The primary purpose of this template is to help developers create a minimal reproduction when reporting a bug. A minimal reproduction means stripping an app down to only the code needed to show a specific problem, so that the people investigating the bug can focus on exactly the issue at hand without unrelated code in the way. The repository was previously named electron-quick-start and has been renamed to make this purpose clearer. The template contains four files. The package.json file describes the app and its dependencies. The main.js file starts the application and creates the desktop window, which is called the main process. The index.html file is the web page displayed inside that window, called the renderer process. The preload.js file runs a script before the page loads and can bridge the two processes. To run it, you clone the repository, install its dependencies with npm, and then run npm start. Git and Node.js are the only prerequisites. If you are looking to start a new Electron app from scratch rather than reproduce a bug, the README points to Electron Forge, which is the recommended tool for bootstrapping full projects.

Copy-paste prompts

Prompt 1
I found a bug in Electron where a specific IPC call behaves unexpectedly. Show me how to clone electron/minimal-repro and add the minimum code needed to reproduce it so I can file a useful bug report.
Prompt 2
I'm new to Electron and want to understand how main.js, preload.js, and index.html connect. Walk me through what each file in this template does and how the two processes communicate.
Prompt 3
I want to test whether a specific Electron contextBridge API works in the preload script. Show me how to add a quick test using this minimal template without any extra tooling.
Open on GitHub → Explain another repo

← electron on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.