Skip to content
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from sentinel-official/development
Browse files Browse the repository at this point in the history
Release v0.2.0
  • Loading branch information
ironman0x7b2 authored Apr 6, 2020
2 parents 0828a55 + b1bb0b7 commit 3290473
Show file tree
Hide file tree
Showing 273 changed files with 26,525 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build/
/dist/
86 changes: 86 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"standard"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"react"
],
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"indent": [
2,
4
],
"arrow-parens": [
2,
"always"
],
"semi": [
2,
"always"
],
"comma-dangle": [
2,
"always-multiline"
],
"jsx-quotes": [
2
],
"dot-notation": [
2,
{
"allowPattern": "^[0-9A-Za-z]+(_[0-9A-Za-z]+)+$"
}
],
"curly": [
2,
"all"
],
"react/jsx-first-prop-new-line": [
2,
"multiline-multiprop"
],
"react/jsx-indent-props": [
2,
"first"
],
"react/sort-prop-types": [
2,
{
"callbacksLast": true,
"requiredFirst": true
}
],
"react/jsx-sort-props": [
2,
{
"callbacksLast": true,
"reservedFirst": true,
"shorthandFirst": true
}
]
}
}
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build
/dist
/bin

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
4 changes: 4 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const builder = require('electron-builder');

builder.build({
targets: builder.Platform.current().createTarget(),
config: {
productName: 'Sentinel Desktop',
compression: process.env.NODE_ENV === 'production' ? 'maximum' : 'store',
extraResources: [
'bin/manager',
],
linux: {
category: 'Utility',
executableName: 'sentinel-desktop',
icon: 'build/electron/',
target: process.env.NODE_ENV === 'production' ? [
'AppImage',
'deb',
] : [
'dir',
],
},
mac: {
category: 'public.app-category.utilities',
icon: 'build/electron/icon.icns',
},
win: {
icon: 'build/electron/icon.ico',
},
},
}).then(() => {
console.log('Build OK!');
}).catch(console.error);
63 changes: 63 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"name": "sentinel-desktop",
"version": "0.2.0",
"description": "Sentinel Desktop Client",
"author": {
"name": "Sentinel Development Team",
"email": "[email protected]",
"url": "https://sentinel.co"
},
"license": "MIT",
"private": false,
"homepage": ".",
"main": "public/electron.js",
"scripts": {
"build": "react-scripts build",
"build:app": "GENERATE_SOURCEMAP=false react-scripts build && NODE_ENV=production node build.js",
"build:app:development": "react-scripts build && NODE_ENV=development node build.js",
"start:app": "react-scripts build && electron .",
"start:app:development": "NODE_ENV=development electron .",
"start:server": "BROWSER=none HTTPS=true react-scripts start"
},
"devDependencies": {
"@material-ui/core": "^4.9.9",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.48",
"axios": "^0.19.2",
"bech32": "^1.1.3",
"classnames": "^2.2.6",
"electron": "^8.2.0",
"electron-builder": "^22.4.1",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-standard": "^4.0.1",
"moment": "^2.24.0",
"prop-types": "^15.7.2",
"qrcode.react": "^1.0.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-redux": "^7.2.0",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-scripts": "^3.4.1",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
"redux-thunk": "^2.3.0"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Binary file added public/assets/logos/sentinel_192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/logos/sentinel_512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions public/electron.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
const { app, BrowserWindow, Menu } = require('electron');
const path = require('path');
const menu = require('./electron/menu');
const { spawn } = require('child_process');

const iconPath = path.join(__dirname, 'electron/icon.png');

let mainWindow = null;
let manager = null;

Menu.setApplicationMenu(menu);

const createWindow = () => {
mainWindow = new BrowserWindow({
title: 'Sentinel',
height: 720,
width: 1280,
minHeight: 720,
minWidth: 1280,
webPreferences: {
nodeIntegration: true,
devTools: true,
},
icon: iconPath,
});

mainWindow.loadFile('build/index.html').then();

mainWindow.on('closed', () => {
mainWindow = null;
});
};

app.on('ready', () => {
const bin = path.resolve(__dirname, '../../bin/manager');

manager = spawn(bin, { detached: true });
manager.stdout.on('data', (data) => {
if (data.toString() === '..') {
createWindow();
}
});
});
app.on('window-all-closed', () => {
manager.kill();
app.quit();
});
app.on('activate', () => {
if (mainWindow === null) {
createWindow();
}
});

app.commandLine.appendSwitch('ignore-certificate-errors', 'true');
Binary file added public/electron/icon.icns
Binary file not shown.
Binary file added public/electron/icon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions public/electron/icon.png
31 changes: 31 additions & 0 deletions public/electron/menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const { Menu } = require('electron');

const template = [{
label: 'View',
submenu: [{
role: 'reload',
}, {
role: 'toggleDevTools',
}, {
type: 'separator',
}, {
role: 'resetZoom',
}, {
role: 'zoomIn',
}, {
role: 'zoomOut',
}, {
type: 'separator',
}, {
role: 'toggleFullScreen',
}],
}, {
role: 'Window',
submenu: [{
role: 'minimize',
}, {
role: 'close',
}],
}];

module.exports = Menu.buildFromTemplate(template);
Binary file added public/favicon.ico
Binary file not shown.
21 changes: 21 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<meta content="#000000" name="theme-color"/>
<meta content="Sentinel Desktop Client" name="description"/>
<link href="./manifest.json" rel="manifest"/>
<link href="./favicon.ico" rel="icon"/>
<link href="./assets/logos/sentinel_192x192.png" rel="apple-touch-icon"/>
<link href="https://fonts.googleapis.com/css?family=Overpass:100,100i,200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i&display=swap"
rel="stylesheet">
<title>Sentinel</title>
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>

</html>
Loading

0 comments on commit 3290473

Please sign in to comment.