Skip to content

openbnet/portal

 
 

Repository files navigation

lupoex-client

Getting started

Before you start, make sure you have a recent version of NodeJS environment >=8.0 with NPM 5.

Installing the dependencies

From the project folder, execute the following commands:

git checkout develop

unless you want to run master.

npm install

This will install all required dependencies, including a local version of Webpack that is going to build and bundle the app. There is no need to install Webpack globally.

Additionally, if you have github access to the tradingview charting_library (which this repo uses) you can run:

git submodule update --init assets/charting_library

This will clone the tradingview charting_library dependency as a git submodule. Don't worry, most people do not have access to this repo (unless you are internal to lupoex). You can still run the app locally without it.

Running the app

The basic command to run the app locally is:

npm start

This command starts the webpack development server that serves the build bundles. You can now browse the skeleton app at https://localhost:8080 (or the next available port, notice the output of the command). Changes in the code will automatically build and reload the app.

If you are getting node-sass errors on startup, see the Troubleshooting section.

Below are some environment variables that can be set (and in some cases must be set):

Environment Variables

  1. REMOTE_BACKEND If you are not internal to lupoex, then you will not have access to a couple of things that are necessary for the functioning of the app, (the lupoex API as well as the tradingview charting_library both of which are not open source as of this time). In order to run the app locally, you will need to set REMOTE_BACKEND to true like so:

    REMOTE_BACKEND=true npm start
  2. PUBLIC_NETWORK You can run the app against the public or test stellar networks. By default, the app will run against the test network. If you would like to run the application against the the public network, you must set PUBLIC_NETWORK to true like so:

    PUBLIC_NETWORK=true npm start
  3. USE_HTTPS By default, the app will in regular http, however with this flag you can run the app in https like so:

    USE_HTTPS=true npm start

    Is your application auto reloading (loop-wise) on start? If so, see the Troubleshooting section...

Both environment variables can be run in one command:

REMOTE_BACKEND=true PUBLIC_NETWORK=true USE_HTTPS=true npm start

Running with Hot Module Reload

If you wish to try out the experimental Hot Module Reload, you may run your application with the following command:

npm start -- webpack.server.hmr

Of course, PUBLIC_NETWORK and REMOTE_BACKEND can be used in this mode as well.

Updating your project

To update your project to the latest execute the following commands:

git pull
npm run deps

The above command (npm run deps) should also be run after switching between branches that have different dependencies

Bundling

To build an optimized, minified production bundle (output to /dist) execute:

npm start -- build

To build

To test either the development or production build execute:

npm start -- serve

The production bundle includes all files that are required for deployment.

Deploying

To tag a version execute:

./scripts/tag.sh sitename version

To actually deploy execute:

./scripts/deploy.sh environment sitename

Troubleshooting

  1. Why is my application reloading itself again and again in development mode? Are you running with USE_HTTPS=true enabled? If so, you need to trust the security certificate located in dev-assets. See the Trusting Certificates section below.

  2. Why am I getting node-sass errors on startup? Sometimes node-sass needs to be rebuilt for a particular operating system. To fix, run:

npm rebuild node-sass

Trusting Certificates

If you are running in https mode you will want to trust the certificate located in dev-assets.

To trust a certificate on windows:

  1. Open up the start menu and open up the Run Application (search for run)
  2. Type mmc and click ok
  3. File > Add/Remove Snap In
  4. Select Certificates and click Add >
  5. Select Computer Account then Local Computer and click finish
  6. Click Ok to close the Add or Remove Snap-ins window.
  7. Double click Certificates and the right click Trusted Root Certification Authorities
  8. In the toolbar that comes up (from the right-click) select All Tasks > Import
  9. Complete the Certificate Import Wizard using dev-assets/server.cert
  10. Your browser should now trust the certificate and you should no longer get the intermittent page reload.

About

Open Source Stellar Trading Client.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 65.3%
  • HTML 22.4%
  • CSS 12.2%
  • Shell 0.1%