ll is to run npm install from your terminal.
npm will automatically read the package.json file and install everything it requires. Generally you only need to do this once, but if new dependencies are added you will need to re-run npm install.
6.2.2 General Configuration
RiPPLE client side will read its configuration from what is called an environment variable. These variables are injected into the application at runtime by replacing all instances of process.env.* with the name of predefined variable. These predefined variables are things such as debug mode and where to look for the API. Since environment variables can sometimes be sensitive (such as database passwords), it is best practice to keep them out of source control.
RiPPLE reads its environment variables from environment files, which are named .env.dev, and .env.prod for development and production respectively. In a fresh install, the .env.dev and .env.prod files will not exist (since they are not in source control). Instead, a .env.example file is provided which has all of the possible environment variable names, and example values for them.
If you make your own .env.dev or .env.prod files, you can place whatever you like in it, and your git client will automatically ignore anything inside of it. Supported environment values include the following:
API_LOCATION - string: A URI which points to the RiPPLE Server. Should not have a trailing ’/’.
Node_ENV - string: A string indicating the development environment as PRODUCTION or DEVELOPMENT.
6.2.3 Development Configuration
Typically, a RiPPLE client in development mode will connect to a Development RiPPLE Server (See Section 7). By default, this will be http://localhost:9000. You will need to initialize your .env.dev environment file to development values. Once your environment file has been created and your [dependencies installed ]RiPPLE-Client—Environment) you will be able to build and test your application. The key command for active development is npm run dev, which builds your application and opens it in your browser.
This project comes packaged with several convenience commands
npm run dev: Creates a local development server, and serves your files over it. When a local file is changed your project will be rebuilt incrementally and the new code injected into your web browser.
npm run unit: Runs all unit tests for the project. They are located under ./test/unit/spec/
npm run e2e: Runs all integration tests for the project. They are located under ./test/e2e/spec/. The current webdriver used is PhantomJS (runs headlessly). It is installed locally as part of npm install.
npm run test: Runs all unit tests and e2e tests. It is the same as running both npm run unit and npm run e2e.
Helpful Development Tools
The Chrome Console666https://developers.google.com/web/tools/chrome-devtools/console/ allows you to inspect your application at runtime. All errors will also be reported to this console which allows for easy issue identification. The console also has a debugger, which is very useful for inspecting code to make sure it behaves correctly. The Vue Devtools777https://github.com/vuejs/vue-devtools allows inspection of Vue components.
6.2.4 Production Configuration
Typically, a RiPPLE client in production mode will connect to a Production RiPPLE Server, which needs to be manually configured. You will need to initialize your .env.prod environment file to production values. An example environment file is provided in the repository, but the defaults are not suitable for a production application. Once your environment file has been created and your dependencies installed you will be able to build your application. The key commands for building is npm run test and then npm run build, which builds your application and places it into the dist directory. This directory is on the .gitignore, so any changes to it will not be committed to the project.
Once you have built your application, you will need to serve it via an actual webserver. This is most commonly done by placing it into /var/www/htdocs/ of a machine configured to run