Skip to content
/ quasar Public
forked from srtucker22/glipchat

video chatroom using meteor + webrtc + react + flux

Notifications You must be signed in to change notification settings

chnl/quasar

 
 

Repository files navigation

quasar

View the project at https://quasar-meteor.herokuapp.com/

quasar is a real-time video chatroom application. The frontend is powered by React, Flux and WebRTC and the backend is powered by Meteor.

quasar has been tested on the following:

  • Android 4.3+ cordova app
  • Chrome
  • Chrome for Android (Android 5+)
  • Firefox
  • OS X (Electron application)

Other browsers and operating systems may not support WebRTC.

Motivation

Quasar is intended to be a veritable open source solution for multi-user multi-platform video conferencing -- a product regular people can use and developers can modify and build into their own products.

It is also an example of how to create a WebRTC video chatroom and of how to integrate React and Flux in a Meteor app.

Installation

  1. Clone the project git clone https://github.com/srtucker22/quasar.git

  2. Go to the primary directory cd quasar

  3. Add a settings.json to the primary directory touch settings.json

  4. Add your personal settings for the following services included in quasar (or remove the ones you don't want)

     {
       "admins": [{
         "name": "Administrator",
         "email": "admin@example.com",
         "roles": ["admin"],
         "password": "ADMIN_PASSWORD"
       }],
       "google" : {
         "clientId" : "YOUR_CLIENT_ID",
         "clientSecret" : "YOUR_CLIENT_SECRET"
       },
       "kadira": {
         "appId": "YOUR_APP_ID",
         "appSecret": "YOUR_APP_SECRET"
       },
       "public": {
         "analyticsSettings": {
           "Google Analytics": {"trackingId": "YOUR_TRACKING_ID"},
           "Segment.io" : {"apiKey": "YOUR_API_KEY"}
         },
         "google": {
           "browserKey": "YOUR_BROWSER_KEY"
         }
       },
       "electron": {
         "autoPackage": true,
         "builds": [{
           "platform": "darwin", "arch": "x64"
         },{
           "platform": "win32", "arch": "ia32"
         }],
         "downloadUrls": {
           "win32": "/public/downloads/win32/",
           "darwin": "/public/downloads/osx/quasar.zip"
         },
         "name": "quasar",
         "rootUrl": "https://quasar-meteor.herokuapp.com/",
         "version": "0.0.1",
         "description": "Video Chatroom with Meteor + WebRTC + React + Flux",
         "height": 768,
         "width": 1024,
         "frame": true,
         "title-bar-style": "hidden",
         "resizable": true,
         "protocols": [{
           "name": "quasar",
           "schemes": ["quasar"]
         }]
       }
     }
    
  5. Run the app with the settings meteor --settings settings.json

Deployment Notes:

To deploy to a remote server, consider using a package like Meteor Up

Android Cordova Notes:

In order to run video conferencing on quasar as a cordova app, you will to have the latest version of Android Studio installed and you will need to use an actual Android device (currently tested with devices 4.3+). Plug in your device to your computer via USB and run

meteor run android-device -p {local port} --settings settings.json

In order to use Google auth, you will need to run the application from a live mobiles server (see OAuth for Mobile Meteor Clients for details). To do this, first deploy your meteor application to a live server.

(e.g. meteor deploy {your-server-url} --settings settings.json)

Once the app is successfully deployed, run:

meteor run android-device --mobile-server {your-server-url} --settings settings.json

nice additional flags might be: --verbose --production

Please read the Meteor Cordova Integration docs for more details.

The mobile UI is currently super slow. Any suggestions or contributions really appreciated here!

Electron Notes:

Do NOT include the 'electron' field in your settings.json file if you are not running quasar from a Windows or Mac machine. meteor-electron will throw errors if you try and build from a Linux machine.

quasar uses meteor-electron to easily transform into a downloadable desktop app and update as you develop. For settings.json configuration for this feature, please refer to the meteor-electron documentation.

meteor-electron has been modified to build a compressed version of the quasar desktop app at quasar/public/downloads/{platform}-{arch}/quasar.zip, which browser versions can reference for easy downloading. See download-button.component.jsx for how components reference this directory.

To run the Electron app pointing to localhost, exclude the rootUrl parameter from settings.json, otherwise the Electron app will point to https://quasar-meteor.herokuapp.com/.

Application Design Overview

Quasar is an example of how to create a WebRTC video chatroom and also of how to integrate React and Flux in a Meteor app.

Don't know React or Flux? No problem!

The best way to describe React is that it is a view layer only.

Flux is an architectural pattern that can be used with React to enable one-way data flows to a centralized application data store using an event system.

  • Your Views "Dispatch" "Actions"
  • Your "Store" Responds to Dispatched Events
  • Your Store Emits a "Change" Event
  • Your View Responds to the "Change" Event

Read these useful guides to get a quick overview:

The application folder structure logically reflects the flux architecture through folders such as actions and stores.

Routing is done with React Router

It's worth spending some time understanding how this router works before digging into the code. Check out routes.jsx for the main router code.

quasar uses Meteor Streams to power the WebRTC communication. [Note: Meteor Streams is now officially an inactive project]

The streams are handled by RTCStore in rtc.store.jsx on the frontend.

The streams are managed by roomStream in room.stream.jsx on the backend.

Contributing

This project welcomes code contributions, bug reports and feature requests.

Motivation

quasar is intended to be an example of how to create a WebRTC video chatroom and of how to integrate React and Flux in a Meteor app.

Resources

Upcoming

  • Create a Meteor iOS app that works with quasar on the web
  • Change the name of the project to make it more accessible for projected users (suggestions welcome)

TODO

  • Enhance invite workflow
  • mobile -- you send an invite
    • if an active invitee opens the app after a notification and the inviter is active, they will get a dialog asking to join the room and a notification in their quasar notification list for retrieval -- which shows 'join' cta until the users leave the room
    • if you invite non-users, they will go directly to room as guest. if the room is empty, user will be directed to notifications list on mobile or homepage on desktop. ~ implement with invitation codes in email
  • Add raix push notifications for cordova to enhance mobile support
  • Add TURN server support to make it more useful for real-world deployment

License

The MIT License

Copyright (c) 2016 Glipcode http://glipcode.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

video chatroom using meteor + webrtc + react + flux

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.0%
  • Other 1.0%