Follow these instructions to run the demo app on you local machine.
- Browse to Google Developer Console.
- Under
Use Google APIs, clickEnable and Manage APIslink. - Select
Google+ APIand clickEnable. - Open the
Credentialstab. Click theCreate Credentialsselect box and selectOAuth client ID. - Select
Web Applicationoption from the menu and fill in the following details:
- In the
Authorized Javascript origins, add the Url for your website:http://localhost:3000in this case. - In the
Authorized redirect URIs, add the callback Url:http://localhost:3000/.auth/login/google/callbackin this case. - Click the
Createbutton.
- You'll get a
client Idand aclient secret. Copy these strings to a temporary file. We'll use it in a bit.
We're using Sql DB to keep our app data. You'll need to create your own Sql DB, either locally or in the cloud. You can use Sql Express (which is [free] (https://www.microsoft.com/en-gb/download/details.aspx?id=42299)) for running the app locally, or create a Sql database in [Azure] (https://azure.microsoft.com/en-gb/services/sql-database). After creating your DB, you'll need to run a Sql script that will deploy the DB schema.
- Download the
schema.sqlfile located understorage/sqldirectory. Edit the file, scroll to the end of the file and edit the last line to add you as the first user of the tool:
- If you're using Azure SQL, we need to enable access to the Sql server from your machine IP, so that you can connect and create the schema. Click the SQL Server instance on MS Azure portal -->
All Settings-->Firewalland add your IP. For the sake of the demo, I'm enabling all IP range. Save your changes.
- Use your favorite SQL Server client UI to connect to the SQL server. I'm using [Sql Server Management Studio] (https://msdn.microsoft.com/en-us/library/mt238290.aspx). You can also use Visual Studio in case you're using Windows. In case of other OS, look for Sql Server UI Client that can run on your OS. [DBeaver] (http://dbeaver.jkiss.org/download/) is a nice option for MacOS / Ubuntu.
- Use the SQL server settings, as defined when you created the SQL server. Click the
SQL Server-->Settingsto get the SQL server host name, and use the user and password you defined with the SQL Server Authentication scheme:
- After connecting, you'll see the database that was provisioned for you. Right-click and select
New Query:
- Copy-Paste the content of the
Schema.sqlfile to this window, and clickF5to execute the script and create all of the db objects:
We're using Azure Storage Accont to store the videos. You can use the local storage account provided as part of Azure SDK, or provision a new account in Azure.
Create a /config/config.private.json file with your configuration and secret keys when running locally. Use config/sample.config.private.json file as a reference.
You can start by copying this file to /config/config.private.json and then edit the content accordingly:
sql.server- your Sql server namesql.userName- your Sql server namesql.password- your Sql passwordsql.options.database- your Sql database namestorage.account- your Azure storage account namestorage.key- your Azure storage account keyauth.google.clientID- your google client Idauth.google.clientSecret- your google client secretauth.google.callbackURL- your google client URL- this is the URL that will be called with the authentication token after the user provides his consent. Usehttp://localhost:3000/.auth/login/google/callbackwhen working locally.
When deploying the app to the cloud, it is recommended to use the environment variables instead of the config file. Take a look at
/config/index.jsfile to get the names of the environment variables corresponding to the configuration items described above.
- Run
npm installfrom the root directory - Run
bower installfrompublicdirectory (if you don’t have bower, install it by runningnpm install bower -g)
Run npm start and browse to http://localhost:3000




