Giter VIP home page Giter VIP logo

collaborate-on-fire-example's Introduction

collaborate-on-fire-example

A simple example to get you started with collaborate-on-fire and help understand the basic structure.

Concept

The example shows how to create a simple, stateful application using mobx-keystone, mobx and react. In this app, user cursors are tracked as they move around the screen in a shared environment. Any user can manipulate objects on a very basic SVG canvas by dragging them around.

A simple multi-user game can be played using the "start adding" button (one user can press this - or more than one to make it harder). The object is to move all like colors together so that they touch.

Setup

This example requires a firebase application with firestore,realtime database and authentication.

You'll likely also want to set up cloud storage for storing snaphots (optional) and hosting (optional).

Using Firebase CLI

Run: firebase init

Use the console to select:

  • Realtime Database*
  • Firestore*
  • Hosting (optional)
  • Storage (optional)

* = required

Follow the instructions if required to visit the web console to complete setup.

Configure firebase authentication to use 'Google' authentication (Note: provider option can be switched in RootStore.login method if desired).

Firebase Config

  1. Add a "Web App" in the firebase console. Go through the steps until you get the firebaseConfig
  2. Copy the firebaseConfig object into a new file called 'src/config.js'
  3. Add export default firebaseConfig; at the end of that file

File ID

A file ID is used to save data consistently across the different firebase systems. This example uses a hard-coded file ID called 'COF_EXAMPLE_FILE' that is passed to the RootStore constructor. A real-world application would need to manage the file lifecycle for maintaining file IDs.

Run

yarn start

License

MIT

collaborate-on-fire-example's People

Watchers

Ken Goulding avatar tadiraman avatar Eric Youngberg 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.