Multi-platform Electron template, using React & Redux Toolkit with Python/Flask microservices.

These setup steps are for developers building on top of the template. End users who install your packaged app (MSI / DMG / DEB) need none of this β the installer ships everything.
| Tool | Recommended | Notes |
|---|---|---|
| Node.js | 20.x LTS | Required β₯ 16. CRA 5 / webpack 5 do not need the older --openssl-legacy-provider workaround. |
| Yarn 1 | 1.22.x | npm install works too, but lockfile + scripts are tested against Yarn 1. |
| Python | 3.10 β 3.12 | Used for the Flask service in dev and bundled by PyInstaller for production. |
| pip | bundled with Python | Use pip, pip3, or py -m pip β whichever your install exposes. |
Platform-specific (only when packaging installers):
PATH (e.g., C:\Program Files (x86)\WiX Toolset v3.14.1\bin).fakeroot and dpkg on PATH (sudo apt install fakeroot dpkg).Clone the repo and from the project root:
Python deps (Flask, flask-cors, PyInstaller, pytest):
pip install -r requirements.txt
Node deps:
yarn install
Electron: Electron's main.ts and preload.ts files can be found in the project's root directory. They compile to dist-electron/ via tsc -p tsconfig.electron.json (run automatically by yarn start and yarn build).
React: React files can be found in the ./src/ folder, the custom toolbar is in ./src/components/toolbar.
Python: Python scripts can be created in the ./app.py file and used on events via REST calls.
Below are the scripts you'll need to run and package your application, as well as build out JSDoc documentation, if you choose to do so. An exhaustive list of scripts that are available can be found in the package.json file of the project's root directory, in the scripts section.
β οΈ Β PyInstaller is included in requirements.txt, so a separate install is no longer required. Installer metadata (name, version, manufacturer, description) is pulled from the matching fields in package.json automatically. |
|---|
Start Developer Mode:
yarn run start
Package Windows: 1
yarn run build:package:windows
Package macOS:
yarn run build:package:mac
Package Linux:
yarn run build:package:linux
Build Documentation:
yarn run build:docs
1Windows uses electron-wix-msi, you must install and add its path to your environment variables.
Code documentation for this template, created with JSDoc, can be found here:
Electron, React, & Python Template
Bugs reported on the project's issues page will be exterminated as quickly as possible, be sure to include steps to reproduce so they can be spotted easily.
MIT Β© iPzard