Skip to content
Create, follow and layer maps to plan your next trip!
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
components
fire
functions
lib
public
.DS_Store
.firebaserc
.gitignore
.prettierrc
README.md
babel.config.js
database.rules.json
dev.js
env.config.js
firebase.json
firestore.indexes.json
firestore.rules
jsconfig.json
main.js
package-lock.json
package.json
storage.rules
webpack.config.js

README.md

Get started:

git clone git@github.com:queerviolet/spark.git
cd spark
npm install
npm start

Frontend

The frontend starts in main.js. The root of the react app is in App.jsx.

a word about ~

The webpack config aliases ~ to mean "the root of the app". For example, you can import firebase from '~/fire' anywhere in your app, without worrying about how many ..s to have in your relative path.

Firebase

Firebase is setup in fire/index.js. Your config will get written to fire/setup.js after you run npm install.

You can import the various Firebase APIs from ~/fire. For instance:

  import firebase, {auth} from '~/fire'

  const google = firebase.auth.GoogleAuthProvider
  auth.signInWithPopup(google)

Functions

Write your Cloud Functions in functions/index.js.

You can require node modules from Cloud Functions normally. Be sure to npm install them inside the functions directory (it has its own package.json).

Sadly, you can't use import statements, and you can't require code that does. Don't despair, the library provides a workaround.

The Library

The library is defined in lib/index.js. In the library, you can import code from your project normally, and anything you export will be available to your Cloud Functions.

It is a bridge between Cloud Function code and the rest of your project's code.

Hot loading

Hot module replacement is enabled, and the react-hot-loader plugins are applied.

Your React components will update in place after you save them, without losing their state.

You can’t perform that action at this time.