System for keeping record and generating reports for a Tutoring Center Using Firebase Authentication and Firebase Firestore.
In the scripts/firebaseInitial.js copy your firebase configuration that you can generate from your firebase console to the javascript file in the json object. Also be sure to turn on firebase Authentication and Firstore on the firebase console
This system uses Firebase Tokens to only allow admins to change data. In order for this to work you need to deploy the firebase function in the functions folder in the index.js file. Details on how to deploy firebase functions can be found on firebase http://firebase.google.com/.
If you don't have an admin token added to a firebase auth account you will need to alter the function to turn off temporarelly the firebase admin token if statements to allow you to initially set up an admin when there is now admin.
if(context.auth ===undefined){ return{error:"only admins can add admins"} } if(context.auth.token.admin!==true){ return {error:"only admins can add admins"} }
Then re-enable the above code to lock down and secure your data and redeploy your functions. Now you can add Admins from the add admin UI.