{"id":26652,"date":"2023-03-22T20:33:01","date_gmt":"2023-03-22T13:33:01","guid":{"rendered":"https:\/\/www.caodangvietmy.edu.vn\/?p=26652"},"modified":"2023-04-05T13:58:45","modified_gmt":"2023-04-05T06:58:45","slug":"firebase-va-cac-ung-dung-cua-no","status":"publish","type":"post","link":"https:\/\/www.caodangvietmy.edu.vn\/en\/firebase-va-cac-ung-dung-cua-no\/","title":{"rendered":"FIREBASE AND ITS APPLICATIONS"},"content":{"rendered":"<h2 style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">Problem statement<\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">Have you ever thought about building an entire system from back-end to front-end? If you&#039;re experienced, you&#039;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.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">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.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">And then there are many problems; you&#039;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.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">If you&#039;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.\u00a0<\/span><\/p>\n<h2 style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">What is Firebase?<\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">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.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><img loading=\"lazy\" decoding=\"async\" width=\"892\" height=\"816\" class=\"wp-image-26663\" src=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/introduction-to-firebase-partech.png\" alt=\"Introduction to Firebase - ParTech\" srcset=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/introduction-to-firebase-partech.png 892w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/introduction-to-firebase-partech-640x585.png 640w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/introduction-to-firebase-partech-768x703.png 768w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/introduction-to-firebase-partech-284x260.png 284w\" sizes=\"(max-width: 892px) 100vw, 892px\" \/><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">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).<\/span><\/p>\n<h2 style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">Firebase services<\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><img loading=\"lazy\" decoding=\"async\" width=\"804\" height=\"607\" class=\"wp-image-26664\" src=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/trip-to-firebase-as-an-android-developer-or-by-abhi.png\" alt=\"Trip to Firebase as an Android Developer | by Abhishek Kumar Sah | Noteworthy - The Journal Blog\" srcset=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/trip-to-firebase-as-an-android-developer-or-by-abhi.png 804w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/trip-to-firebase-as-an-android-developer-or-by-abhi-640x483.png 640w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/trip-to-firebase-as-an-android-developer-or-by-abhi-768x580.png 768w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/trip-to-firebase-as-an-android-developer-or-by-abhi-344x260.png 344w\" sizes=\"(max-width: 804px) 100vw, 804px\" \/><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">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.<\/span><\/p>\n<ol style=\"text-align: justify;\">\n<li><span style=\"font-family: 'times new roman', times, serif;\"><strong>Realtime Database<\/strong><\/span><\/li>\n<\/ol>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">Firebase Realtime Database is a NoSQL database stored in the cloud, allowing you to store and synchronize user data in real time.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">Realtime syncing allows users to access their data on any device.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"168\" class=\"wp-image-26665\" src=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/var-folders-9g-dcg175n97b950p4vr8s_y2rh0000gn-t-c-1.png\" alt=\"\/var\/folders\/9g\/dcg175n97b950p4vr8s_y2rh0000gn\/T\/com.microsoft.Word\/Content.MSO\/88CC8498.tmp\" \/><\/span><\/p>\n<ol style=\"text-align: justify;\">\n<li><span style=\"font-family: 'times new roman', times, serif;\"><strong>Authentication<\/strong><\/span><\/li>\n<\/ol>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">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.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><img loading=\"lazy\" decoding=\"async\" width=\"302\" height=\"167\" class=\"wp-image-26666\" src=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/var-folders-9g-dcg175n97b950p4vr8s_y2rh0000gn-t-c-2.png\" alt=\"\/var\/folders\/9g\/dcg175n97b950p4vr8s_y2rh0000gn\/T\/com.microsoft.Word\/Content.MSO\/78038E66.tmp\" \/><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">Firebase provides several authentication methods for your application, such as:<\/span><\/p>\n<ul style=\"text-align: justify;\">\n<li><span style=\"font-family: 'times new roman', times, serif;\">Email &amp; Password<\/span><\/li>\n<li><span style=\"font-family: 'times new roman', times, serif;\">Phone numbers<\/span><\/li>\n<li><span style=\"font-family: 'times new roman', times, serif;\">Google<\/span><\/li>\n<li><span style=\"font-family: 'times new roman', times, serif;\">Facebook<\/span><\/li>\n<li><span style=\"font-family: 'times new roman', times, serif;\">Twitter<\/span><\/li>\n<\/ul>\n<ol style=\"text-align: justify;\">\n<li><span style=\"font-family: 'times new roman', times, serif;\">Firebase Cloud Messaging (FCM)<\/span><\/li>\n<\/ol>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><img loading=\"lazy\" decoding=\"async\" width=\"754\" height=\"424\" class=\"wp-image-26667\" src=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/the-firebase-blog-life-of-a-message-from-fcm-to-t.gif\" alt=\"The Firebase Blog: Life of a message from FCM to the device\" \/><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">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.<\/span><\/p>\n<ol style=\"text-align: justify;\">\n<li><span style=\"font-family: 'times new roman', times, serif;\"><strong>Chat application<\/strong><\/span><\/li>\n<\/ol>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">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.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><strong>Login page<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"689\" class=\"wp-image-26668\" src=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-6.png\" srcset=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-6.png 750w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-6-640x588.png 640w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-6-283x260.png 283w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">We log in using a Google account with Firebase&#039;s Authentication service, employing the signInWithPopup method.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><img loading=\"lazy\" decoding=\"async\" width=\"1303\" height=\"661\" class=\"wp-image-26669\" src=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-7.jpeg\" srcset=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-7.jpeg 1303w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-7-640x325.jpeg 640w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-7-1024x519.jpeg 1024w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-7-768x390.jpeg 768w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-7-430x218.jpeg 430w\" sizes=\"(max-width: 1303px) 100vw, 1303px\" \/><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">The organizational functions for the application are: saving the login information to LocalStorage and saving the login information to the Firebase user collection.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><img loading=\"lazy\" decoding=\"async\" width=\"1248\" height=\"220\" class=\"wp-image-26670\" src=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-8.jpeg\" srcset=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-8.jpeg 1248w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-8-640x113.jpeg 640w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-8-1024x181.jpeg 1024w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-8-768x135.jpeg 768w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-8-430x76.jpeg 430w\" sizes=\"(max-width: 1248px) 100vw, 1248px\" \/><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><img loading=\"lazy\" decoding=\"async\" width=\"1381\" height=\"637\" class=\"wp-image-26671\" src=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-9.jpeg\" srcset=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-9.jpeg 1381w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-9-640x295.jpeg 640w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-9-1024x472.jpeg 1024w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-9-768x354.jpeg 768w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-9-430x198.jpeg 430w\" sizes=\"(max-width: 1381px) 100vw, 1381px\" \/><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">Retrieve user information from the user collection using userId<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><img loading=\"lazy\" decoding=\"async\" width=\"1428\" height=\"672\" class=\"wp-image-26672\" src=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-10.jpeg\" srcset=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-10.jpeg 1428w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-10-640x301.jpeg 640w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-10-1024x482.jpeg 1024w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-10-768x361.jpeg 768w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-10-430x202.jpeg 430w\" sizes=\"(max-width: 1428px) 100vw, 1428px\" \/><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">Retrieve all conversations of logged-in users in the conversations collection.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><img loading=\"lazy\" decoding=\"async\" width=\"1430\" height=\"1242\" class=\"wp-image-26674\" src=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-11.jpeg\" srcset=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-11.jpeg 1430w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-11-640x556.jpeg 640w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-11-1024x889.jpeg 1024w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-11-768x667.jpeg 768w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-11-299x260.jpeg 299w\" sizes=\"(max-width: 1430px) 100vw, 1430px\" \/><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><strong>Display that user&#039;s conversations on the chat page.<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><img loading=\"lazy\" decoding=\"async\" width=\"1218\" height=\"669\" class=\"wp-image-26676\" src=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-12.png\" srcset=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-12.png 1218w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-12-640x352.png 640w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-12-1024x562.png 1024w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-12-768x422.png 768w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-12-430x236.png 430w\" sizes=\"(max-width: 1218px) 100vw, 1218px\" \/><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">Create messages and save them to the messages collection.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><img loading=\"lazy\" decoding=\"async\" width=\"1432\" height=\"893\" class=\"wp-image-26678\" src=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-13.jpeg\" srcset=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-13.jpeg 1432w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-13-640x399.jpeg 640w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-13-1024x639.jpeg 1024w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-13-768x479.jpeg 768w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-13-417x260.jpeg 417w\" sizes=\"(max-width: 1432px) 100vw, 1432px\" \/><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">Get real-time data on messages that have been and are currently being sent in a conversation.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><img loading=\"lazy\" decoding=\"async\" width=\"1428\" height=\"625\" class=\"wp-image-26680\" src=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-14.jpeg\" srcset=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-14.jpeg 1428w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-14-640x280.jpeg 640w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-14-1024x448.jpeg 1024w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-14-768x336.jpeg 768w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26652-14-430x188.jpeg 430w\" sizes=\"(max-width: 1428px) 100vw, 1428px\" \/><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">That&#039;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.<\/span><\/p>\n<p style=\"text-align: justify;\">","protected":false},"excerpt":{"rendered":"<p>Problem Statement: Have you ever considered building an entire system from back-end to front-end? If you&#039;re experienced, you&#039;ve probably encountered numerous difficulties, from designing data structures and choosing programming languages to libraries\/frameworks\u2026<\/p>","protected":false},"author":63,"featured_media":26663,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33,877,851,626,850],"tags":[],"_links":{"self":[{"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/posts\/26652"}],"collection":[{"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/comments?post=26652"}],"version-history":[{"count":0,"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/posts\/26652\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/media\/26663"}],"wp:attachment":[{"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/media?parent=26652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/categories?post=26652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/tags?post=26652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}