├── public
├── icon.icns
├── img
│ ├── singapore.jpg
│ └── logo.svg
├── icons
│ ├── mac
│ │ └── icon.icns
│ ├── png
│ │ ├── 16x16.png
│ │ ├── 24x24.png
│ │ ├── 32x32.png
│ │ ├── 48x48.png
│ │ ├── 64x64.png
│ │ ├── 128x128.png
│ │ ├── 256x256.png
│ │ ├── 512x512.png
│ │ └── 1024x1024.png
│ └── win
│ │ └── icon.ico
├── assets
│ ├── icons
│ │ ├── logo.png
│ │ ├── delete.png
│ │ ├── folder.png
│ │ ├── simple_add.png
│ │ ├── text_file.png
│ │ ├── full_screen.png
│ │ ├── seperator.svg
│ │ ├── separator-dark.svg
│ │ ├── next-dark.svg
│ │ ├── thread-add-dark.svg
│ │ ├── thread-add-light.svg
│ │ ├── next.svg
│ │ ├── save.svg
│ │ ├── save-dark.svg
│ │ ├── add-editor-dark.svg
│ │ ├── add-editor-light.svg
│ │ ├── delete-thread-dark.svg
│ │ ├── delete-thread-light.svg
│ │ ├── user.svg
│ │ ├── folder-dark.svg
│ │ ├── folder-light.svg
│ │ ├── email.svg
│ │ ├── username.svg
│ │ ├── image.svg
│ │ ├── image-dark.svg
│ │ ├── code.svg
│ │ ├── code-dark.svg
│ │ ├── circle-add-dark.svg
│ │ ├── circle-add-light.svg
│ │ ├── export.svg
│ │ ├── export-dark.svg
│ │ ├── maximize.svg
│ │ ├── full-screen-dark.svg
│ │ ├── lock.svg
│ │ ├── image-file-light.svg
│ │ ├── embed-content-dark.svg
│ │ ├── embed-content-light.svg
│ │ ├── file-dark.svg
│ │ ├── code-editor.svg
│ │ ├── text-file-light.svg
│ │ └── code-block.svg
│ ├── img
│ │ ├── devimg.jpg
│ │ ├── addnotebook.png
│ │ ├── confetti_bg.png
│ │ ├── added_notebook.png
│ │ ├── addnotebook_modal.png
│ │ ├── createdoc_add_btn.png
│ │ ├── addthread_set_title.png
│ │ ├── createdoc_added_img.png
│ │ ├── createdoc_set_title.png
│ │ ├── openworkspace_final.png
│ │ ├── openworkspace_menu.png
│ │ ├── saveworkspace_menu.png
│ │ ├── saveworkspace_notif.png
│ │ ├── createdoc_add_expanded.png
│ │ ├── openworkspace_dialogue.png
│ │ ├── saveworkspace_dialogue.png
│ │ ├── addthread_select_button.png
│ │ ├── addthread_select_channel.png
│ │ └── createdoc_highlight_text.png
│ ├── fonts
│ │ ├── AvenirLTStd-Book.otf
│ │ ├── AvenirLTStd-Light.otf
│ │ └── AvenirLTStd-Roman.otf
│ └── rich-notifications
│ │ ├── disk.png
│ │ ├── icon.png
│ │ ├── image.png
│ │ └── text.png
├── index.html
└── electron.js
├── src
├── index.js
└── client
│ ├── .gitignore
│ └── src
│ └── App.js
├── .editorconfig
├── .gitignore
├── .eslintrc.json
├── auto-updater.js
└── package.json
/public/icon.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/icon.icns
--------------------------------------------------------------------------------
/public/img/singapore.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/img/singapore.jpg
--------------------------------------------------------------------------------
/public/icons/mac/icon.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/icons/mac/icon.icns
--------------------------------------------------------------------------------
/public/icons/png/16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/icons/png/16x16.png
--------------------------------------------------------------------------------
/public/icons/png/24x24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/icons/png/24x24.png
--------------------------------------------------------------------------------
/public/icons/png/32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/icons/png/32x32.png
--------------------------------------------------------------------------------
/public/icons/png/48x48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/icons/png/48x48.png
--------------------------------------------------------------------------------
/public/icons/png/64x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/icons/png/64x64.png
--------------------------------------------------------------------------------
/public/icons/win/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/icons/win/icon.ico
--------------------------------------------------------------------------------
/public/assets/icons/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/icons/logo.png
--------------------------------------------------------------------------------
/public/assets/img/devimg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/img/devimg.jpg
--------------------------------------------------------------------------------
/public/icons/png/128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/icons/png/128x128.png
--------------------------------------------------------------------------------
/public/icons/png/256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/icons/png/256x256.png
--------------------------------------------------------------------------------
/public/icons/png/512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/icons/png/512x512.png
--------------------------------------------------------------------------------
/public/assets/icons/delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/icons/delete.png
--------------------------------------------------------------------------------
/public/assets/icons/folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/icons/folder.png
--------------------------------------------------------------------------------
/public/icons/png/1024x1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/icons/png/1024x1024.png
--------------------------------------------------------------------------------
/public/assets/icons/simple_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/icons/simple_add.png
--------------------------------------------------------------------------------
/public/assets/icons/text_file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/icons/text_file.png
--------------------------------------------------------------------------------
/public/assets/img/addnotebook.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/img/addnotebook.png
--------------------------------------------------------------------------------
/public/assets/img/confetti_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/img/confetti_bg.png
--------------------------------------------------------------------------------
/public/assets/icons/full_screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/icons/full_screen.png
--------------------------------------------------------------------------------
/public/assets/img/added_notebook.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/img/added_notebook.png
--------------------------------------------------------------------------------
/public/assets/img/addnotebook_modal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/img/addnotebook_modal.png
--------------------------------------------------------------------------------
/public/assets/img/createdoc_add_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/img/createdoc_add_btn.png
--------------------------------------------------------------------------------
/public/assets/fonts/AvenirLTStd-Book.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/fonts/AvenirLTStd-Book.otf
--------------------------------------------------------------------------------
/public/assets/fonts/AvenirLTStd-Light.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/fonts/AvenirLTStd-Light.otf
--------------------------------------------------------------------------------
/public/assets/fonts/AvenirLTStd-Roman.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/fonts/AvenirLTStd-Roman.otf
--------------------------------------------------------------------------------
/public/assets/img/addthread_set_title.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/img/addthread_set_title.png
--------------------------------------------------------------------------------
/public/assets/img/createdoc_added_img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/img/createdoc_added_img.png
--------------------------------------------------------------------------------
/public/assets/img/createdoc_set_title.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/img/createdoc_set_title.png
--------------------------------------------------------------------------------
/public/assets/img/openworkspace_final.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/img/openworkspace_final.png
--------------------------------------------------------------------------------
/public/assets/img/openworkspace_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/img/openworkspace_menu.png
--------------------------------------------------------------------------------
/public/assets/img/saveworkspace_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/img/saveworkspace_menu.png
--------------------------------------------------------------------------------
/public/assets/img/saveworkspace_notif.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/img/saveworkspace_notif.png
--------------------------------------------------------------------------------
/public/assets/rich-notifications/disk.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/rich-notifications/disk.png
--------------------------------------------------------------------------------
/public/assets/rich-notifications/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/rich-notifications/icon.png
--------------------------------------------------------------------------------
/public/assets/rich-notifications/image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/rich-notifications/image.png
--------------------------------------------------------------------------------
/public/assets/rich-notifications/text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/rich-notifications/text.png
--------------------------------------------------------------------------------
/public/assets/img/createdoc_add_expanded.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/img/createdoc_add_expanded.png
--------------------------------------------------------------------------------
/public/assets/img/openworkspace_dialogue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/img/openworkspace_dialogue.png
--------------------------------------------------------------------------------
/public/assets/img/saveworkspace_dialogue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/img/saveworkspace_dialogue.png
--------------------------------------------------------------------------------
/public/assets/img/addthread_select_button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/img/addthread_select_button.png
--------------------------------------------------------------------------------
/public/assets/img/addthread_select_channel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/img/addthread_select_channel.png
--------------------------------------------------------------------------------
/public/assets/img/createdoc_highlight_text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Arieg419/ElectronReactBoilerplate/HEAD/public/assets/img/createdoc_highlight_text.png
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import App from "./client/src/App";
4 |
5 | ReactDOM.render(, document.getElementById("root"));
6 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | charset = utf-8
9 | trim_trailing_whitespace = true
10 | insert_final_newline = true
11 |
12 | [*.md]
13 | trim_trailing_whitespace = true
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | node_modules
5 |
6 | # testing
7 | coverage
8 | dev-app-update.yml
9 |
10 | # production
11 | dist
12 | build
13 | release-builds
14 | assets
15 |
16 | # misc
17 | .DS_Store
18 | .env
19 | npm-debug.log
20 |
21 | .idea
22 |
23 | # inspiration
24 | inspiration
25 |
--------------------------------------------------------------------------------
/src/client/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # testing
7 | /coverage
8 |
9 | # production
10 | /build
11 |
12 | # misc
13 | .DS_Store
14 | .env.local
15 | .env.development.local
16 | .env.test.local
17 | .env.production.local
18 |
19 | npm-debug.log*
20 | yarn-debug.log*
21 | yarn-error.log*
22 |
--------------------------------------------------------------------------------
/public/assets/icons/seperator.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/separator-dark.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/next-dark.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/thread-add-dark.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/thread-add-light.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/next.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/save.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/save-dark.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/client/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 |
3 | class App extends Component {
4 | render() {
5 | return (
6 |
7 |
10 |
11 | To get started, edit src/App.js and save to reload.
12 |
13 |
14 | );
15 | }
16 | }
17 |
18 | export default App;
19 |
--------------------------------------------------------------------------------
/public/assets/icons/add-editor-dark.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/add-editor-light.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/delete-thread-dark.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/delete-thread-light.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/user.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/folder-dark.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/folder-light.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/public/assets/icons/email.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/username.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/image.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/image-dark.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/code.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/code-dark.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/circle-add-dark.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/circle-add-light.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/export.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/export-dark.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/maximize.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/full-screen-dark.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/public/assets/icons/lock.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/image-file-light.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["airbnb", "prettier", "prettier/react"],
3 | "plugins": ["prettier"],
4 | "rules": {
5 | "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
6 | "jsx-a11y/no-noninteractive-element-to-interactive-role": 0,
7 | "jsx-a11y/alt-text": 0,
8 | "jsx-a11y/no-static-element-interactions": 0,
9 | "jsx-a11y/img-has-alt": 0,
10 | "jsx-a11y/no-noninteractive-element-interactions": 0,
11 | "jsx-a11y/media-has-caption": 0,
12 | "jsx-a11y/interactive-supports-focus": 0,
13 | "jsx-a11y/no-noninteractive-tabindex": 0,
14 | "class-methods-use-this": 0,
15 | "react/forbid-prop-types": 0,
16 | "react/require-default-props": 0
17 | },
18 | "parserOptions": {
19 | "ecmaVersion": 2017,
20 | "sourceType": "module",
21 | "ecmaFeatures": {
22 | "jsx": true
23 | }
24 | },
25 | "env": {
26 | "es6": true,
27 | "browser": true,
28 | "node": true
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/public/assets/icons/embed-content-dark.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/embed-content-light.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/file-dark.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/code-editor.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/icons/text-file-light.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
18 | React App
19 |
20 |
21 |
22 |
23 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/public/img/logo.svg:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/public/assets/icons/code-block.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/auto-updater.js:
--------------------------------------------------------------------------------
1 | const { autoUpdater, dialog } = require("electron");
2 | const axios = require("axios");
3 | const semver = require("semver");
4 | const { version } = require("./package.json");
5 |
6 | const isMac = process.platform === "darwin";
7 | const updateURL = "http://localhost:8080" + (isMac ? "/mac.json" : "");
8 | // Check for flag passed to process. --dev is passed in the npm start script.
9 | const isDev = process.argv.some(str => str === "--dev");
10 |
11 | module.exports = {
12 | init
13 | };
14 |
15 | function logEvents() {
16 | // autoUpdater.on("checking-for-update", () => {
17 | // console.log("checking-for-update");
18 | // });
19 |
20 | autoUpdater.on("update-available", () => {
21 | console.log("update-available");
22 | });
23 |
24 | autoUpdater.on("update-not-available", () => {
25 | console.log("update-not-available");
26 | });
27 |
28 | autoUpdater.on("update-downloaded", () => {
29 | console.log("update-downloaded");
30 | });
31 |
32 | autoUpdater.on("error", () => {
33 | console.error("error");
34 | });
35 | }
36 |
37 | function promptUpdate() {
38 | dialog.showMessageBox(
39 | {
40 | type: "info",
41 | message: "Update Available",
42 | buttons: ["Update", "Close"],
43 | defaultId: 0
44 | },
45 | clickedIndex => {
46 | if (clickedIndex === 0) {
47 | // This will install and then restart the app automatically.
48 | // If the user dismisses this, the app will be auto-updated next time
49 | // they restart.
50 | autoUpdater.quitAndInstall();
51 | }
52 | }
53 | );
54 | }
55 |
56 | function checkForMacUpdate() {
57 | return axios
58 | .get(updateURL)
59 | .then(response => {
60 | // Must be a 200 response (204s = no update, technically) and
61 | // remote version must be greater than local, semver.gt === greater than
62 | return (
63 | response.status === 200 && semver.gt(response.data.version, version)
64 | );
65 | })
66 | .catch(console.error);
67 | }
68 |
69 | function checkForUpdate() {
70 | // Windows updates work right out of the box
71 | if (process.platform === "win32") {
72 | autoUpdater.checkForUpdates();
73 | } else {
74 | // For Mac, manually check if there's a version available to download. Because we're using
75 | // a simple file server for mac updates, not the HTTP 200 status = update, 204 = no update thing,
76 | // which requires some server side configuration.
77 | checkForMacUpdate().then(hasUpdate => {
78 | if (hasUpdate) {
79 | autoUpdater.checkForUpdates();
80 | }
81 | });
82 | }
83 | }
84 |
85 | function init() {
86 | // Can't run this in development because there's no code sign in dev.
87 | if (isDev) {
88 | return;
89 | }
90 |
91 | // Do some logging on each of the events
92 | logEvents();
93 |
94 | autoUpdater.on(
95 | "update-downloaded",
96 | (event, releaseNotes, releaseName, releaseDate, updateUrl) => {
97 | promptUpdate();
98 | }
99 | );
100 |
101 | autoUpdater.setFeedURL(updateURL); //this also "starts" the autoUpdater
102 | checkForUpdate();
103 | }
104 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "electronreactboilerplate",
3 | "author": "Omer Arie Goldberg",
4 | "version": "0.0.2",
5 | "description": "up and running with electron, react and auto updates",
6 | "repository": {
7 | "type": "git",
8 | "url": ""
9 | },
10 | "private": true,
11 | "devDependencies": {
12 | "concurrently": "^3.5.1",
13 | "devtron": "^1.4.0",
14 | "electron": "^1.7.10",
15 | "electron-builder": "19.53.7",
16 | "electron-devtools-installer": "^2.2.3",
17 | "electron-icon-maker": "0.0.4",
18 | "eslint": "^4.8.0",
19 | "eslint-config-airbnb": "^15.1.0",
20 | "eslint-config-prettier": "^2.6.0",
21 | "eslint-plugin-import": "^2.7.0",
22 | "eslint-plugin-jsx-a11y": "^4.0.0",
23 | "eslint-plugin-prettier": "^2.3.1",
24 | "eslint-plugin-react": "^7.4.0",
25 | "react-scripts": "0.8.5",
26 | "wait-on": "^2.0.2"
27 | },
28 | "dependencies": {
29 | "axios": "^0.17.1",
30 | "dotenv": "^4.0.0",
31 | "electron-context-menu": "^0.9.1",
32 | "electron-installer-dmg": "^0.1.2",
33 | "electron-is-dev": "^0.3.0",
34 | "electron-packager": "^8.7.0",
35 | "electron-reload": "^1.1.0",
36 | "electron-remote": "^1.2.0",
37 | "electron-squirrel-startup": "^1.0.0",
38 | "electron-updater": "^2.18.2",
39 | "electron-winstaller": "^2.4.1",
40 | "eslint": "^4.8.0",
41 | "jsonfile": "^4.0.0",
42 | "lodash": "^4.17.4",
43 | "moment": "^2.19.3",
44 | "prop-types": "^15.6.0",
45 | "react": "^15.4.2",
46 | "react-dom": "^15.4.2",
47 | "react-moment": "^0.6.8",
48 | "react-router": "^4.2.0",
49 | "react-router-dom": "^4.2.2",
50 | "semver": "^5.4.1",
51 | "uuid": "^3.1.0",
52 | "wait-on": "^2.0.2"
53 | },
54 | "homepage": "./",
55 | "main": "public/electron.js",
56 | "scripts": {
57 | "start": "react-scripts start",
58 | "build": "react-scripts build",
59 | "flow": "flow",
60 | "test": "react-scripts test --env=jsdom",
61 | "eject": "react-scripts eject",
62 | "electron-pack": "build --em.main=build/electron.js --mac --win -p always",
63 | "win-pack": "build --em.main=build/electron.js --win",
64 | "check-codesign":
65 | "codesign --verify --verbose --deep --strict dist/mac/Scribe.app",
66 | "preelectron-pack": "npm run build",
67 | "electron": "electron .",
68 | "electron-dev":
69 | "concurrently \"BROWSER=none yarn start\" \"wait-on http://localhost:3000 && electron . --dev\"",
70 | "dist": "npm run build && build",
71 | "pack": "build --dir",
72 | "postinstall": "install-app-deps"
73 | },
74 | "build": {
75 | "appId": "com.github.Arieg419.boilerplate",
76 | "files": ["build/**/*", "node_modules/**/*", "!build-scripts${/*}"],
77 | "forceCodeSigning": true,
78 | "directories": {
79 | "buildResources": "assets"
80 | },
81 | "mac": {
82 | "category": "your.app.category.type",
83 | "publish": {
84 | "provider": "github",
85 | "owner": "Arieg419"
86 | },
87 | "target": ["zip", "dmg"]
88 | },
89 | "win": {
90 | "publisherName": "Omer Goldberg",
91 | "certificateFile": "./build-scripts/win-cert.pfx",
92 | "certificatePassword": "",
93 | "target": [
94 | {
95 | "target": "nsis",
96 | "arch": ["x64", "ia32"]
97 | }
98 | ]
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/public/electron.js:
--------------------------------------------------------------------------------
1 | const electron = require("electron");
2 | const { app } = electron;
3 | const { autoUpdater } = require("electron-updater");
4 | const isDev = require("electron-is-dev");
5 | const path = require("path");
6 | require("dotenv").config();
7 |
8 | const BrowserWindow = electron.BrowserWindow;
9 | // const {
10 | // default: installExtension,
11 | // REACT_DEVELOPER_TOOLS
12 | // } = require("electron-devtools-installer");
13 |
14 | // Keep a global reference of the window object, if you don't, the window will
15 | // be closed automatically when the JavaScript object is garbage collected.
16 | let mainWindow;
17 |
18 | function createWindow() {
19 | // Check for software updates
20 | autoUpdater.checkForUpdates();
21 |
22 | // Create the browser window.
23 | mainWindow = new BrowserWindow({
24 | titleBarStyle: "hidden",
25 | width: 1281,
26 | height: 800,
27 | icon: path.join(__dirname, "../public/icons/png/64x64.png"),
28 | webPreferences: {
29 | webSecurity: false
30 | },
31 | show: false
32 | });
33 | mainWindow.loadURL(
34 | isDev
35 | ? "http://localhost:3000"
36 | : `file://${path.join(__dirname, "../build/index.html")}`
37 | );
38 | // mainWindow.webContents.openDevTools();
39 |
40 | // React DevTools
41 | // installExtension(REACT_DEVELOPER_TOOLS)
42 | // .then(name => console.log(`Added Extension: ${name}`))
43 | // .catch(err => console.log("An error occurred: ", err));
44 |
45 | mainWindow.once("ready-to-show", () => {
46 | mainWindow.show();
47 | });
48 |
49 | // Prompt users before window close
50 | // mainWindow.on("close", e => {
51 | // e.preventDefault();
52 | // });
53 |
54 | // Emitted when the window is closed.
55 | mainWindow.on("closed", () => {
56 | mainWindow = null;
57 | });
58 | }
59 |
60 | app.on("ready", createWindow);
61 |
62 | app.on("activate", () => {
63 | if (mainWindow === null) {
64 | createWindow();
65 | }
66 | });
67 |
68 | //-------------------------------------------------------------------
69 | // Auto updates
70 | //-------------------------------------------------------------------
71 | const sendStatusToWindow = text => {
72 | if (mainWindow) {
73 | mainWindow.webContents.send("auto-update", text);
74 | }
75 | };
76 |
77 | autoUpdater.on("checking-for-update", () => {
78 | sendStatusToWindow("Checking for update...");
79 | });
80 | autoUpdater.on("update-available", info => {
81 | sendStatusToWindow("Update available.");
82 | });
83 | autoUpdater.on("update-not-available", info => {
84 | sendStatusToWindow("Update not available.");
85 | });
86 | autoUpdater.on("error", err => {
87 | sendStatusToWindow(`Error in auto-updater: ${err.toString()}`);
88 | });
89 | autoUpdater.on("download-progress", progressObj => {
90 | sendStatusToWindow(
91 | `Download speed: ${progressObj.bytesPerSecond} - Downloaded ${
92 | progressObj.percent
93 | }% (${progressObj.transferred} + '/' + ${progressObj.total} + )`
94 | );
95 | });
96 | autoUpdater.on("update-downloaded", info => {
97 | sendStatusToWindow("Update downloaded; will install now");
98 | });
99 |
100 | autoUpdater.on("update-downloaded", info => {
101 | // Wait 5 seconds, then quit and install
102 | // In your application, you don't need to wait 500 ms.
103 | // You could call autoUpdater.quitAndInstall(); immediately
104 | autoUpdater.quitAndInstall();
105 | });
106 |
--------------------------------------------------------------------------------