Reactron is a boilerplate to kick start your electron application with react based on Electron and the famous React Boilerplate.
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
First, clone the repository from github:
$ git clone https://github.com/mjangir/reactron.git
And then install dependencies with npm:
$ npm install
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
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
The project has some of the common desktop application features integrated:
- 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.
- 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.
- 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.
- Start Minimized: If you check this option, the application will be started minimized.
- Apart from that, window state keeper has been added to retain the last window sizes and dimesion.
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
MIT © Manish Jangir