Technologies, Server requirement & Installation guide

version 1.0 of xModel - find the Software installation guide, Server setup guide, feature list, how it works, payment gateway setup etc.
adentio9
Site Admin
Posts: 30
Joined: Tue Aug 11, 2015 7:12 am

Technologies, Server requirement & Installation guide

Postby adentio9 » Mon Nov 06, 2017 12:13 pm

Technologies used :

Webrtc: peer to peer connection
Kurento server: convert webrtc to RTP protocol
NodeJS connecting webRTC and angular
Angular JS as frontend UI
Bootstrap as CSS frontend framework
Bitbucket for version control
MongoDB as database
Nginx RTMP for RTMP video protocol
Email SMTP with sendgrid, mailchimps…
Socket.io sharing live events, chat
Paypal, CCBill, Bitpay integration

Server requirement : ( On latest Ubuntu OS )

Install NodeJS >= 4.x.x ( https://nodejs.org/en/ )
Install MongoDB >= 3.2 and run service ( https://www.mongodb.com/download-center )
Install Redis >= 2.8 and run service ( https://redis.io/ )
Install and run kurento media server (check guide - http://doc-kurento.readthedocs.io/en/st ... guide.html ). Remember to set up TURN server for kurento as well (example coturn - https://github.com/coturn/coturn ) and run it in the background.
Install nginx RTMP - https://github.com/arut/nginx-rtmp-module
Install pm2 in global - https://github.com/Unitech/pm2
Install bower in the global by command npm install bower -g
Install gulp in the global by command npm install gulp -g

Installation guide :

Run npm install command
Run bower install command
Export environment by command export NODE_ENV=env (env is development or production)
Open server > config > environment (your environment).js file
Change base url, mongodb connection, redis, and mailer as image below


Run project under development mode

Cd to project folder
Run gulp serve
Browser will be opened for development env


Run project under production mode

Cd to project folder
Export NODE_ENV and config under production environment
Run command gulp build
Now you will see a new dist folder, look like this
Cd to dist folder
Run node server to start your project


Run project with nginx

Set up nginx
Install pm2 by command npm install pm2 -g
Cd to project folder
Run pm2 start server/index.js --name=your-app-name
Open nginx config file, usually it is /etc/nginx/sites-available/default
Within the server block you should have an existing location / block. Replace the contents of that block with the following configuration. If your application is set to listen on a different port, update the highlighted portion to the correct port number.

Code: Select all

. . .
           location / {
              proxy_pass http://localhost:8080;
         proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection 'upgrade';
      proxy_set_header Host $host;
      proxy_cache_bypass $http_upgrade;
           }
   }


Restart nginx sudo systemctl restart nginx

Open browser and test with nginx port you set (usually 80)

Migrate, set up default data
Cd to project folder
Run npm run migrate
System will generate default admin account (admin@example.com / admin)
Import default data
Check default data file
Use mongodb import tool ( https://docs.mongodb.com/manual/referen ... ngoimport/ ) to import default data to your database

Return to “xModel V1”

Who is online

Users browsing this forum: No registered users and 1 guest