- This is an authentication app built with react context management with firebase for deployment.
- Users can signup with their name, email, password and get access to enter data. Each user has their login page, where the user cannot see what is going on on another user's page.
- For the user to log in, it requires the user's email and password used initially for signing up for an account. After logging in, user can view their page for all necessary information previously inserted.
- After logging in, user can view their page for all necessary information previously inserted. Users can enter a new item and delete the item from their page.
npm install react-router-dom
npm install firebase
data query // const q = query(citiesRef, where("capital", "==", true));
- Checking on console.log to create fetching data with an index requirements (FirebaseError: The query requires an index. You can create it here: https://console.firebase.google.com....)
- Change to this line
match /NPS/{document=**}
- then publish it
curl -sL https://firebase.tools | upgrade=true bash
firebase login
firebase init
-select these line by press arrow down and space after press enter
- use exiting one
- select the right file
- then continue press enter
- when it ask for
- ? What do you want to use as your public directory? (public) change public to build
- then choose yes
- follow by press enter
- when it ask for
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /NPS/{document=**} {
// //for allowing full access just write this
// allow read, write, update, delete, create;
// allow read, write;
// if
// request.time < timestamp.date(2022, 4, 24);
//rule to allow create
// must be authenticated to create
allow create: if request.auth != null;
// for allowing the user to read and delete
// logged in user uid must match the document creator to read & delete
allow read, delete: if request.auth.uid == resource.data.uid;
}
}
}
- only desire file
firebase deploy --only firestore
npm run build
firebase deploy
- Context, Hooks, Reducers, Routing, Auth, Databases. By Net Ninja (INSTRUCTOR)