Problem statement
Have you ever thought about building an entire system from back-end to front-end? If you're experienced, you've probably encountered numerous difficulties, from designing data structures, choosing programming languages, libraries/frameworks for writing web APIs, managing file uploads, to configuring server systems, software, hardware, operating systems, and more.
Just thinking about it makes everything seem so complicated, and the important thing is how to maintain, improve, and plan for the development of new features.
And then there are many problems; you'll spend a lot of time finding solutions when the system is under heavy load. These include load balancing, database scaling, network optimization, and then strategies for disaster recovery, data security, server security, and so on.
If you're a beginner programmer, how can you know which problems need prioritizing, which are critical and need to be solved first, and what knowledge is needed to do so? Firebase is the perfect choice for you.
What is Firebase?
Firebase is a platform provided by Google for developing mobile and web applications, helping developers simplify data manipulation without needing to interact with the backend or server.

With Firebase, developers can focus on application development without worrying about how their product will function and be managed on the backend (data processing and storage).
Firebase services

Currently, Firebase offers a wide range of services. From real-time chat systems to A/B testing, these services are commonly used in application development.
- Realtime Database
Firebase Realtime Database is a NoSQL database stored in the cloud, allowing you to store and synchronize user data in real time.
Realtime syncing allows users to access their data on any device.

- Authentication
With this Firebase feature, you can easily build login functionality without needing to use separate registration data. Below is a guide on how to use this feature to build authentication functionality.

Firebase provides several authentication methods for your application, such as:
- Email & Password
- Phone numbers
- Firebase Cloud Messaging (FCM)

This was the original feature of Firebase, helping us build chat applications. Now, it also allows you to push notifications to multiple Android, iOS, or Web devices.
- Chat application
One common application that developers often use Firebase for is a chat application. In this article, we will describe and install this application as a web app.
Login page

We log in using a Google account with Firebase's Authentication service, employing the signInWithPopup method.

The organizational functions for the application are: saving the login information to LocalStorage and saving the login information to the Firebase user collection.


Retrieve user information from the user collection using userId

Retrieve all conversations of logged-in users in the conversations collection.

Display that user's conversations on the chat page.

Create messages and save them to the messages collection.

Get real-time data on messages that have been and are currently being sent in a conversation.

That's it! A very simple web chat application, built with just Firebase, HTML, and Javascript. You can also implement it on other platforms like Asp.net, PHP, Java, etc.
Author: Thy Dao Quoc - Date written: March 22, 2023
Category: Training program, IT - Website Design, IT - Software Applications, Information Technology - Software Applications, TECHNOLOGY AND ENGINEERING SECTOR



0 thoughts on “FIREBASE VÀ CÁC ỨNG DỤNG CỦA NÓ”