Deployment - Pjiwm/circle-project GitHub Wiki

To deploy the full application the following steps are required:

Deploying TruYou

TruYou is the web app used to watch streams on. The web app can be deployed to a host of choice, however the code contains a configuration to deploy the web app to Firebase.

Deploying the Web server with Node Media Server

Both the node media server and the web server (backend) need to run on their own port. Ideally port 3000 and 3001. These port for the web server can be changed with the environment variable PORT. The web server requires connection to mongoDB. To specify the connection url set the environment variable for MONGO_DB_CONNECTION to the database url. Deploy the two components together to a server.

Publishing the Android app

The android application can simply be published by opening the code in android studio and following the publishing steps.

Relations of each component

Below you can see the relatiions of each component. On the left you can see the user receiving the web app from the circle server. (Firebase or any other host) The user can now watch livestreams. On the Web App you can communicate in 2 different ways.

  1. Http Requests to the backend. The backend will mainly let you request chat messages. The backend will also give you stream links from the media server.
  2. Via HLS watching streams via the media server. The Node Media server stores and lets you receive streams.

The Web server itself also communicates with other components. For chatting it communicates with the android app, as a transparent person (streamer) can also send chat messages. The paragraph above already explained how the web server communicates with the web app. For persisting data the web server communicates with the Mongo Database. The web server also communicates with the Node Media server. These two components are already close together as they can run together on the same physical server. They communicate mainly for distributing streaming urls.

When a transparent person livestreams via the android app it will send over the stream via RTMP to the Node Media server. Chatting goes via the previously mentioned web server.

Keys for each component

For each application keys are needed. Key pairs are generated on the web server and the private keys are physically given to TruYou users and transparents persons. The key pair of the web server is hard-coded in keys.ts.