Creating a Modern Firebase Powered Application with TDD
Use reactive programming and tests to build a professional app
Configuring for Production
Making sure the app works in a production environment
PROModule Outline
- Source Code & Resources PRO
- Lesson 1: Introduction PUBLIC
- Lesson 2: The Structure of this Module PUBLIC
- Lesson 3: [Sprint One] Setting up Firebase PUBLIC
- Lesson 4: [Sprint One] Creating Security Rules with TDD PRO
- Lesson 5: [Sprint One] Testing Authentication PRO
- Lesson 6: [Sprint One] Component Store PRO
- Lesson 7: [Sprint One] Circumventing Firebase Authentication for E2E Tests PRO
- Lesson 8: [Sprint Two] Displaying Client List from Firestore PRO
- Lesson 9: [Sprint Two] - Adding Clients PRO
- Lesson 10: [Sprint Two] - Editing Clients PRO
- Lesson 11: [Sprint Two] - Client Details PRO
- Lesson 12: Preparing for Delivery PRO
- Lesson 13: Configuring for Production PRO
- Lesson 14: [Sprint Three] - Refactoring PRO
- Lesson 15: [Sprint Three] Setting up PWA PRO
- Lesson 16: [Sprint Three] Logout PRO
- Lesson 17: [Sprint Three] Delete a Client PRO
- Lesson 18: [Sprint Three] - Feedback Mechanism PRO
- Lesson 19: [Sprint Three] View Feedback PRO
- Lesson 20: More Styling PRO
- Lesson 21: [Sprint Four] - Refactoring Feedback PRO
- Lesson 22: [Sprint Four] - Feedback Dates PRO
- Lesson 23: [Sprint Four] - Client Survey PRO
- Lesson 24: [Sprint Four] - View Survey PRO
- Lesson 25: Final Touches PRO
- Lesson 26: Conclusion PRO
Lesson Outline
Updating Security Rules
At the moment, our Firestore security rules define the admin user as [email protected]
(well, mine do - hopefully yours use your own email address) That's not going to work so well for our actual client. If they attempt to authenticate with their own Google account, they aren't going to be able to access anything. We will need to update this to use the clients email address.
Project management
Make sure to create an issue and task branch for this work, e.g:
chore: update security rules with clients email address
Update
firestore.rules
to use the clients email address (assuming that you aren't actually delivering this app to someone else, you might test this by using a different email address that you own)
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if isAdmin();
}
}
function isAdmin(){
return request.auth != null && request.auth.token.email == '[email protected]' && request.auth.token.email_verified;
}
}
Now let's run our Firestore security rules tests to see if this breaks anything:
npm run test:rules
and indeed it does break things:
Thanks for checking out the preview of this lesson!
You do not have the appropriate membership to view the full lesson. If you would like full access to this module you can view membership options (or log in if you are already have an appropriate membership).