This boilerplate project is based on https://github.com/chentsulin/electron-react-boilerplate.
Hybrid (Electron + Browser [offline mode]) application boilerplate using:
- React
- Redux
- React Router
- Webpack 2
- React Transform HMR
- PouchDB, "The Database that Syncs!"
- React Toolbox to provide Material Design Components
Web | Desktop |
---|---|
- Note: requires a node version >= 6 and an npm version >= 3.
First, clone the repo via git:
git clone https://github.com/juliobetta/react-offline-hybrid-boilerplate.git your-project-name
And then install dependencies.
$ cd your-project-name && npm install
Desktop in development mode
npm run dev-desktop
Web in development mode
npm run dev-web
... and access http://localhost:8080
Build Web package
npm run build-web
The files will be located in the folder build
.
Generate Desktop package
OSX
npm run package
Linux
npm run package:linux
Windows
npm run package:win
All platforms at once
npm run package:all
The files will be located at release/[platform]
.
Before building for multiple platforms, please refer to https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build.
The project is covered by tests using Chai.
To run them once, execute:
npm run test:all
... or in watch mode:
npm run test:watch
You can run tests in isolation by using wildcards or even a path to a single file.
Wildcard
npm run test path/to/test/**/*.test.js
Single file
npm run test path/to/file.test.js
To run in watch mode, add -- --watch
in front of the commands above.
Please, make sure to take a look at all available npm commands in package.json
.
Atom
apm install editorconfig es6-javascript autocomplete-flow javascript-snippets linter linter-eslint language-babel
Sublime
- https://github.com/sindresorhus/editorconfig-sublime#readme
- https://github.com/SublimeLinter/SublimeLinter3
- https://github.com/roadhump/SublimeLinter-eslint
- https://github.com/babel/babel-sublime
Others
- Editorconfig
- ESLint
- Babel Syntax Plugin
Tested on macOS
In case the terminal gets stuck on npm install
, hit ctrl+C
and run the following commands:
node_modules/.bin/electron-rebuild
...and then
bash postinstall.sh