Open ParmeJon opened 3 years ago
Firebase Cloud functions can be implemented in a node environment with their Firebase CLI.
CONS
Note: You can emulate functions in any Firebase project, but to deploy to the recommended Node.js 10 runtime environment, your project must be on the Blaze pay-as-you-go billing plan. See Cloud Functions pricing.
PROS
Resources: Cloud Function Use Cases Pros and Cons of Firebase More pros and cons
/src/lib/firebase.js
import firebase from "firebase";
const firebaseConfig = {
apiKey: process.env.REACT_APP_FIREBASE_API_KEY,
authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN,
projectId: process.env.REACT_APP_FIREBASE_PROJECT_ID,
storageBucket: process.env.REACT_APP_FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.REACT_APP_FIREBASE_MESSAGING_SENDER_ID,
appId: process.env.REACT_APP_FIREBASE_APP_ID,
measurementId: process.env.REACT_APP_FIREBASE_MEASUREMENT_ID,
};
const initFirebase = firebase.initializeApp(firebaseConfig);
const db = initFirebase.firestore();
export default db;
Source: Setting up a react/firebase app
What? Need investigation on how to implement Firebase with regards to custom cloud functions.
Why? We are going to need custom logic to determine when a person gets put into a new room.