Skip to content
/ react-kit Public

Firebase auth, widgets, elements boiler template

License

Notifications You must be signed in to change notification settings

d-bo/react-kit

Repository files navigation

react-kit

Codacy Badge CircleCI Build Status

Firebase

Install firebase locally after npm install.

npm install firebase --force

Enter firebase console.

https://console.firebase.google.com/

Export firebase secrets to local environment variables.

#!/bin/sh
# cloud/local environment variables
export REACT_APP_FIREBASE_API_KEY=""
export REACT_APP_FIREBASE_AUTH_DOMAIN=""
export REACT_APP_FIREBASE_DATABASE_URL=""
export REACT_APP_FIREBASE_PROJECT_ID=""
export REACT_APP_FIREBASE_STORAGE_BUCKET=""
export REACT_APP_FIREBASE_MESSAGING_SENDER_ID=""

Docker

We need to pass firebase environment vars to running container.

Create file env.list in the root of your project.

Paste and fill this:

REACT_APP_FIREBASE_DATABASE_URL=
REACT_APP_FIREBASE_API_KEY=
REACT_APP_FIREBASE_PROJECT_ID=
REACT_APP_FIREBASE_MESSAGING_SENDER_ID=
REACT_APP_FIREBASE_AUTH_DOMAIN=
REACT_APP_FIREBASE_STORAGE_BUCKET=

Build and run container.

# Testing build from sources inside container
docker build -t react-kit .
docker run --env-file ./env.list -itp 80:80 react-kit
# TODO: put prod-ready build under the nginx folder
# Is there an nginx fat-free version ?

Mongo

# Mongo limited export
mongo --quiet dbName --eval 'printjson(db.collectionName.find().limit(15).toArray())' > output.json
# Mongo import (Mongo Atlas example)
mongoimport --uri "mongodb+srv://[email protected]/databaseName" --collection collectionName --jsonArray --file outputFileName.json

About

Firebase auth, widgets, elements boiler template

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •