Build application from the repository

For quick start of the applications with the use of the Github repository implement the following steps:

  1. Set up the system environment and global dependencies.
  2. Clone the core, module and application.
  3. Build and deploy the application.
  4. Run it.

Below is the detailed guide on how to build the application from the Github repository.

Detailed guide

System environment and global dependencies

The framework is launched in the Node.js runtime. Version 10.x.x.

To store the data, you need to install and run MongoDb of version later than 3.6.

To build all the components and libraries of the framework, you need to install the following components globally:

  • package node-gyp npm install -g node-gyp. For the Windows operating system, it is necessary to additionally install the windows-build-tools package npm install -g --production windows-build-tools.
  • Gulp <http://gulpjs.com/>`_installation package ``npm install -g gulp@4.0`. 4.0 is supported version of Gulp.
  • for versions 3.x.x and earlier of the IONDV. Framework the manager of the frontend libraries packages Bower is required``npm install -g bower``. It’s not required for versions 4.х.х and later .

Manual core, modules and application installation

Let’s take the develop-and-test application as an example. Find the application``develop-and-test`` in the repository. Check the dependencies specified in the file package.json.

 "engines": {
  "ion": "1.24.1"
},
"ionModulesDependencies": {
  "registry": "1.27.1",
  "geomap": "1.5.0",
  "graph": "1.3.2",
  "portal": "1.3.0",
  "report": "1.9.2",
  "ionadmin": "1.4.0",
  "dashboard": "1.1.0",
  "lk": "1.0.1",
  "soap": "1.1.2",
  "gantt-chart": "0.8.0"
},
"ionMetaDependencies": {
  "viewlib": "0.9.1"
  "viewlib-extra": "0.1.0"
  • First, install the core, which version is specified in the parameter "engines": {"ion": "1.24.1"}. Copy the core repository address and run the command git clone https://github.com/iondv/framework in the command prompt. Go to the core folder, switch to the tag of version number git checkout tags/v1.24.1. Since the compatibility is provided at the metadata level, and new versions were released due to the changes in the building technologie, you may use the latest version, for example 4.0.0.
  • After that the required modules, specified in the "ionModulesDependencies" parameter, are to be installed. The modules are installed to the modules folder of the core. To do that, go to the folder using the cd modules command. Clone the modules from the list "ionModulesDependencies". For the registry module use the command git clone https://github.com/iondv/registry. Go to the folder of the installed module, switch to the tag of the version number git checkout tags/v1.27.1. Repeate for each module. For the majority of applications, you can use the latest versions of modules compatible with the core.
  • The installation of the application is carried out in the applications folder. If you are in the modules folder, move to the folder using the command cd ..\applications. Install by cloning the repository using the command git clone https://github.com/iondv/dnt_ru.
  • Finally, install all necessary applications listed in the "ionMetaDependencies" parameter in the applications folder. Make sure that you’re inside this folder. Clone the dependencies in ionMetaDependencies. For the``viewlib``application execute the command``git clone https://github.com/iondv/viewlib``. Go to the folder of installed application and switch to the tag of the version number git checkout tags/0.9.1. Repeat for each application.

Build, configure and deploy the application

Build of the application provides installation of all dependent libraries, importing data into the database and preparing the application for launch.

Create the configuration file setup.ini in the config folder, where the framework was cloned to set the main parameters of the application environment.

auth.denyTop=false
auth.registration=false
db.uri=mongodb://127.0.0.1:27017/db
server.ports[]=8888
module.default=registry
fs.storageRoot=./files
fs.urlBase=/files

Open the file in the editor and paste the contents. The main parameter db.uri=mongodb://127.0.0.1:27017/ion-dnt specifies the name of the database which will be used for the application. The database will be created automatically.

Set the NODE_PATH environment variable to the path to the core of the application using command set NODE_PATH=c:\workspace\dnt``for Windows and ``export NODE_PATH=/workspace/dnt for Linux, where workspace\dnt is the folder with the cloned framework.

At the first launch, you need to run npm install. It will install the key dependencies, including the gulp task runner locally.

Next, execute the command to build the application gulp assemble.

If you want to implement the data import in your project, check the folder data in the application and execute the command: node bin/import-data --src ./applications/develop-and-test/data --ns develop-and-test

Add the admin user with the 123 password by executing the command node bin/adduser.js --name admin --pwd 123.

Add admin rights to the user executing the node bin/acl.js --u admin@local --role admin --p full command.

Start

Launch the application from the core folder using command npm start or node bin\www .

Open the link http://localhost:8888 in a browser and log in. 8888 is a port in the server.ports parameter of the launch configuration.