Deploying Code-Lordz Compiler Webapp in a local server

Satheesh Kumar
3 min readOct 31, 2017

--

Home Page

This post will give you a brief description on how to deploy and run Code-Lordz code compiler in a local machine [Ubuntu 16.04 LTS].

1. Installing Nodejs

Node.js is a JavaScript platform for general-purpose programming that allows users to build network applications quickly. By leveraging JavaScript on both the front-end and the back-end, development can be more consistent and be designed within the same system.

In this guide, we’ll show you how to get started with Node.js on an Ubuntu 16.04 server.

Prerequisites:

This guide assumes that you are using Ubuntu 16.04. Before you begin, you should have a non-root user account with Sudo privileges set up on your system.

Stable version for ubuntu:

Ubuntu 16.04 contains a version of Node.js in its default repositories that can be used to easily provide a consistent experience across multiple systems. At the time of writing, the version in the repositories is v4.2.6. This will not be the latest version, but it should be quite stable and should be sufficient for quick experimentation with the language.

In order to get this version, we just have to use the apt package manager. We should refresh our local package index first, and then install from the repositories:

sudo apt-get updatesudo apt-get install nodejs  

If the package in the repositories suits your needs, this is all that you need to do to get set up with Node.js. In most cases, you'll also want to also install npm, which is the Node.js package manager. You can do this by typing:

sudo apt-get install npm 

This will allow you to easily install modules and packages to use with Node.js.

Because of a conflict with another package, the executable from the Ubuntu repositories is called nodejs instead of node. Keep this in mind as you are running software. There are many alternative ways that can be found in https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04 .

2. Installing Git

An indispensable tool in modern software development is some kind of version control system. Version control systems allow you to keep track of your software at the source level. You can track changes, revert to previous stages, and the branch to create alternate versions of files and directories.

One of the most popular version control systems is git, a distributed version control system. Many projects maintain their files in a git repository, and sites like GitHub and Bitbucket have made sharing and contributing to code simple and valuable.

In this guide, we will demonstrate how to install and configure git on an Ubuntu 16.04 system.

How To Install Git with Apt:

By far the easiest way of getting it installed and ready to use is by using Ubuntu's default repositories. This is the fastest method, but the version may be older than the newest version. If you need the latest release, consider following the steps to compile git from the source.

You can use the apt package management tools to update your local package index. Afterward, you can download and install the program:

sudo apt-get updatesudo apt-get install git 

This will download and install git to your system.

3. Deploying the server:

You can clone or download the server files from the Github repository.

git clone https://github.com/satheesh1997/node-codecompiler-ide

This will create a directory named as node-codecompiler-ide in the current folder. Run these commands to start the server.

cd node-codecompiler-ide/src
npm start

Since the server uses MongoDB to store the data it requires mongo running on its default port 27017. Else this will give rise to error.

If mongo is present in your system the server will be running smoothly. To install mongo in your system follow this tutorial https://www.howtoforge.com/tutorial/install-mongodb-on-ubuntu-16.04/

Conclusion:

Using this steps Code compiler can be installed on your system. If you have any queries feel free to ask here.

Update:

Recently I have dockerized the entire application, you can follow the steps from DockerHub to run the application.

--

--