---
# System prepended metadata

title: Setup ESS2 to Production

---

---
title: 'Setup ESS2 to Production'
---

Setup ESS2 to Production
===

## Pre-build Setup for Front-end

1. Go to `/frontend/src/environments/environment.prod.ts`
2. Edit `erp_link`, `backend_url`, `ws_url`. Usually, `ws_url` is always the same with `backend_url`.

## Build Front-end

1. Go to `/frontend`
2. Open CMD. Execute `ng build --prod`
3. Go to `/frontend` again. Copy all files on `/dist`
> `/dist` is the location of Front-end Distributable


## Back-end Setup

### Setup

Install the required node modules. Go to `/backend`. Open CMD with Administrator Rights.

1. Execute this command respectively.
    - `npm i -g node-gyp`
    - `npm i -g --production windows-build-tools`
    - `npm i java`
    - `npm install`

2. Setup Schema
    - Install ALL the SQL script on your database on `\schema`.

## Setup Backend as a Service

 - Go to `/backend`
 - run this command:
    `npm i -g node-windows`

 - Go to project root directory and run:
    `npm link node-windows`

 - Open CMD go to `\backend` and execute this command:
    `node install_service.js`