Overview:
electron-react-boilerplate is a boilerplate template for creating Electron applications with React.js. It allows developers to easily build cross-platform desktop applications using the popular React framework. The boilerplate comes with a number of features and configurations that enable the development of multi-window applications with support for touchbar, tray, dock, and updates. It also provides the ability to customize the build configuration and package the application for distribution.
Features:
- Support for React: All windows in the application are developed using React, but can be changed to other frameworks if desired.
- Multi-window support: The windows configuration in erb.config.js allows for easy customization of multiple windows using the same electron BrowserWindows constructor parameters.
- Touchbar support: The touchbar functionality can be modified by editing the set-touchbar.ts file according to the application’s needs.
- Tray support: The tray functionality can be customized by editing the set-tray.ts file to suit the requirements of the application.
- Dock support: The dock menu can be modified by editing the set-dock-menu.ts file based on the application’s needs.
- Update support: The build configuration in package.json allows for easy updating of the application.
Installation:
To install and use electron-react-boilerplate, follow these steps:
- Clone the repository:
git clone [repository-url] - Install the dependencies:
npm install - Run the application in development mode:
npm run dev - By default, the application will open a renderer process on port 8080. To specify a different port, use the following command:
npm run dev -- --port [port-number] - To run tests using Jest: edit jest.config.js to customize the testing configuration and run:
npm run test - To package and run the application: edit the relevant fields in package.json, including changing the icon by modifying the title in index.html.
Summary:
electron-react-boilerplate is a convenient and customizable boilerplate for developing Electron applications with React.js. It provides support for React, multi-window architecture, touchbar, tray, dock, and updates. The installation process is straightforward and allows for easy customization and packaging of the application for distribution.