Cannot wait to deploy the Townhall application? You can directly click below Deploy to Heroku button.
To deploy yourself, you can scroll down to Deployment section.
Once the application is deployed, you can access it using below information
- Presenter --
https://{url}/presenter - Participant --
https://{url}/participant - Moderator --
https://{url}/moderator
Replace the url with your deployed URL. If you are using Heroku to deploy, the url might looks like appname.herokuapp.com.
The townhall application is a reference code where you can easily deploy. This features.
- Multiple Presenter -- you can have multiple person presenting in the townhall
- Multiple Participant -- participant will be on
muteby default. Participant can only hear presenter and moderator - Single Moderator -- moderator has a full control of presenter and participant video and audio.
Before you deploy this application, make you have Vonage Video API account with API Key and Secret. Because we will explore how great Vonage Video API is.
You need to setup some environment variables
PORT-- this variable works only for manual deployment. Heroku deployment will automatically fill the value.API_KEY-- your Vonage Video API - API KeyAPI_SECRET-- your Vonage Video API - API SecretDATABASE_URL-- this variable works only for manual deployment. Heroku deployment will automatically fill the value.REACT_APP_ROOM_NAME-- your room name for your townhallREACT_APP_PRESENTER_PIN-- pin number for presenter to join inREACT_APP_MODERATOR_PIN-- pin number for moderator to join inREACT_APP_PARTICIPANT_PIN-- pin number for participant to join in
This townhall application contains backend and frontend. However, the backend needs a database to store session information. You need to install postgres for the database. Any other than postgres will not work.
- Backend -- we use
express - Frontend -- we use
ReactJS - Database -- we use
postgres
This section is for manual deployment. It means you need to have a
- Linux machine with
SSH. Make sure you canSSHto your machine. NodeJSinstalledyarnornpminstalledpostgresinstalled
Once you satisfy the requirements, you can proceed to below steps.
- Clone and navigate inside this repository.
- Rename
.env.exampleto.envand fill in the environment variable. - Build the package by typing
yarn buildif you are usingyarnornpm run buildif you are usingnpm - Start the server
yarn start:express:prodornpm run start:express:prod - Open your web browser. For example
http://localhost:5000
The local deployment has been done. You can use various technology such as ngrok or nginx to make it public. Furthermore, for this demo to run smoothly in public, you need https or SSL.
ngrok will automatically grant you SSL certificate. However, if nginx was choose as public deployment, you can use Let's Encrypt to get your free SSL certificate.