Skip to content

Installation & Deployment

Paul Le edited this page Aug 12, 2019 · 7 revisions

Table of Contents

  1. Installation for Development

  2. Production Deployment

  3. Technology Stack

Installation for Development

  1. Download the repository

  2. Install npm modules: npm install

  3. Install bower dependencies bower install

  4. Start up the server: npm start

  5. View in browser at http://localhost:8080

Production Deployment

  1. From the working directory, build the production code: gulp build

  2. Change into the dist directory, and start the application: pm2 start bin/www --name PhysicsInMotion

Technology Stack

  • MongoDB
  • Node.js
  • Express.js
  • AngularJS
  • Pug
  • MathJax
  • Gulp

Server Setup

The Physics in Motion web application is hosted on a DigitalOcean Droplet server. The specifications and configurations for creating the current server as follows:

  1. Operating System: Ubuntu 18.04 x64
  2. System Specifications: Memory: 4 GB, vCPUs: 2 vCPUs, SSD Disk: 80 GB, Transfer: 4 TB, Price: $20 a month
  3. No backup or block storage added
  4. Datacenter Region: Toronto 1
  5. Additional Options: Private Networking, IPv6, and Monitoring are enabled

Initial server setup based on Digitalocean best practices for Ubuntu 18.04.

The web server is handled by nginx, with certificates from Let's Encrypt, and pm2 is used to deploy the Node.js application and ensure that the application is running on the server.

Mongodb

Set up using Digitalocean's tutorial.

Nodejs

Set up Node.js using Digitalocean's tutorial.

Nginx

Set up using Digitalocean's tutorial.

Pm2

Set up using Digitalocean's tutorial.

Let's Encrypt

Set up using a combination of Digitalocean's tutorial, as well as the official documentation.