Skip to content

Installation

Guillem Arias edited this page Jun 21, 2018 · 14 revisions

Setup and Installation

Nethloader consists of two parts:

  • A backend, which contains the core logic of the service and serves the API.
  • A frontend, which consumes the API to more easily manage the Nethloader instance.

Setting up the backend

Requirements:

  • npm or yarn (recommended)
  • ffmpeg
  • nodejs
  • A relational database

First of all, create a new file in server/config/MACHINENAME.machine.config.json, where you'll add the server config. Replace MACHINENAME by your machine hostname. Take config.js as the config model.

Config documentation

Then, inside the server/ folder, run the following scripts in order:

If you use Yarn

  • yarn - Install and update dependencies. (only necessary once)
  • yarn setup - Configure the server using the cli installer (only necessary once)
  • yarn start - Start the server

If you use NPM

  • npm install - Install and update dependencies. (only necessary once)
  • npm run setup - Configure the server using the cli installer (only necessary once)
  • npm run start - Start the server

If you want to use the frontend you'll need to setup a proxy in order to serve the backend from your web server. Example nginx proxy config.

Nethloader backend can also be setup as a systemd service, opening it automatically on system bootup and allowing easier management. Example systemd .service unit

Setting up the frontend

Requirements:

  • npm or yarn (recommended)
  • nodejs
  • A web server

Before building:

Copy and rename client/src/assets/config.default.js to client/src/assets/config.js and then adjust the settings as needed.

(optional) - Change the locale by copying the contents of your language file from client/src/assets/locales/COUNTRYCODE.js to client/src/assets/locale.js, overriding the existing content. COUNTRYCODE is your country code in the common ISO format.

(optional) - Tweak colors and other layout settings by editing client/src/assets/style-vars.scss.

Building:

Inside the client/ folder, run the following scripts in order:

If you use Yarn

  • yarn - Install and update dependencies. (only necessary once)
  • yarn build - Build Nethloader frontend to the client/dist folder.

If you use NPM

  • npm install - Install and update dependencies. (only necessary once)
  • npm run build - Build Nethloader frontend to the client/dist folder.

Now serve the contents of client/dist with your favourite web server (preferably nginx).