- Notifications
You must be signed in to change notification settings - Fork0
Next generation version of Blockchain Wallet built with React & Redux
License
qmutz/blockchain-wallet-v4-frontend
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Be Your Own Bank atlogin.blockchain.com.Pleasecontact support if you have any issues using the wallet.
This repo contains the three codebases/packages listed below.
- blockchain-info-components The shared UI components library.
- blockchain-wallet-v4 The functional library for handling wallets.
- blockchain-wallet-v4-frontend The frontend application built with React/Redux.
- Ensure Node version >= 10.2 is installed.
- From the project root, run the following command to install dependencies:
./setup.sh. - Start the application in development mode:
yarn start - The frontend application will now be accessible via browser at
localhost:8080
If you require the application to run locally over HTTPS, follow the instructionshere.You can disable SSL by setting theDISABLE_SSL env param totrue with any start command. (e.g.DISABLE_SSL=true yarn start:staging)
To ensure proper support for Windows, please take the following actions before running the above setup instructions.
- Open a Powershell window with rights elevated to an Administrator.
- Run
npm install -g windows-build-tools. This will install Python 2.7 and Visual C++ Build Tools which are required to compile some native Node modules. - Ensure Python has been added to your environment variables by opening a cmd prompt and typing
python. If you get aCommandNotFoundExceptionmessage, add the folder%USERPROFILE%\.windows-build-tools\python27to your environment variables.
- To completely remove all dependencies and artifacts run
yarn clean - To add/remove an NPM package run
yarn addoryarn removein the package folder. After installing or uninstalling a NPM package, runyarnin the root folder to re-init the project - All development specific dependencies should be installed as a
dev-dependencyin the top levelpackage.jsonviayarn i --save-dev [package-name] - All application specific dependencies should be installed in the specific packages
package.jsonviayarn i --save [package-name]
The frontend application can be ran locally with different build configurations found inconfig/env. The following commands are available:
yarn startRuns the application with thedevelopment.jsconfiguration fileyarn start:devRuns the application with thedevelopment.jsconfiguration fileyarn start:stagingRuns the application with thestaging.jsconfiguration fileyarn start:testnetRuns the application with thetestnet.jsconfiguration fileyarn start:prodRuns the application with theproduction.jsconfiguration fileyarn run:prodRuns the application mimicking the production environment entirely (i.e. code is bundled and minified, HMR is disabled,Express server is used (./server.js) and theproduction.jsconfiguration file is loaded)
Notes:
- Developers will need to manually create the
development.jsandstaging.jsfiles - Custom application runtimes are possible by modifying the corresponding environment files found in the
config/envfolder
- React Developer Tools Inspect the React component tree
- Redux DevTools View/debug Redux state changes
We follow the rules outlined by theJavascript Standard Style as well as a few React specific rules.
Code linting is handled byESLint. The following commands are available:
yarn lintLints all packagesyarn lint:componentsLints onlyblockchain-info-componentsyarn lint:coreLints onlyblockchain-wallet-v4yarn lint:frontendLints onlyblockchain-wallet-v4-frontendyarn lint:fixAutomatically resolves fixable issues via ESLint
These IDE plugins/packages assist with complying with these lint rules while developing:
We follow all standard rules that are provided by Prettier. The following commands are available:
yarn prettierRuns Prettier against all packagesyarn prettier:componentsRuns Prettier against onlyblockchain-info-componentsyarn prettier:coreRuns Prettier against onlyblockchain-wallet-v4yarn prettier:frontendRuns Prettier against onlyblockchain-wallet-v4-frontend
It is recommended to setup a Prettier plugin for your IDE plugins/packages that will automatically prettify your files on save.
Testing is done viaJest andEnzyme.
yarn testRuns unit tests for all packagesyarn test:componentsRuns unit tests for onlyblockchain-info-componentsyarn test:coreRuns unit tests for onlyblockchain-wallet-v4yarn test:frontendRuns unit tests for onlyblockchain-wallet-v4-frontend
Note: if you see errors that Jest cannot resolve package imports, you may need to runyarn test before testing specific packages (eg,yarn test:frontend)
yarn test:watchWatches and then runs desired testsyarn test:components:watchWatches and then runs desired tests for onlyblockchain-info-componentsyarn test:core:watchWatches and then runs desired tests for onlyblockchain-wallet-v4yarn test:frontend:watchWatches and then runs desired tests for onlyblockchain-wallet-v4-frontend
To enable debugging for unit tests via the Chrome browser, run the following commands:
yarn test:components:debugDebugs unit tests for onlyblockchain-info-componentsyarn test:core:debugDebugs unit tests for onlyblockchain-wallet-v4yarn test:frontend:debugDebugs unit tests for onlyblockchain-wallet-v4-frontend
After running one of the above commands, Node will wait for a debugger to attach before starting the tests.To attach, simply open your browser and go tochrome://inspect and click on "Open Dedicated DevTools for Node",which will give you a list of available node instances you can connect to. Click on the address displayed in the terminal(usually localhost:9229) and you will be able to debug tests using Chrome's DevTools.
We are snapshot testing UI some components. Here are the commands to update them when necessary:
yarn test:components:updateUpdates component snapshots for onlyblockchain-info-componentsyarn test:frontend:updateUpdates component snapshots for onlyblockchain-wallet-v4-frontend
To generate code coverage reports viaIstanbul, the following commands are available:
yarn coverageGenerates a coverage report for all packagesyarn coverage:componentsGenerates coverage report for onlyblockchain-info-componentsyarn coverage:coreGenerates coverage report for onlyblockchain-wallet-v4yarn coverage:frontendGenerates coverage report for onlyblockchain-wallet-v4-frontend
Depending upon which coverage report was ran, the results can be found in the following directories:
coverage/index.htmlcoverage/blockchain-info-components/index.htmlcoverage/blockchain-wallet-v4/index.htmlcoverage/blockchain-wallet-v4-frontend/index.htmlSimply open theindex.htmlfile in your browser to view.
To visualize and interact with the tree of the production code bundles files:
yarn analyzeOnce completed, a browser will automatically open with the results.
Storybook is used by theblockchain-info-components package to interactively view, develop and test components.The following commands are available:
storybook:build: Builds the static storybook assetsstorybook:serveBuilds storybook assets and then serves them locally atlocalhost:6006storybook:deployBuilds storybook assets and then serves them togithub pages.You will probably need to runcd ./packages/blockchain-info-components && git remote add origin git@github.com:blockchain/blockchain-wallet-v4-frontend.gitfirst.
If the deploy begins to fail, deleting the static build file before redeploy will likely help.
Bug fixes and feedback on our code is always appreciated.
Security issues can be reported to us in the following venues:
- Email:security@blockchain.info
- Bug Bounty:https://hackerone.com/blockchain
About
Next generation version of Blockchain Wallet built with React & Redux
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Languages
- JavaScript99.9%
- Other0.1%