CLI tool
reZach/secure-electron-template avatar
reZach/secure-electron-template

secure-electron-template for Security-Aware Electron Apps

The best way to build Electron apps with security in mind.

1,710 stars153 forksJavaScriptMIT

At a glance

What is it?
secure-electron-template is an Electron application starter that combines React, TypeScript, Redux, Webpack, packaging, localization, and security-oriented defaults. It fits developers who want a preconfigured foundation, but it does not replace application-specific threat review or dependency maintenance.
Who is it for?
Adopt secure-electron-template when you want a JavaScript-oriented Electron foundation with several common application services already connected. Do not adopt it unchanged when you need a minimal renderer, a different build system, or a fully audited application-specific security model.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 115 days ago.
What is it written in?
Mainly JavaScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What secure-electron-template solves for Electron developers

secure-electron-template addresses the setup work required to begin an Electron application while keeping common Electron security practices visible in the starter project. The README describes it as a current Electron app template built with security in mind, and its feature list covers secure content loading, context isolation, session permissions, content security policy, navigation, window creation, webview checks, external links, and the remote module. That makes it most relevant to developers starting a desktop application with JavaScript and TypeScript who do not want to assemble Electron, React, Redux, Webpack, localization, packaging, and basic permission controls from separate examples.

The intended users are therefore not experienced Electron teams with an established architecture. The template is more useful to developers who need a working starting point and are willing to inspect its conventions. It is also a reasonable reference for a team comparing its own Electron security settings against a documented checklist. The README is explicit about one boundary: the developer remains responsible for loading only secure assets. A template can set safer defaults, but it cannot decide whether every URL, route, asset, protocol, or user-supplied value in a finished application is trustworthy.

The project includes Electron, React, TypeScript, Redux with Redux toolkit, Babel, Webpack, webpack-dev-server, Electron builder, and Mocha. It also includes i18next, a filesystem-backed localization plugin, secure-electron-store, a context-menu module, easy-redux-undo, and license-key validation. This is a broad application shell, not only a security configuration file. The trade-off is that adopting the template also adopts its build pipeline, project layout, state-management conventions, and dependency set.

Electron and Webpack wiring visible in package.json

The repository layout indicates a conventional separation between the Electron entry point, application code, localization, tests, development scripts, and Webpack configuration. The `package.json` entry point is `app/electron/main.js`. Renderer or application assets are built through Webpack, with separate development and production configuration files at the repository root. The `build.files` list includes `app/dist/**/*`, `app/electron/**/*`, selected localization code, and `LICENSE`, while `extraFiles` includes locale data, `license.data`, and `public.key`. This is evidence that packaging is part of the template rather than an afterthought.

The documented scripts also show the intended local workflow. Development uses a preparation script and a launch script through `concurrently`, with the development server and Electron application launched together. Production uses `webpack` in production mode before starting Electron. Packaging uses `electron-builder`, with separate commands for a directory build, a distribution build, and operating-system targets. Tests run through Mocha. The repository includes `webpack.config.js`, `webpack.development.js`, and `webpack.production.js`, so a developer can inspect how each mode is assembled instead of treating `npm run dev` as an opaque command.

The README says the architecture documentation provides a more detailed view. Since that document is not reproduced here, the exact process boundary between the main process, renderer, preload code, and Webpack output should be verified in the repository before changing it. The available files show the architecture, but they do not establish every runtime message or IPC detail.

Installing the template and starting development

The README gives a direct command-line setup path. Clone the repository, enter the generated directory, install dependencies with npm, and start the development workflow. The first command is unnecessary when the shell is already inside the cloned repository.

bash
git clone https://github.com/reZach/secure-electron-template.git
cd secure-electron-template
npm i
npm run dev

The expected first result is a development-oriented Electron session. According to `package.json`, `npm run dev` starts two coordinated Node processes: `dev-scripts/prepareDevServer.js` and `dev-scripts/launchDevServer.js`. The script redirects Webpack output to `dev-scripts/webpack-dev-server.log` and its error output to `dev-scripts/webpack-dev-server-error.log`, which gives you concrete log locations to inspect if the development window does not appear. The README does not state the exact port used by the development server, so no port should be assumed.

Before treating the starter as a distributable application, replace the placeholder product metadata in the build configuration. The available `package.json` snippet shows `productName` as `YourProductName` and an example `appId`. It also lists `license.data` and `public.key` as extra files, so applications that do not use the included license-key feature may need to review whether those files belong in their package.

Security defaults and their application limits

The README lists 17 Electron security practices associated with the template. It states that secure content is enabled, Node.js integration is not enabled for remote content, context isolation is enabled, session permission requests are handled, and web security is not disabled. It also says that a content security policy is defined and that insecure content, experimental features, Blink features, and popups are not enabled. Navigation and new-window creation are disabled or limited, webview options are checked, and the remote module is disabled and filtered.

