{"id":385232,"date":"2024-06-29T05:59:23","date_gmt":"2024-06-29T05:59:23","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=385232"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-29T05:59:23","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=385232","title":{"rendered":"<span>REST API Firebase \u0438\u043b\u0438 \u043a\u0430\u043a \u043d\u0435 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0434\u043b\u044f \u043f\u0435\u0442-\u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h4>\u0425\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0431\u044d\u043a \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043d\u0430 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0435, \u043d\u043e \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 Firebase. \u0418 \u0435\u0449\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u044d\u0442\u043e \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u043d\u0430 Vercel.<\/h4>\n<p>\u041f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0435 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0435\u0442-\u043f\u0440\u043e\u0435\u043a\u0442\u0430 (\u0431\u0435\u0437 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u043e\u0432 \u043d\u0430 \u044e\u0442\u0443\u0431\u0435 \u0438 \u0442\u0434.). \u0421\u0442\u0435\u043a: React, TypeScript, RTK. \u041f\u0435\u0440\u0432\u043e\u0435 \u0447\u0442\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b \u2014  \u044d\u0442\u043e <a href=\"https:\/\/jsonplaceholder.typicode.com\/\" rel=\"noopener noreferrer nofollow\"><strong>JSON Plaseholder<\/strong><\/a><strong><em>. <\/em><\/strong>\u041d\u043e \u0443 \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435: \u0412\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c API.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9b9\/27f\/3c0\/9b927f3c07f4f4ce8806edc1016e4413.png\" alt=\"\u0440\u0435\u0441\u0443\u0440\u0441\u044b JSON Placeholder\" title=\"\u0440\u0435\u0441\u0443\u0440\u0441\u044b JSON Placeholder\" width=\"952\" height=\"374\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9b9\/27f\/3c0\/9b927f3c07f4f4ce8806edc1016e4413.png\"\/><\/p>\n<div><figcaption>\u0440\u0435\u0441\u0443\u0440\u0441\u044b JSON Placeholder<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0432 \u043f\u043e\u0438\u0441\u043a\u0438 \u044f \u043d\u0430\u0448\u0435\u043b \u0441\u0435\u0440\u0432\u0438\u0441 <a href=\"https:\/\/mockend.com\/\" rel=\"noopener noreferrer nofollow\"><strong>Mockend<\/strong><\/a><strong><em>, <\/em><\/strong>\u043d\u043e \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e 14 \u0434\u043d\u0435\u0439 free trial. \u041c\u044b, \u0434\u0436\u0443\u043d\u044b, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c 1\u043a\u043a $ \u0432 \u043d\u0430\u043d\u043e-\u0441\u0435\u043a\u0443\u043d\u0434\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043e\u0442\u043f\u0430\u0434\u0430\u0435\u0442 \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435, \u0445\u043e\u0442\u044c \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u043c.<\/p>\n<p>\u0418 \u0442\u0443\u0442 \u044f \u0432\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u044e \u0441\u043e\u0432\u0435\u0442 \u043e\u0434\u043d\u043e\u043a\u0443\u0440\u0441\u043d\u0438\u043a\u0430 \u043f\u043e \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0438 (<a href=\"https:\/\/htmlacademy.ru\" rel=\"noopener noreferrer nofollow\">HTML academy<\/a>, \u043f\u0440\u0438\u0432\u0435\u0442) \u2014  <a href=\"https:\/\/firebase.google.com\/\" rel=\"noopener noreferrer nofollow\"><strong>Firebase<\/strong><\/a> \u043e\u0442 Google. \u0421\u0435\u0440\u0432\u0438\u0441 \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0443\u0442\u043e\u0439 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043d\u043e \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441. \u0417\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u043d \u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 firebase \u0432 \u043a\u043e\u0440\u0435\u043d\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0447\u0442\u043e \u043c\u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e REST API \u0434\u043b\u044f CRUD \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0431\u0435\u0437 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u043d\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0445 \u0434\u043b\u044f \u043c\u0435\u043d\u044f <code>firebaseConfig<\/code>, <code>initializeApp<\/code>, <code>collections<\/code> \u0438 \u0442\u0434.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0d0\/565\/f64\/0d0565f64b028b93c416e34bc19eedc5.png\" alt=\"Install the SDK and initialize Firebase\" title=\"Install the SDK and initialize Firebase\" width=\"836\" height=\"432\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0d0\/565\/f64\/0d0565f64b028b93c416e34bc19eedc5.png\"\/><\/p>\n<div><figcaption>Install the SDK and initialize Firebase<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/01d\/82f\/b18\/01d82fb18917a5416c03e794df173d11.png\" alt=\"Access Firebase in your app\" title=\"Access Firebase in your app\" width=\"892\" height=\"449\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/01d\/82f\/b18\/01d82fb18917a5416c03e794df173d11.png\"\/><\/p>\n<div><figcaption>Access Firebase in your app<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u0430, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u0432\u0441\u0435 \u043f\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0443 \u0412\u0430\u0441 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043d\u043e \u043c\u043d\u0435 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u043b. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u043e \u0432\u0441\u0435\u043c \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0434\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e to-do \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u043e\u043d\u043e \u0432\u044b\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0438 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c to do). \u0412\u0441\u0435 \u0447\u0442\u043e \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0443\u0436\u043d\u043e \u2014  \u044d\u0442\u043e \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 API \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u043d\u0438\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 HTTP \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f axios. <\/p>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a96\/8d5\/db1\/a968d5db1176079adf2cb72bbf026d44.png\" alt=\"Product categories\" title=\"Product categories\" width=\"240\" height=\"388\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a96\/8d5\/db1\/a968d5db1176079adf2cb72bbf026d44.png\"\/><\/p>\n<div><figcaption>Product categories<\/figcaption><\/div>\n<\/figure>\n<p>\u0418\u0442\u0430\u043a, \u0432\u044b\u0431\u043e\u0440 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441\u0434\u0435\u043b\u0430\u043d. \u0423 Firebase \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438.<br \/>\u0414\u043b\u044f CRUD \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043c\u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 2 \u0441\u0435\u0440\u0432\u0438\u0441\u0430: <strong>Realtime Database<\/strong> \u0438 <strong>Firestore Database<\/strong>. \u041e\u0442\u043b\u0438\u0447\u0438\u044f \u043c\u043d\u0435 \u043f\u043e\u043a\u0430 \u043d\u0435 \u043e\u0441\u043e\u0431\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b, \u043d\u043e \u0432\u0440\u043e\u0434\u0435 \u043a\u0430\u043a <strong>Firestore Database<\/strong> \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 &#171;\u0442\u044f\u0436\u0435\u043b\u044b\u0445&#187; \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a <strong>Realtime Database<\/strong> \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u043b\u044f \u0447\u0430\u0442\u043e\u0432 \u0438 \u0442\u0434., \u0433\u0434\u0435 \u043d\u0435 \u043d\u0430\u0434\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445. <br \/>\u041d\u0430\u0447\u0438\u043d\u0430\u044e \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0438 \u043d\u0430\u0445\u043e\u0436\u0443, \u0447\u0442\u043e \u0432 \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e\u043c \u0432\u0438\u0434\u0435 REST API \u0435\u0441\u0442\u044c \u0443 <a href=\"https:\/\/firebase.google.com\/docs\/reference\/rest\/database\" rel=\"noopener noreferrer nofollow\"><strong>Realtime Database<\/strong><\/a><strong>, <\/strong>\u043d\u043e \u043e\u043f\u044f\u0442\u044c \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441<strong>.<\/strong><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/133\/95f\/cdb\/13395fcdb138ba8c0ed1a4b2fbf10335.png\" alt=\"REST API Realtime Database \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438\" title=\"REST API Realtime Database \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438\" width=\"864\" height=\"911\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/133\/95f\/cdb\/13395fcdb138ba8c0ed1a4b2fbf10335.png\"\/><\/p>\n<div><figcaption>REST API Realtime Database \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u044e\u0430\u043d\u0441\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u0432 \u0411\u0414 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439. \u0418\u043c\u0435\u043d\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 (\u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>tasks<\/code>) \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u0441\u0430\u043c firebase. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0438\u043c\u044f \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430\u043c \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c POST. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u0438\u0448\u0435\u043b \u043a \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/606\/c79\/e5d\/606c79e5d36def46864fa898d8988ea4.png\" alt=\"\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430\" title=\"\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430\" width=\"1313\" height=\"713\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/606\/c79\/e5d\/606c79e5d36def46864fa898d8988ea4.png\"\/><\/p>\n<div><figcaption>\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0418\u043c\u0435\u044f \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043a\u0430\u043a \u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u0431\u044b \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b \u043a\u0430\u0440\u043a\u0430\u0441 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430 (\u0431\u0435\u0437 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0440\u044b\u0431\u044b. \u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0441\u0440\u0430\u0437\u0443 \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438). \u0412 \u044d\u0442\u043e\u043c \u043c\u043d\u0435 \u043f\u043e\u043c\u043e\u0433 <a href=\"https:\/\/www.postman.com\/\" rel=\"noopener noreferrer nofollow\"><strong>Postman<\/strong><\/a>. \u041d\u0430\u043f\u0438\u0441\u0430\u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043d\u0435 \u0431\u044b \u043f\u043e\u0434\u043e\u0448\u043b\u0430, \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0441\u0432\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 POST \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440. \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \ud83d\ude42<\/p>\n<p>\u041d\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0432 \u0438\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435. \u041c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>id<\/code> \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e id, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 Firebase.<br \/>\u0418\u0442\u043e\u0433\u043e \u0438\u043c\u0435\u044e 2 \u0442\u0438\u043f\u0430 \u0434\u0430\u043d\u043d\u044b\u0445: <br \/>  &#8212; \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0439 \/ \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0439\u0441\u044f \u0432 Store<br \/>  &#8212; \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/590\/032\/f83\/590032f83ccc3570d96405c0285c0b23.png\" alt=\"\u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\" title=\"\u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\" width=\"345\" height=\"507\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/590\/032\/f83\/590032f83ccc3570d96405c0285c0b23.png\"\/><\/p>\n<div><figcaption>\u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u0432 \u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u043a\u0430\u043a \u043e\u043d\u0438 \u043f\u0440\u0438\u0448\u043b\u0438 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0445\u0440\u0430\u043d\u044e \u0432 \u0441\u0442\u043e\u0440\u0435. \u041f\u0443\u0442\u0435\u043c \u043d\u0435\u0445\u0438\u0442\u0440\u044b\u0445 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u0432\u0438\u0434 \u0443\u0436\u0435 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <code>useSelector:<\/code><\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fa6\/346\/95c\/fa634695c973449c846928f690dcab07.png\" alt=\"\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430\" title=\"\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430\" width=\"485\" height=\"119\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fa6\/346\/95c\/fa634695c973449c846928f690dcab07.png\"\/><\/p>\n<div><figcaption>\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0413\u043e\u0442\u043e\u0432\u043e.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/729252\/\"> https:\/\/habr.com\/ru\/articles\/729252\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h4>\u0425\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0431\u044d\u043a \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043d\u0430 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0435, \u043d\u043e \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 Firebase. \u0418 \u0435\u0449\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u044d\u0442\u043e \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u043d\u0430 Vercel.<\/h4>\n<p>\u041f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0435 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0435\u0442-\u043f\u0440\u043e\u0435\u043a\u0442\u0430 (\u0431\u0435\u0437 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u043e\u0432 \u043d\u0430 \u044e\u0442\u0443\u0431\u0435 \u0438 \u0442\u0434.). \u0421\u0442\u0435\u043a: React, TypeScript, RTK. \u041f\u0435\u0440\u0432\u043e\u0435 \u0447\u0442\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b \u2014  \u044d\u0442\u043e <a href=\"https:\/\/jsonplaceholder.typicode.com\/\" rel=\"noopener noreferrer nofollow\"><strong>JSON Plaseholder<\/strong><\/a><strong><em>. <\/em><\/strong>\u041d\u043e \u0443 \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435: \u0412\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c API.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0440\u0435\u0441\u0443\u0440\u0441\u044b JSON Placeholder<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0432 \u043f\u043e\u0438\u0441\u043a\u0438 \u044f \u043d\u0430\u0448\u0435\u043b \u0441\u0435\u0440\u0432\u0438\u0441 <a href=\"https:\/\/mockend.com\/\" rel=\"noopener noreferrer nofollow\"><strong>Mockend<\/strong><\/a><strong><em>, <\/em><\/strong>\u043d\u043e \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e 14 \u0434\u043d\u0435\u0439 free trial. \u041c\u044b, \u0434\u0436\u0443\u043d\u044b, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c 1\u043a\u043a $ \u0432 \u043d\u0430\u043d\u043e-\u0441\u0435\u043a\u0443\u043d\u0434\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043e\u0442\u043f\u0430\u0434\u0430\u0435\u0442 \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435, \u0445\u043e\u0442\u044c \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u043c.<\/p>\n<p>\u0418 \u0442\u0443\u0442 \u044f \u0432\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u044e \u0441\u043e\u0432\u0435\u0442 \u043e\u0434\u043d\u043e\u043a\u0443\u0440\u0441\u043d\u0438\u043a\u0430 \u043f\u043e \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0438 (<a href=\"https:\/\/htmlacademy.ru\" rel=\"noopener noreferrer nofollow\">HTML academy<\/a>, \u043f\u0440\u0438\u0432\u0435\u0442) \u2014  <a href=\"https:\/\/firebase.google.com\/\" rel=\"noopener noreferrer nofollow\"><strong>Firebase<\/strong><\/a> \u043e\u0442 Google. \u0421\u0435\u0440\u0432\u0438\u0441 \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0443\u0442\u043e\u0439 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043d\u043e \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441. \u0417\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u043d \u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 firebase \u0432 \u043a\u043e\u0440\u0435\u043d\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0447\u0442\u043e \u043c\u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e REST API \u0434\u043b\u044f CRUD \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0431\u0435\u0437 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u043d\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0445 \u0434\u043b\u044f \u043c\u0435\u043d\u044f <code>firebaseConfig<\/code>, <code>initializeApp<\/code>, <code>collections<\/code> \u0438 \u0442\u0434.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>Install the SDK and initialize Firebase<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>Access Firebase in your app<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u0430, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u0432\u0441\u0435 \u043f\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0443 \u0412\u0430\u0441 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043d\u043e \u043c\u043d\u0435 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u043b. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u043e \u0432\u0441\u0435\u043c \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0434\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e to-do \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u043e\u043d\u043e \u0432\u044b\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0438 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c to do). \u0412\u0441\u0435 \u0447\u0442\u043e \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0443\u0436\u043d\u043e \u2014  \u044d\u0442\u043e \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 API \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u043d\u0438\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 HTTP \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f axios. <\/p>\n<figure class=\"float\">\n<div><figcaption>Product categories<\/figcaption><\/div>\n<\/figure>\n<p>\u0418\u0442\u0430\u043a, \u0432\u044b\u0431\u043e\u0440 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441\u0434\u0435\u043b\u0430\u043d. \u0423 Firebase \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438.<br \/>\u0414\u043b\u044f CRUD \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043c\u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 2 \u0441\u0435\u0440\u0432\u0438\u0441\u0430: <strong>Realtime Database<\/strong> \u0438 <strong>Firestore Database<\/strong>. \u041e\u0442\u043b\u0438\u0447\u0438\u044f \u043c\u043d\u0435 \u043f\u043e\u043a\u0430 \u043d\u0435 \u043e\u0441\u043e\u0431\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b, \u043d\u043e \u0432\u0440\u043e\u0434\u0435 \u043a\u0430\u043a <strong>Firestore Database<\/strong> \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 &#171;\u0442\u044f\u0436\u0435\u043b\u044b\u0445&#187; \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a <strong>Realtime Database<\/strong> \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u043b\u044f \u0447\u0430\u0442\u043e\u0432 \u0438 \u0442\u0434., \u0433\u0434\u0435 \u043d\u0435 \u043d\u0430\u0434\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445. <br \/>\u041d\u0430\u0447\u0438\u043d\u0430\u044e \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0438 \u043d\u0430\u0445\u043e\u0436\u0443, \u0447\u0442\u043e \u0432 \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e\u043c \u0432\u0438\u0434\u0435 REST API \u0435\u0441\u0442\u044c \u0443 <a href=\"https:\/\/firebase.google.com\/docs\/reference\/rest\/database\" rel=\"noopener noreferrer nofollow\"><strong>Realtime Database<\/strong><\/a><strong>, <\/strong>\u043d\u043e \u043e\u043f\u044f\u0442\u044c \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441<strong>.<\/strong><\/p>\n<figure class=\"full-width\">\n<div><figcaption>REST API Realtime Database \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u044e\u0430\u043d\u0441\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u0432 \u0411\u0414 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439. \u0418\u043c\u0435\u043d\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 (\u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>tasks<\/code>) \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u0441\u0430\u043c firebase. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0438\u043c\u044f \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430\u043c \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c POST. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u0438\u0448\u0435\u043b \u043a \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0418\u043c\u0435\u044f \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043a\u0430\u043a \u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u0431\u044b \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b \u043a\u0430\u0440\u043a\u0430\u0441 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430 (\u0431\u0435\u0437 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0440\u044b\u0431\u044b. \u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0441\u0440\u0430\u0437\u0443 \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438). \u0412 \u044d\u0442\u043e\u043c \u043c\u043d\u0435 \u043f\u043e\u043c\u043e\u0433 <a href=\"https:\/\/www.postman.com\/\" rel=\"noopener noreferrer nofollow\"><strong>Postman<\/strong><\/a>. \u041d\u0430\u043f\u0438\u0441\u0430\u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043d\u0435 \u0431\u044b \u043f\u043e\u0434\u043e\u0448\u043b\u0430, \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0441\u0432\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 POST \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440. \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \ud83d\ude42<\/p>\n<p>\u041d\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0432 \u0438\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435. \u041c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>id<\/code> \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e id, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 Firebase.<br \/>\u0418\u0442\u043e\u0433\u043e \u0438\u043c\u0435\u044e 2 \u0442\u0438\u043f\u0430 \u0434\u0430\u043d\u043d\u044b\u0445: <br \/>  &#8212; \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0439 \/ \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0439\u0441\u044f \u0432 Store<br \/>  &#8212; \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445.<\/p>\n<figure class=\"\">\n<div><figcaption>\u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u0432 \u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u043a\u0430\u043a \u043e\u043d\u0438 \u043f\u0440\u0438\u0448\u043b\u0438 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0445\u0440\u0430\u043d\u044e \u0432 \u0441\u0442\u043e\u0440\u0435. \u041f\u0443\u0442\u0435\u043c \u043d\u0435\u0445\u0438\u0442\u0440\u044b\u0445 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u0432\u0438\u0434 \u0443\u0436\u0435 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <code>useSelector:<\/code><\/p>\n<figure class=\"\">\n<div><figcaption>\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0413\u043e\u0442\u043e\u0432\u043e.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/729252\/\"> https:\/\/habr.com\/ru\/articles\/729252\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-385232","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/385232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=385232"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/385232\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=385232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=385232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=385232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}