homebase /dev/entry/week6
Welcome to our week 6 blog! This blog will cover the database aspect of our project. I hope this is informative and helpful.
We use Google’s Firebase as our authentication and storage provider. We decided to choose Firebase because it is very convenient and easy to use in several ways.
Authentication
The way Firebase let us authenticate users is very robust. It provides several ways to sign in with existing accounts on different platforms.
Currently, we allow two ways to sign in, using email/password which the users can create, or logging in with an existing Google account. We can use the .auth() function of the firebase dependency in React to check whether the user is logged in or not. With homebase, we use firebaseui-web-react for our styled log-in buttons. By clicking these buttons, a new window will open asking the user to enter their Google credential or select an email if they have logged in already.
We can get the email address, avatar, display name, or similar information of a logged in user. With such information, we can filter house listings depend on who the user is. For example, we can build a My Listing page which shows a list of listings owned by the current user by getting all listings which have the email of that user.
Storage
Another great, and probably the major, value of Firebase is its Real-Time Database. We can push and get data from a JSON-styled data tree. It is very convenient because it doesn’t require any SQL experience to use.
Conclusion
Overall, we use what Google has to offer to avoid time-consuming tasks relating to setting up the backend. For the next blog, we will cover how Firebase and Redux fuse into our application.
Thank you for reading our article. We are more than happy to answer any of your questions! Please let us know what you think by putting a comment down below!