Skip to content

Run from Source

Akram El Assas edited this page Jun 15, 2023 · 1 revision

Below are the instructions to run Wexstream from source code.

Prerequisites

Instructions

  1. Clone Wexstream repo:
git clone https://github.com/aelassas/wexstream.git
  1. Add api/.env file:
NODE_ENV = development
WS_PORT = 4003
WS_HTTPS = false
WS_PRIVATE_KEY = /etc/jitsi/meet/192.168.100.223.key
WS_CERTIFICATE = /etc/jitsi/meet/192.168.100.223.crt
WS_APP_HOST = localhost
WS_DB_HOST = 127.0.0.1
WS_DB_PORT = 27017
WS_DB_SSL = false
WS_DB_SSL_KEY = /etc/jitsi/meet/192.168.100.223.key
WS_DB_SSL_CERT = /etc/jitsi/meet/192.168.100.223.crt
WS_DB_SSL_CA = /etc/jitsi/meet/192.168.100.223.ca.pem
WS_DB_DEBUG = false
WS_DB_APP_NAME = wexstream
WS_DB_AUTH_SOURCE = admin
WS_DB_USERNAME = admin
WS_DB_PASSWORD = PASSWORD
WS_DB_NAME = wexstream
WS_JWT_SECRET = JWT_SECRET
WS_JWT_SUB = 192.168.100.223
WS_JWT_EXPIRE_AT = 86400
WS_TOKEN_EXPIRE_AT = 86400
WS_SMTP_HOST = host
WS_SMTP_PORT = 587
WS_SMTP_USER = USER
WS_SMTP_PASS = PASSWORD
WS_SMTP_FROM = no-reply@wexstream.com
WS_ADMIN_EMAIL = admin@wexstream.com
WS_DEFAULT_LANGUAGE = en
WS_CDN = /var/www/cdn/wexstream

You must configure the following options:

WS_DB_PASSWORD
WS_JWT_SECRET 
WS_JWT_SUB 
WS_SMTP_HOST 
WS_SMTP_PORT 
WS_SMTP_USER 
WS_SMTP_PASS 
WS_SMTP_FROM
WS_ADMIN_EMAIL 

WS_JWT_SECRET must be the same as the JWT secret used in Jitsi.

WS_JWT_SUB must be the FQDN or IP of the server where Jitsi is installed.

  1. Add frontend/.env file:
REACT_APP_NODE_ENV = development
REACT_APP_WS_DEFAULT_LANGUAGE = en
REACT_APP_WS_DATE_FORMAT = llll
REACT_APP_WS_PAGE_SIZE = 30
REACT_APP_WS_JITSI_HOST = 192.168.100.223:444
REACT_APP_WS_JITSI_API = https://192.168.100.223:444/external_api.js
REACT_APP_WS_API_HOST = http://localhost:4003
REACT_APP_WS_CDN = https://localhost/cdn/wexstream
REACT_APP_WS_GOOGLE_CLIENT_ID = GOOGLE_CLIENT_ID
REACT_APP_WS_FACEBOOK_APP_ID = FACEBOOK_APP_ID

REACT_APP_WS_GOOGLE_CLIENT_ID is used for Google authentication.

REACT_APP_WS_FACEBOOK_APP_ID is used for Facebook authentication.

You must configure the following options:

REACT_APP_WS_JITSI_HOST 
REACT_APP_WS_JITSI_API
REACT_APP_WS_GOOGLE_CLIENT_ID 
REACT_APP_WS_FACEBOOK_APP_ID 
  1. Install nodemon:
npm i -g nodemon
  1. Run api:
cd ./api
npm install
npm run dev
  1. Run frontend:
cd ./frontend
npm install
npm start
  1. Configure http://localhost/cdn
  • On Windows, install IIS and create C:\inetpub\wwwroot\cdn\wexstream folder.
  • On Linux, install NGINX and add cdn folder by changing /etc/nginx/sites-available/default as follows:
server {
    listen 80 default_server;
    server_name _;
    
    ...

    location /cdn {
      alias /var/www/cdn;
    }
}

Create /var/www/cdn/wexstream folder and add the necessary permissions:

mkdir /var/www/cdn/wexstream
sudo chown -R $USER:$USER /var/www/cdn/wexstream
Clone this wiki locally