Giter Club home page Giter Club logo

virtual-office's Introduction

Harbor - Electron

This is the Electron client for Harbor. It's built off Electron React Boilerplate and uses styled-components for styling.

Setting up

Just clone and install dependencies with:

yarn

Starting Development

For the normal dev environment:

yarn start

For a low-power, audio-off version so you can run multiple instances without frying your computer:

yarn hack

There's also yarn hack2 and yarn hack3 for spinning up on different ports.

Packaging for Production

To package apps for the local platform:

yarn package

About the architecture

Much of the state is stored in a set of 4 contexts. Each context has a corresponding manager, except for VideoCallContext which has multiple managers that can be swapped out. Context managers depend on each other in a DAG structure.

  1. LocalInfoContext - no dependencies. This contains basic info about the user like their name and ID. Provides functions for things like changing your name.

  2. LocalMediaContext - no dependencies. This manages of all the user's local media state, like whether their camera and mic are on. You toggle your camera and mic by calling functions provided by this context. This context also manages a MediaStreamTrack for local video and audio, available without being in a call. This is useful for previewing your video and volume before joining a room.

  3. ColyseusContext - depends on LocalInfoContext and LocalMediaContext. This talks to the server which runs Colyseus, a multiplayer game framework that helps with synchronizing state across clients. Whenever you update your LocalMediaContext, ColyseusContext listens and tells the server so that it can broadcast the change to everyone else in the space. The Colyseus server tells you everything that you don't directly control, like what room you're in, where the other participants are, and their state.

  4. VideoCallContext - depends on all of the above. This context's manager communicates with the video call API to provide track and track metadata info from nearby participants. It doesn't provide any functions to call; it operates on its own by listening to changes in LocalMediaContext and ColyseusContext. Currently the only VideoCallContext manager is DailyVideoCallContextProvider, which uses Daily (https://www.daily.co/), but it can be swapped out with other managers without changing code anywhere else. Moreover, we can actually swap out the VideoCallContext manager automatically based on what room you're in, allowing us to take advantage of the benefits of different APIs. For example, Agora (https://www.agora.io/en/) enables broadcasting from a small number of uploaders to an audience of a million, while Daily enables 200 participants talking to each other simultaneously. So we can have a broadcasting room use Agora and other rooms use Daily. This way we can also compare the call quality of different providers (including our own, when we roll one) without restarting the app.

virtual-office's People

Contributors

akovalyov avatar akozhemiakin avatar amilajack avatar buckymaler avatar catalinmiron avatar chentsulin avatar davej avatar domasx2 avatar dplusic avatar dustintownsend avatar epilande avatar g1ibby avatar greenkeeperio-bot avatar jefffriesen avatar jhen0409 avatar jooohhn avatar kilian avatar knpwrs avatar kubijo avatar longlivechief avatar renovate-bot avatar talha131 avatar trstringer avatar tsemerad avatar vikr01 avatar wincent avatar xwartz avatar xyzrr avatar yeti-or avatar zeevl avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.