Setting Up DoneJS
SettingUp
This page contains information on setting up DoneJS. It will walk you through getting prerequisites needed before you ever install DoneJS and includes platform-specific pieces of information not covered in the Quick Start or In Depth guides.
DoneJS officially supports:
Windows
Prerequisites
This will help you get set up with DoneJS on Windows. To use DoneJS you need a C++ compiler (for native dependencies). First you need a recent version of Node.js.
Node.js
To download Node.js visit https://nodejs.org. There will be two big green buttons for the two recommended downloads. Choose the one on the right, which says Current. This will give you the most recent version of Node.js.
Once downloaded, double-click the installer and go through the installation process. Once complete you should be able to open up a terminal and type:
Which should then print out the version of Node.js that is installed.
Package Management
In this guide we'll use chocolatey to install packages needed. You don't have to use chocolatey if you don't want, and can instead search for the dependencies and install them with a Windows installer, but we'll use chocolately because it makes things a bit easier.
After you've installed chocolatey by following the instructions on the homepage open an administrative console and proceed to the next step.
Python 2.x
Native dependencies in Node.js are installed with node-gyp which uses Python as a build tool. It expects Python 2.x:
Windows SDK
Next we need the Windows SDK. We're going to assume Windows 7, but adjust this command to the version of Windows you use (for Windows 10 it is windows-sdk-10.0):
Visual Studio Express
Installing Visual Studio Express gives us the C++ compiler we need. If you are using Windows 10 or get an error with this command you can also download Visual Studio Express here:
OpenSSL
If you plan on using Continuous Deployment with Travis CI, the OpenSSL software is needed to encrypt your CDN API key.
Environmental Variables
In order to switch to production mode you need to set the environmental variable
NODE_ENV
. Depending on which console you use this can be done in one of two ways:Command Prompt
Powershell
To later remove these environment variables:
Command Prompt
Powershell
Android Development
In order to develop an Android application you need to install the Android Studio. The installer will prompt you to also install Java if you don't already have it.
When you start Android Studio for the first time it will go through the installation of the SDK and related tools. If prompted select to install:
Once this is complete you should have everything you need for Android development. You can close Android Studio as you won't need it for DoneJS development.
macOS
Node.js
To download Node.js visit https://nodejs.org. There will be two big green buttons for the two recommended downloads. Choose the one on the right, which says Current. This will give you the most recent version of Node.js.
Once downloaded, double-click the installer and go through the installation process. Once complete you should be able to open up a terminal and type:
Which should then print out the version of Node.js that is installed.
Prerequisites
To get DoneJS working on macOS you need Xcode command line tools which you can get by typing:
And to build iOS apps, after installing Node, install the
ios-sim
package with:Debian / Ubuntu
Installing in a Debian / Ubuntu environment takes a little extra work because the version of Node shipped is older than what is supported by DoneJS (and most other Node-based software).
Prerequisites
Instead of installing Node.js from the repository we recommend using a PPA (a repository maintained by a 3rd party). First get a copy of
curl
if you don't already have it:Then add the PPA to your source list:
Install Node.js:
It's important to also install the
build-essential
package afterwards. This will provide you the C++ compiler needed to build the native dependencies:Android Development
In order to develop an Android application you need to install the Android Studio. Once download untar/gzip it:
This will create an
android-sdk-linux
folder. At this point you might want to move it somewhere else,$HOME/lib/android-sdk-linux
is a good place.Add the android-sdk-linux/tools folder to your
PATH
with:export PATH="path/to/android-sdk-linux/tools
. Add this to your~/.bashrc
or~/.zshrc
config so it will persist.Additionally the
ANDROID_HOME
environmental variable needs to be set. Set it with:This too should be added to your
~/.bashrc
or~/.zshrc
.Java
If you don't already have a Java JDK installed you can do so with:
Platform and Build Tools
Once you've installed Android Studio you still have a few things to do. You need to install the Android SDK Platform and Build tools. From the command-line run:
This starts the Android SDK Manager. From this screen you can select:
Click all of these and anything else you need and click Install packages.
Virtual Device Manager
From the command-line run:
This starts the Android Virtual Device (AVD) Manager. This is used to manager virtual devices that will run in the emulator.
Click Create and make sure to fill out:
Then click OK to create the device.
Close the AVD Manager and you should have everything you need for Android development.
Vagrant & VirtualBox
Prerequisites
First at all, download and install VirtualBox and Vagrant. Once VirtualBox and Vagrant have been installed, you should add the DoneJS box to your Vagrant installation.
Installing the DoneJS Vagrant Box
Open your command prompt and type
to see if Vagrant is available in your terminal.
Within your terminal change to the folder you would like to install the Vagrant Box. Using the following command for adding the box:
Vagrant will ask you for which provider you will adding the box. Choose: Virtualbox Vagrant will now downloading the latest version of the DoneJS development environment. It will take a few minutes, depending on your Internet connection speed.
Once Vagrant has successfully finished downloading all the file, you can now initialize the DoneJS Box by typing
Vagrant is creating a Vagrantfile in your folder. Your custom configuration for the machine can be done in this file. For more information check out https://www.vagrantup.com/docs/vagrantfile/
Configure your shared folders
Before you start the Vagrant Box, you have to specify which folder you would like to sync from your local machine to the virtual machine. For that, open the Vagrantfile in that folder you initialized Vagrant. Scroll down to:
add a new Synced Folder configuration below that may look like this
Make sure that
C:/www/donejs
is a valid directory.For more information check the documentation.
Launching the Vagrant Box
Once you have done all the configuration run
command from your DoneJS Vagrant Box directory
Connecting via SSH
To connect to your DoneJS environment via SSH, enter the
command in your terminal.
Further information
For further information about what is pre-installed on the Vagrant Box and which ports are forwarding to your host please check out the Github repository DoneJS Vagrant