Before you start, make sure you have a recent version of NodeJS environment >=8.0 with NPM 5.
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.
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):
-
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 setREMOTE_BACKEND
to true like so:REMOTE_BACKEND=true npm start
-
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 setPUBLIC_NETWORK
to true like so:PUBLIC_NETWORK=true npm start
-
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
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.
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
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.
To tag a version execute:
./scripts/tag.sh sitename version
To actually deploy execute:
./scripts/deploy.sh environment sitename
- 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 indev-assets
. See the Trusting Certificates section below.
If you are running in https mode you will want to trust the certificate located in dev-assets
.
To trust a certificate on windows:
-
Open up the start menu and open up the Run Application (search for
run
) -
Type
mmc
and click ok -
File > Add/Remove Snap In
-
Select
Certificates
and click Add > -
Select
Computer Account
thenLocal Computer
and click finish -
Click
Ok
to close theAdd or Remove Snap-ins
window. -
Double click
Certificates
and the right clickTrusted Root Certification Authorities
-
In the toolbar that comes up (from the right-click) select All Tasks > Import
-
Complete the Certificate Import Wizard using
dev-assets/server.cert
-
Your browser should now trust the certificate and you should no longer get the intermittent page reload.
-
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