7) Master Project: Firebase + User Authentication Flashcards
what are the 3 parts of the backend with respects to this project?
authentication
servers
database
explain the relationship between a server and a databse?
server stores the code that determines the most efficient way to request data from the database.
Where does the firebase config code go?
src/firebase/firebase.utils.js
Where in the code does the user information get added so that the entire application has access to it?
App.js which should be a class function because we need to store the current user in the state
What are the inputs for the firebase file?
inputs:
- firebase/app
- firebase/firestore
- firebase/auth
how do you apply firebases signout functionality to a sign out button
onClick={() => auth.signOut()}>
SIGN OUT
How is the firebase database data organized?
into collections and documents that can also reference other collections
database documents need to have this attribute.
a unique ID
What is it mean for something the be a noSQL database?
the database consists of one big JSON object
SYNTAX for quering data from the fire store
What is a query?
a request we make to firestore to give us something from the database
Firestore returns us two types of object: ___ and ___. Of these objects, they can be either ___ or ___ versions.
references and snapshots
Document or Collection
What does a queryReference object represent?
the “current” place in the database that we are querying.
We use ___ to perform our CRUD methods (create, retrieve, update, delete).
documentRef
List the CRUD methods
.set()
.get()
.update()
.delete()
How do you add documents to collections using the collectionRef object?
collectionRef.add({//value:prop})
we get the snapshotObject from the referenceObject using the __ method.
.get()
documentRef returns a __ object
documentSnapshot
collectionRef returns a ___ object
querySnapshot
what attribute of a documentSnapshot object tells us whether a document is in the database?
exists; can be true or false
We get documentSnapshot objects from our ___ object
documentReference
The documentSnapshot object allows us to check if a document exists at this query using the ___ property which returns ___.
.exists
boolean
We can get the actual properties on a documentSnapshot object by calling the ____ method, which returns us a …
.data()
JSON object of the document
how do you prevent suggestions for email from popping up when you select sign-in with google?
add type=”button” attribute to the sign in with google component.