# Setup your environment

# Prerequisites

# Install Node.js

Node (opens new window) is a server platform which runs JavaScript. It's lightweight and efficient. It has the largest ecosystem of open source libraries in the world.

WARNING

At the time of writing the KDK modules v2.x (master branch) are expected to work with Node.js 16.x and KDK modules v1.x are expected to work with Node.js 12.x

TIP

In order to be able to switch easily between different versions of Node.js we recommand to use a version manager like n (opens new window)/nvm (opens new window) under Linux/Mac or nvm (opens new window) under Windows.

# Install Git

git (opens new window) is the version control system most frequently used in open source. There are many resources available for installing it.

TIP

Under Windows we recommand using Tortoise Git (opens new window) and to set the autocrlf flag (opens new window) in settings.

# Install MongoDB

Mongo (opens new window) is an open-source, document database designed for ease of development and scaling.

WARNING

At the time of writing the KDK modules v2.x (master branch) are expected to work with MongoDB 4.x and KDK modules v1.x are expected to work with MongoDB 3.x

TIP

We recommand using Compass (opens new window) as a GUI for MongoDB, Robo 37 (opens new window) is also a good choice.

# Install Yarn

Due to some changes (opens new window) in the way npm manages linked modules we prefer to use Yarn (opens new window) as a package manager.

Install Yarn (opens new window) on your platform.

# Install Cordova ecosystem

Follow this tutorial (opens new window).

# Web app

While it is a WIP and not yet pushed to NPM, or when developing, please use the following process.

TIP

We recommand using our CLI but you can still proceed manually as explained below.

First clone all the modules/plugins you need and use yarn/npm link (opens new window) to make them globally available to your Node.js installation:

// Clone and link the plugins
git clone https://github.com/kalisio/kdk.git
cd kdk
yarn link
...

Then clone the main app repository and link to modules/plugins to make Node.js pointing to the previously cloned modules instead of those installed by yarn/npm, e.g. :

// Clone and link plugins to Kalisio app
git clone https://github.com/kalisio/kApp.git
cd kApp
// Client side
yarn link @kalisio/kdk
// API side
cd api
yarn link @kalisio/kdk
...

WARNING

Take care that a top-level module/plugin might depend on another module/plugin so you will have to link them together, for instance the kdk plugin depends on the weacast-core plugin.

# Cordova wrapper

Follow Quasar guide (opens new window).

Under Windows you might have somme issue creating a symbolic link. First you need to have administrator privileges in your shell. Then the easy way is to use the PowerShell Community Extensions (opens new window) and the New-SymLink dir link_target command. The environment variable PSModulePath needs to be updated to add the path to the extension (eg C:\Program Files (x86)\PowerShell Community Extensions\Pscx3\Pscx) and the command should be run as administrator or your user should have appropriate rights (opens new window).

If you have some issue about You have not accepted the license agreements of the following SDK components... you need to update first your installed SDKs through Android Studio > Configure > SDK Manager > Install. You might need to do it multiple times since the last version of a SDK only appear for download when previous version dependencies are installed.

To have a viable emulator install HAXM (opens new window).