What you'll build

What you'll learn

What you'll need

Login to Firebase

Firebase is a free Google product that lets you build apps with databases, analytics, hosting, and more. In this example, we're going to use it for the database features.

  1. Go to Firebase
  2. Login with your school email address

Create a project

  1. Go to console in the top right of the screen and click Create a project
  2. You'll be prompted to enter a project name and choose whether to enable Google Analytics (which you can skip for now as per the tip).

It might take a few moments to set up everything for the first time.

You need to tell Firebase that you have an app so that it can give you the configuration information you'll need to connect to it. To get the specific connection details for your web app, you first need to register it in your Firebase project.

  1. Click the </> button to add a web app.
  2. The App nickname should be the same or similar to your app's name that you've been developing.

Once you've registered your app, Firebase will give you some instructions and information for you to use to add the Firebase SDK which will connect your app to the Firestore database.

Keep this window open for a while - you'll need to refer back to it in the following steps.

Your app will need the Firebase files and configuration information to be able to connect to Firebase and your database.

  1. In Visual Studio Code, install the Firebase files by running the command it gave you: npm install firebase
  1. Create a new file in your lib/ folder called db.js
  2. Copy and paste the code that Firebase gave you into the new file. It looks like this, except it has your specific configuration information in the middle. Don't copy the config from this guide - the configuration is unique to your project because it contains the keys to connect to your Firebase services.