These controls address specific classes of risk. Context isolation limits the relationship between web content and Electron or Node.js APIs. Restricting navigation prevents a renderer from moving to unintended locations. Handling permission requests gives the application a place to decide whether camera, microphone, geolocation, or another capability should be granted. Disabling the remote module removes an API path that older Electron applications sometimes exposed.

The limitation is that these are defaults and implementation patterns, not a guarantee for every future change. The README itself assigns secure asset loading to the developer. It also does not explain in this excerpt how the CSP is defined, which hosts are allowed, how external URLs are validated, or how exceptions are granted for application features. A feature that opens a browser window, handles a license response, loads a locale file, or accepts a deep link deserves its own review. The `audit-app` script runs `electronegativity`, but it explicitly excludes `LimitNavigationGlobalCheck` and `PermissionRequestHandlerGlobalCheck`, so the presence of that command should not be read as proof that every security check is enforced.

Production builds, packaging, and maintenance cost

The repository provides separate commands for building and packaging. `npm run prod` runs the production Webpack build and then starts Electron. `npm run pack` creates an unpacked directory with Electron builder. The `dist` command runs the test suite, builds production assets, and invokes Electron builder. There are also commands for macOS, Linux, Windows, and all three platforms.

bash
npm run prod-build
npm run pack

The first command creates the production bundle. The second creates the package directory without producing installers. The README does not document installer signing, notarization, code-signing credentials, update channels, or rollback procedures, so those parts must be checked in the linked scripts documentation and Electron builder configuration before distribution.

Maintenance is a real adoption cost because this is a dependency-heavy template with Electron, Webpack, Babel, React, Redux, Electron builder, Mocha, and several optional reZach modules. The repository is not archived, and the last push was on 2026-06-30. That does not by itself establish compatibility with the current Electron or Node.js release available to you. The listed releases are v22.0.0 from 2022-07-28, v21.0.0 from 2022-07-27, and v20.0.0 from 2022-07-20. The gap between the release list and the repository push means the default branch may contain work beyond the newest listed release, so the package lockfile and current branch contents should be reviewed directly. The MIT license permits use and modification under its terms, but it does not provide a security warranty.

Choosing between this template and a plain Electron setup

The main alternative is a plain Electron application configured from scratch. That approach starts with Electron directly and adds only the frameworks and services an application needs. It can produce a smaller dependency surface and a cleaner architecture when the team already has established conventions, but it also requires the team to design permission handling, CSP rules, navigation restrictions, window behavior, packaging, tests, and localization itself.

secure-electron-template chooses a different approach. It supplies those connection points and documents a large set of security-oriented defaults, which is useful when the goal is to get a conventional Electron application moving quickly. The difference is not that the template eliminates security work. It moves some initial decisions into a known project structure, while leaving application-specific decisions to the developer. The broader stack also creates more places to update and understand.

For a small utility with one window and no need for React, Redux, localization, or an undo stack, a plain Electron setup may be easier to reason about. For a team that wants React, TypeScript, Redux, Webpack, Electron builder, Mocha, and localization conventions from the first commit, the template has a clearer reason to exist. A team should also compare the included license-key and context-menu modules against its actual product requirements rather than keeping dependencies merely because the starter contains them.

Editorial conclusion

Adopt secure-electron-template when you want a JavaScript-oriented Electron foundation with several common application services already connected. Do not adopt it unchanged when you need a minimal renderer, a different build system, or a fully audited application-specific security model. Check `app/electron/main.js`, `package.json`, the security documentation, and the relevant production build command before replacing the template identifiers and packaging your app.

Frequently asked questions

How do I install and run secure-electron-template?

Clone the repository, enter `secure-electron-template`, run `npm i`, and then run `npm run dev`. The development script launches the preparation and launch scripts through `concurrently`.

Which frameworks are included in secure-electron-template?

The project includes Electron, React, TypeScript, Redux with Redux toolkit, Babel, Webpack, webpack-dev-server, Electron builder, and Mocha. It also includes i18next and several reZach modules for storage, context menus, undo, and license-key validation.

Does secure-electron-template make an Electron app secure automatically?

No. The README says the template includes security-oriented defaults, but it also states that the developer is responsible for loading secure assets only. Application-specific URLs, features, and configuration still require review.

Official sources

  1. Issues
  2. License: MIT
  3. README
  4. Releases
  5. reZach/secure-electron-template on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/rezach-secure-electron-template.svg)](https://hysenlabs.com/projects/rezach-secure-electron-template)

Was this useful?