ESP32 - Firebase Web App
ESP32 - Firebase Web App
1. Creating Firebase
(we recommend using the Firebase project from the previous section).
Installing Node.js
Go to nodejs.org and download the LTS version.
Installing Firebase Tools (VS Code)
firebase login
This web page is built using the files placed in the public folder of your Firebase project.
You can access that web page from anywhere in the world.
Now, the idea is to change the files in the public folder to show your own web page instead of that one.
4) Add Firebase To Your App
• Go to your Firebase console and select your project.
• Then, click on the +Add app button
• Then, select the web app icon.
• Give your app a name. I
simply called it test.
• Then, check the box next
to Also set up Firebase
Hosting for this App.
• Click Register app.
copy
the firebaseConfig
object because
you’ll need it later.
• Click Next on the proceeding steps.
• After this, you can also access
the firebaseConfig object if you
go to your Project settings in your
Firebase console.
Copy the authDomain. In my case, it is (the same we got in the Terminal window after setting up the Firebase project):
https://esp-project-afd59.web.app/
This is the URL that allows you to access your web app.
Creating Firebase Web App
index.html
• We are Coping a code to index.html file.
app.js
• Inside the public folder, create a file called app.js.
• This JavaScript file is responsible for interacting with the Realtime
Database and updating the values on the web page whenever
there’s a change in the database.
Firebase Configuration