/reactron

A full featured and highly scalable electron-react boilerplate

Primary LanguageJavaScript

React Boilerplate Electron Version

Reactron is a boilerplate to kick start your electron application with react based on Electron and the famous React Boilerplate.

React Redux Webpack BabelJS React Router Jest ESLint

React Boilerplate Electron Version


Installation

Note: Whether you have native dependencies in your app or not, I assume it's nice to always have node-gyp build tools installed on your machine.

For Windows: npm install --global --production windows-build-tools from CMD or Powershell (With Admin)

For Ubuntu: Follow My Answer On Stackoverflow

Then

First, clone the repository from github:

$ git clone https://github.com/mjangir/reactron.git

And then install dependencies with npm:

$ npm install

Run

Start the app in the dev environment. This starts the renderer process in hot-module-replacement mode and starts a webpack dev server that sends hot updates to the renderer process:

$ npm run dev

Alternatively, you can run the renderer and main processes separately. This way, you can restart one process without waiting for the other. Run these two commands simultaneously in different console tabs:

$ npm run start-renderer-dev
$ npm run start-main-dev

You can also run a webpack compiled main process with the following:

$ npm start

Packaging

To package apps for the local platform:

$ npm run package

To package apps for all platforms:

First, refer to Multi Platform Build for dependencies. Then,

$ npm run package-all

Features Added

The project has some of the common desktop application features integrated:

  1. Auto Update: Publish your electron app on Github or Amazon S3 by updating the credentials in package.json. Then click on the Check For Updates in Help menu. For more information on publishing the app, check this out.
  2. Auto Launch On Start: On settings page, when you check Auto Launch At Start option, the app will be automatically started on windows or osx startup.
  3. Show Tray Icon: On settings page, you can toggle Show Tray Icon option to show the icon in tray. Currently it has only quit option in the tray context menu.
  4. Start Minimized: If you check this option, the application will be started minimized.
  5. Apart from that, window state keeper has been added to retain the last window sizes and dimesion.

How to keep your project updated with the boilerplate

If your application is a fork from this repository, you can add this repo to another git remote:

git remote add upstream https://github.com/mjangir/reactron.git

Then, use git to merge some latest commits:

git pull upstream master

Thanks To

React Boilerplate Electron

Maintainers

Manish Jangir

License

MIT © Manish Jangir