LiskHQ / lisk-desktop

πŸ–₯ Lisk graphical user interface for desktop
https://lisk.com/wallet
GNU General Public License v3.0
578 stars 96 forks source link
blockchain blockchain-wallet desktop electron javascript lisk ui

Logo

Lisk Desktop

Build Status Coverage Status License: GPL v3 GitHub package.json version DeepScan grade GitHub issues GitHub closed issues

Installation

You can download the latest release from Lisk.com. The link automatically detects your operating system and downloads the correct app. Currently we are supporting the following operating systems:

For Contributors

Please see CONTRIBUTING_GUIDE.md for more information.

Development

Using Commercial Fonts

Basier Circle and Gilroy used in the production version are commercial fonts. This repository only contains open fonts and uses Open Sans as a replacement for the commercial ones.

If you have licensed copies of Basier Circle and Gilroy, you can add them to fonts folder. If you don't have the fonts, you need to remove lines 25 - 81 of type.css. After that, the build and dev yarn scripts run without any errors.

Setup environment

The development environment currently depends on:

Note: For Windows users, make sure to set the correct msvs_version config for installing and packing the Lisk Desktop application.

git clone https://github.com/LiskHQ/lisk-desktop.git
cd lisk-desktop
nvm use
yarn --cwd app && yarn
yarn run dev

Open http://localhost:8080 to access the wallet.

Build

Production build

To build the project simply run

yarn run build

Under the hood, this script runs

yarn run build:prod

to build the React app under src/ and

yarn run build:electron

to build the electron app under app/ using webpack. You can run the above scripts individually if you're looking to see the changes solely on one of the two said applications.

Run Electron

If you have already built the application as described above, you can launch Electron using

yarn run start

Run with parameters

To launch a version which supports hardware wallets, you can run

yarn run dev:hw

or to launch electron and receive live updates from already running webpack-dev-server on port 8080 and you can run

LISK_DESKTOP_URL="http://localhost:8080" DEBUG=true yarn run start

This comes with Redux dev tools.

How to use the Ledger hardware wallet

Please see HARDWARE_WALLET_DEVELOPMENT.md for more information.

Distribution

Windows

Build package for Windows (on Windows in Git BASH).

yarn run pack:win

macOS

Build package for macOS (on macOs)

yarn run pack

Linux

Build package for Linux (on Linux).

yarn run pack

Testing

Unit tests

Single run

yarn run test

Run each time a file changes

yarn run test:live

Directory Layout

Note: The following layout structure may not appear exactly as shown below due to the legacy code/features. However, this is the layout that we try to follow:

β”œβ”€β”€ .husky/                        # Contains a pre commit hook which checks that files are prettified before committing.
β”œβ”€β”€ app/                           # Electron based application that launces the react app.
β”œβ”€β”€ build/                         # Build specific materials.
β”œβ”€β”€ coverage/                      # Results of Jest test coverage.
β”œβ”€β”€ dist/                          # Platform specific built outputs.
β”œβ”€β”€ docs/                          # Project documentation such as contribution guides and development guidelines.
β”œβ”€β”€ libs/                          # Modules which can be consumed individually in other projects.
β”‚   β”œβ”€β”€ hardwareWallet/            # HardwareWallet integrations.
β”‚   β”œβ”€β”€ wcm/                       # Wallet connect.
β”œβ”€β”€ node_modules/                  # 3rd-party libraries and utilities.
β”œβ”€β”€ setup/                         # The top most application layer, contains MainRouter and globally imported css files.
β”‚   β”œβ”€β”€ config/                    # Automation scripts (Webpack configurations, i18n scanner, etc.).
β”‚   β”œβ”€β”€ react/                     # React presentational components are located here.
β”‚   β”‚   β”œβ”€β”€ app/                   # The bootstrap React application.
β”‚   β”‚   β”œβ”€β”€ assets/                # Static files (images, fonts, etc.).
β”œβ”€β”€ src/                           # Application source code.
β”‚   β”œβ”€β”€ const/                     # Static configurations and other values used throughout the application.
β”‚   β”œβ”€β”€ locales/                   # Contains the built localization files.
β”‚   β”œβ”€β”€ modules/                   # Divided logic in domain specific areas, an example structure is shown below.
β”‚   β”‚   β”œβ”€β”€ hardwareWallet/        # Module/Domain.
β”‚   β”‚       β”œβ”€β”€ __fixtures__/      # Contains mock data for the hardwareWallet module.
β”‚   β”‚       β”œβ”€β”€ components/        # Components related to the hardwareWallet domain.
β”‚   β”‚       β”œβ”€β”€ hooks/             # Hooks related to the hardwareWallet domain.
β”‚   β”‚       β”œβ”€β”€ store/             # Redux encapsulated logic related to the hardwareWallet domain.
β”‚   β”‚           β”œβ”€β”€ actions/       # HardwareWallet actions.
β”‚   β”‚           β”œβ”€β”€ selectors/     # HardwareWallet selectors.
β”‚   β”‚           β”œβ”€β”€ reducers/      # HardwareWallet reducers.
β”‚   β”‚       β”œβ”€β”€ utils/             # Utils used in the hardwareWallet module. Global utils should be put in src/utils.
β”‚   β”œβ”€β”€ redux/                     # Contains the root reducer, all other reducers are imported here. It also has legacy pattern, selectors, and actions (these should now be encapsulated in its specific module).
β”‚   β”œβ”€β”€ routes/                    # Contains all routes in the application as well as modals.
β”‚   β”‚   β”œβ”€β”€ routes.js              # Route and modal paths with metadata. This object is used in all our links.
β”‚   β”‚   β”œβ”€β”€ routesMap.js           # Maps components to routes, this is used in the MainRouter.js.
β”‚   β”œβ”€β”€ service/                   # Add services, such as mock services.
β”‚   β”œβ”€β”€ theme/                     # Themed components (Button, Input, etc.).
β”‚   β”œβ”€β”€ utils/                     # Global utility functions used throughout the app.
        β”œβ”€β”€ i18n/                  # Localization setup.
└──e2e/                            # E2E tests written with Playwright and Cucumber; also some helpers used by unit tests that live in /src.

Contributors

See contributors section.

License

Copyright Β© 2016-2024 Lisk Foundation

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.