This is a demo application built in Ruby using Ruby on Rails and the Vonage Ruby SDK to demonstrate the basic functionality of the Vonage Video API.
To run this demo locally you will need:
- A Vonage Developer account
- Ruby installed
- Ngrok installed
You'll need to set up a Vonage application to manage the capabilities and obtain the API credentials for this app.
-
Log onto the Vonage Developer Dashboard
-
Go to the Applications page and click on the 'Create a new application' button
-
Generate a private key for the application by clicking on the 'Generate public and private key' button. Download the
private.key
file and keep it somewhere safe. -
Under 'Capabilities', enable the application for Video by toggling the switch to 'on'.
-
Click on the 'Generate new application' button at the bottom. This will generate and Application ID for the Vonage application; make a note of this or copy it to your clipboard for later.
-
Open Terminal and navigate to wherever you want to clone the repository.
-
Clone the repository
git clone https://github.com/Vonage-Community/demo-video-ruby_on_rails-basic_video_call.git
-
Change directory (
cd
) into the root directory of the cloned repository and install the dependenciesbundle install
-
Run the database migrations:
rails db:migrate
-
Copy or move the
private.key
file you downloaded earlier the root directory of this demo application -
Copy or rename the
.env-example
file to.env
and update the file with your Vonage credentials:VONAGE_APPLICATION_ID
. This is the Application ID you generated earlier when creating the Vonage Application
-
Start up Ngrok
ngrok http 3000
-
Copy the Ngrok
Forwarding
URL and set this in the.env
file as the value forSITE_URL
-
In a separate Terminal tab, start the Rails application
rails s
-
In your browser, navigate to
localhost:3000
. The demo should now be running in the browser. -
Some functionality within the demo (such as creating new calls or ending existing calls) requires a logged in user. You can create a user locally by using the Rails Console. In a separate Terminal tab, open the Rails console
rails c
-
Create a user record in the Rails console:
User.create!(username: 'YOUR-USERNAME', password: 'YOUR-PASSWORD')