This doc outlings how to develope this project including installing, getting started and available commands to run.
- You must have nvm installed
brew install nvm
- install the firebase-tools
npm i -g firebase-tools
- add the firebase apps you will be deploying. Alias them to
prod
,test
andlocal
firebase use --add
-
install glcoud tools brew cask install google-cloud-sdk
-
login with firebase tools
firebase login
- login to gcloud
gcloud auth login
-
these steps let you define and setup your local development environment
-
create your
stages/local/.env
file in the root of the project. Set this as the contents of that file.
BLUEBIRD_DEBUG=true
FIREBASE_PROJECT_ID="${config.firebase.projectId}"
FIREBASE_TOKEN="${config.firebase.token}"
NODE_ENV=development
- create your
stages/local/config.yaml
file in the root of the project. Set this as the contents of that file.
api:
url: "http://localhost:5000/api/v1"
app:
description: "Moltres local app"
name: "Moltres Local"
slug: "moltres-local"
theme: "moltres"
url: "http://localhost:5000"
core:
debug: true
# facebook:
# appId: TODO
firebase:
apiKey: "your firebase api key"
# appId: TODO
authDomain: "${this.firebase.projectId}.firebaseapp.com"
databaseURL: "https://${this.firebase.projectId}.firebaseio.com"
# measurementId: TODO
messagingSenderId: your firebase messaging sender id
projectId: "your firebase project id"
serviceAccount:
sensitive: true
value:
auth_provider_x509_cert_url: https://www.googleapis.com/oauth2/v1/certs
auth_uri: https://accounts.google.com/o/oauth2/auth
client_email: "your firebase client email"
client_id: "your firebase client id"
client_x509_cert_url: "https://www.googleapis.com/robot/v1/metadata/x509/${encodeURIComponent(this.firebase.serviceAccount.client_email)}"
private_key: "your firebase private key"
private_key_id: "your firbease private key id"
project_id: ${this.firebase.projectId}
token_uri: https://accounts.google.com/o/oauth2/token
type: 'service_account'
storageBucket: "${this.firebase.projectId}.appspot.com"
token:
sensitive: true
value: "your firebase token"
# firestore:
# backupBucket: TODO
# google_analytics:
# analyticsId: TODO
# sentry:
# dsn: TODO
ssr:
outputPath: "${project.dir}/private/dist"
# test:
# integration: ${env.TEST_INTEGRATION}
twilio:
sensitive: true
value:
accountSid: "your twillio sid"
authToken: "your twilio auth token"
phoneNumbers:
- "your twilio phone number"
# twitter:
# username: TODO
- Run setup script
npm run setup
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:5000 to view it in the browser.
Starts tests against a specific stage
npm run test
.env-local
#TEST_INTEGRATION=true
FIRESTORE_EMULATOR_HOST=localhost:8080
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
Cleans up the artifacts created by npm run build
. This is useful if you want
to ensure that your code is built from scratch and no residual artifacts remain.
Deploys your application
Back up a database with the given stage
name
Delete the database for the given stage
. WARNING This deletes the entire database!
Deploy the database rules and run migrations for the given stage
name
Migrate the database up to the latest version for the given stage
name
Creates a new database migration script from a starter template and places it
into the ./migrations
folder.
This runs the predeploy steps such as minifying the database rules for the given stage
Restores the database on the given stage
to the backup id stored in the backup
bucket defined in the .env file for the stage ``
Debugging query factories
Add this code before or after in the query composition.
(next) => {
return (props, ...rest) => {
console.log('props:', props)
debugger
return next(props, ...rest)
}
}