Day 10: React & Firebase Cont'd

Tuesday, June 19, 2018

Lecture Videos

Morning:

Afternoon:

Topics

React Select

Refs and the DOM

Moment.js

Firebase Database Rules

Element.scrollIntoView()

Examples

Firebase Database Rules

Again, you can set database rules in Firebase for your application. In our Chatarang app, we made a certain endpoint public while others are private based on whether or not a user is authenticated.



{
  "rules": {
    "users": {
      ".read": "true",
      ".write": "auth != null"
    },
    ".read": "auth != null",
    ".write": "auth != null"
  }
}


IMPORTANT: You must add this to your firebase.json file:

Projects

Homework

Only list public rooms, and rooms in which the current user is listed as a member.

Super Mega Bonus Credit

Don’t allow users to load non-public rooms of which they’re not members.

Super Mega Bonus Credit Hyper Fighting

Make a separate UI for direct messages.

  • List them separately in the sidebar.
  • Make a new form (or at least a new button that presents the same form differently).