META App: Back-end Development
To make the META app fully functional, we needed to add back-end code as well.
For the META app, the back-end consists of adding an authentication system and integrating a database into the app.
To begin, we describe the back-end code for the Register page.
There are two back-end components we need to add to the register page: we need to allow a user to register their account into the authentication system and also add their information into the database. For the authentication system, we used the Firebase Authentication provided by Google.
First, we add the code to integrate our app with Firebase. We needed to import the initializeApp function and add the Firebase config to our code. The initializeApp function is a crucial step in setting up and initializing the Firebase services within a web application.
Then, we add the Firebase config to the initializeApp function to finish the integration.
import { initializeApp } from "firebase/app";
const firebaseConfig = {
apiKey: "AIzaSyC55iBDd_uZhjnoxzVeNmnNg8bTDEXD2Fo",
authDomain: "meta-fc205.firebaseapp.com",
projectId: "meta-fc205",
storageBucket: "meta-fc205.appspot.com",
messagingSenderId: "313671883891",
appId: "1:313671883891:web:3ecf94acf648ee9ba85e06",
measurementId: "G-953P5N046G"
};
const app = initializeApp(firebaseConfig);