For ease of use, I've replicated our restaurant finder app in the Chapter-17 directory in the GitHub repository. Don't forget to include your own environment variables in the .env file from Chapter 15, Combining Node.js with the Frontend, restaurant finder. Take a moment to get this set up and working before we move on.
The next thing we'll need to do is go to Firebase and configure it to use authentication. In the Firebase console, access the Authentication section and set up a sign-in method; for example, you can set up Google authentication. There's a list of methods you can use here, so go ahead and add one or more.
Next, we're going to set our rules in the Real-Time Database section, as follows:
{
"rules": {
"restaurants": {
"$uid": {
".write": "auth != null && auth.uid == $uid",
".read": "auth != null && auth.uid == $uid"
}
...