1
0
mirror of https://github.com/kremalicious/blowfish.git synced 2024-12-28 07:37:51 +01:00

project restructuring

This commit is contained in:
Matthias Kretschmann 2019-05-25 03:16:53 +02:00
parent 196c27f5e3
commit 04ae12fd39
Signed by: m
GPG Key ID: 606EEEF3C479A91F
35 changed files with 35 additions and 18 deletions

View File

@ -26,6 +26,7 @@
- [Features](#features) - [Features](#features)
- [Download](#download) - [Download](#download)
- [Development](#development) - [Development](#development)
- [Configuration](#configuration)
- [Build packages](#build-packages) - [Build packages](#build-packages)
- [License](#license) - [License](#license)
@ -39,9 +40,10 @@
- re-fetches everything automatically every minute - re-fetches everything automatically every minute
- balances are fetched via etherscan.io API - balances are fetched via etherscan.io API
- spot prices are fetched from coingecko.com API - spot prices are fetched from coingecko.com API
- detects system locale for number formatting
- detects dark appearance setting and switches to dark theme automatically (macOS only) - detects dark appearance setting and switches to dark theme automatically (macOS only)
- detects system accent color and uses it as primary color (macOS & Windows only) - detects system accent color and uses it as primary color (macOS & Windows only)
- Touch Bar support (macOS only)
- detects system locale for number formatting
- currently highly optimized for macOS, your mileage on Windows or Linux may vary - currently highly optimized for macOS, your mileage on Windows or Linux may vary
## Download ## Download
@ -57,6 +59,8 @@ Alternatively, you can [build the app on your system](#build-packages).
## Development ## Development
The main app is a React app in `src/renderer/` wrapped within an Electron app defined in `src/main/`.
Clone, and run: Clone, and run:
```bash ```bash
@ -70,6 +74,18 @@ npm install
npm start npm start
``` ```
## Configuration
The app has a settings screen where you can add your account addresses.
When building the app yourself, you can configure more in the `src/config.js` file:
| Key | Description |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `conversions` | Array defining the currencies the Ocean balance is converted to. Every currency listed here will appear in the ticker buttons. |
| `refreshInterval` | Defines the interval prices and balances are refetched. |
| `oceanTokenContract` | Contract address of the Ocean Token. You should not change this. |
## Build packages ## Build packages
```bash ```bash

View File

@ -3,7 +3,7 @@
"productName": "Blowfish", "productName": "Blowfish",
"version": "1.0.2", "version": "1.0.2",
"description": "🐡 Simple Electron-based desktop app to retrieve and display your total Ocean Token balances.", "description": "🐡 Simple Electron-based desktop app to retrieve and display your total Ocean Token balances.",
"main": "./src/main.js", "main": "./src/main/index.js",
"scripts": { "scripts": {
"test": "eslint ./src/**/*.{js,jsx} && stylelint ./src/**/*.css", "test": "eslint ./src/**/*.{js,jsx} && stylelint ./src/**/*.css",
"start": "webpack-dev-server --hot --host 0.0.0.0 --config=./webpack.dev.config.js", "start": "webpack-dev-server --hot --host 0.0.0.0 --config=./webpack.dev.config.js",
@ -21,13 +21,8 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@coingecko/cryptoformat": "^0.3.1", "@coingecko/cryptoformat": "^0.3.1",
"@reach/router": "^1.2.1",
"ethereum-address": "0.0.4", "ethereum-address": "0.0.4",
"ms": "^2.1.1", "ms": "^2.1.1"
"react": "^16.8.6",
"react-blockies": "^1.4.1",
"react-dom": "^16.8.6",
"react-pose": "^4.0.8"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.4.5", "@babel/core": "^7.4.5",
@ -36,6 +31,7 @@
"@babel/preset-env": "^7.4.5", "@babel/preset-env": "^7.4.5",
"@babel/preset-react": "^7.0.0", "@babel/preset-react": "^7.0.0",
"@babel/runtime": "^7.4.5", "@babel/runtime": "^7.4.5",
"@reach/router": "^1.2.1",
"@svgr/webpack": "^4.2.0", "@svgr/webpack": "^4.2.0",
"babel-eslint": "^10.0.1", "babel-eslint": "^10.0.1",
"babel-loader": "^8.0.6", "babel-loader": "^8.0.6",
@ -52,6 +48,10 @@
"html-webpack-plugin": "^3.2.0", "html-webpack-plugin": "^3.2.0",
"prettier": "^1.17.0", "prettier": "^1.17.0",
"prettier-stylelint": "^0.4.2", "prettier-stylelint": "^0.4.2",
"react": "^16.8.6",
"react-blockies": "^1.4.1",
"react-dom": "^16.8.6",
"react-pose": "^4.0.8",
"style-loader": "^0.23.1", "style-loader": "^0.23.1",
"stylelint": "^10.0.1", "stylelint": "^10.0.1",
"stylelint-config-standard": "^18.3.0", "stylelint-config-standard": "^18.3.0",
@ -64,6 +64,7 @@
"appId": "com.kremalicious.blowfish", "appId": "com.kremalicious.blowfish",
"files": [ "files": [
"./build/**/*", "./build/**/*",
"./src/main/**/*",
"./src/*.js", "./src/*.js",
"package.json" "package.json"
], ],

View File

@ -1,9 +1,9 @@
const path = require('path') const path = require('path')
const { app, BrowserWindow, systemPreferences, ipcMain } = require('electron') const { app, BrowserWindow, systemPreferences, ipcMain } = require('electron')
const pkg = require('../package.json') const pkg = require('../../package.json')
const buildMenu = require('./menu') const buildMenu = require('./menu')
const { buildTouchbar, updateTouchbar } = require('./touchbar') const { buildTouchbar, updateTouchbar } = require('./touchbar')
const { rgbaToHex } = require('./utils') const { rgbaToHex } = require('../utils')
let mainWindow let mainWindow
@ -44,7 +44,7 @@ const createWindow = async () => {
mainWindow.loadURL( mainWindow.loadURL(
isDev isDev
? 'http://localhost:8080' ? 'http://localhost:8080'
: `file://${path.join(__dirname, '../build/index.html')}` : `file://${path.join(__dirname, '../../build/index.html')}`
) )
createWindowEvents(mainWindow) createWindowEvents(mainWindow)

View File

@ -1,6 +1,6 @@
const { app, Menu } = require('electron') const { app, Menu } = require('electron')
const { openUrl } = require('./utils') const { openUrl } = require('../utils')
const { homepage } = require('../package.json') const { homepage } = require('../../package.json')
const buildMenu = mainWindow => { const buildMenu = mainWindow => {
const template = [ const template = [

View File

@ -1,6 +1,6 @@
const { TouchBar } = require('electron') const { TouchBar } = require('electron')
const { cryptoFormatter } = require('./utils') const { cryptoFormatter } = require('../utils')
const { conversions } = require('./config') const { conversions } = require('../config')
const { TouchBarButton } = TouchBar const { TouchBarButton } = TouchBar

View File

Before

Width:  |  Height:  |  Size: 871 B

After

Width:  |  Height:  |  Size: 871 B

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

Before

Width:  |  Height:  |  Size: 145 KiB

After

Width:  |  Height:  |  Size: 145 KiB

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -2,10 +2,10 @@ const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin')
const CopyPlugin = require('copy-webpack-plugin') const CopyPlugin = require('copy-webpack-plugin')
const defaultInclude = [path.resolve(__dirname, 'src')] const defaultInclude = [path.resolve(__dirname, 'src', 'renderer')]
module.exports = { module.exports = {
entry: path.resolve(__dirname, 'src', 'app', 'index.js'), entry: path.resolve(__dirname, 'src', 'renderer', 'index.js'),
output: { output: {
path: path.resolve(__dirname, 'build'), path: path.resolve(__dirname, 'build'),
filename: 'bundle.js', filename: 'bundle.js',
@ -42,7 +42,7 @@ module.exports = {
plugins: [ plugins: [
new HtmlWebpackPlugin(), new HtmlWebpackPlugin(),
new CopyPlugin([ new CopyPlugin([
{ from: './src/app/images/icon.*', to: './', flatten: true } { from: './src/renderer/images/icon.*', to: './', flatten: true }
]) ])
] ]
} }