{"id":466140,"date":"2025-07-05T15:00:20","date_gmt":"2025-07-05T15:00:20","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=466140"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=466140","title":{"rendered":"<span>\u041e\u043f\u044b\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u043d\u043b\u0430\u0439\u043d-\u043d\u0430\u0441\u0442\u043e\u043b\u043a\u0438: \u043e\u0442 \u0438\u0434\u0435\u0438 \u0434\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/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<p>\u041f\u0430\u0440\u0443 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043d\u043e\u0439 \u0438\u0433\u0440\u043e\u0439, \u0432\u00a0\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0438\u0433\u0440\u0430\u043b \u043e\u043d\u043b\u0430\u0439\u043d \u0441\u00a0\u0434\u0440\u0443\u0437\u044c\u044f\u043c\u0438,\u00a0\u0431\u044b\u043b\u0430 \u00ab\u041c\u043e\u043d\u043e\u043f\u043e\u043b\u0438\u044f\u00bb. \u0421\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043e\u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0434\u043e\u0435\u0434\u0430\u0442\u044c, \u0438 \u043c\u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0447\u0435\u0433\u043e\u2011\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e. \u041c\u043e\u0438\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435\u043c \u0441\u0442\u0430\u043b\u0430 Machi Koro\u00a0\u2014 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0430\u0440\u0442\u043e\u0447\u043d\u0430\u044f \u0438\u0433\u0440\u0430, \u0433\u0434\u0435 \u043f\u043e\u0431\u0435\u0434\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043d\u0435\u00a0\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u00a0\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0441\u0442\u0438, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u00a0\u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438, \u0447\u0442\u043e\u00a0\u0432\u044b\u0433\u043e\u0434\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442 \u0435\u0451 \u043e\u0442 \u00ab\u041c\u043e\u043d\u043e\u043f\u043e\u043b\u0438\u0438\u00bb.<\/p>\n<p>\u041d\u0430\u00a0\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u043d\u0435\u00a0\u043d\u0430\u0448\u0451\u043b \u0434\u043e\u0441\u0442\u043e\u0439\u043d\u044b\u0445 \u043e\u043d\u043b\u0430\u0439\u043d\u2011\u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432 Machi Koro, \u0447\u0442\u043e\u00a0\u0438 \u043f\u043e\u0434\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u043e \u043c\u0435\u043d\u044f \u043a\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0412\u00a0\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e\u00a0\u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: \u043e\u0442\u00a0\u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u0434\u043e\u00a0\u0432\u044b\u0431\u043e\u0440\u0430 \u0441\u0442\u0435\u043a\u0430 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439.<\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a\u00a0\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u044f \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043b \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p><strong>\u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f:<\/strong><\/p>\n<ol>\n<li>\n<p>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f  <\/p>\n<\/li>\n<li>\n<p>\u041c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0435\u0435\u0440\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c<\/p>\n<\/li>\n<li>\n<p>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c\u0438 \u0441\u0435\u0441\u0441\u0438\u044f\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u043d\u043e\u0433\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u043c <\/p>\n<\/li>\n<li>\n<p>\u0410\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u044f \u043f\u043e\u0434 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430  <\/p>\n<\/li>\n<\/ol>\n<p><strong>\u041d\u0435\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f:<\/strong><\/p>\n<ol>\n<li>\n<p>\u041a\u0440\u043e\u0441\u0441-\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u0430\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c (Firefox, Chrome, Edge, Safari, Telegram TWA)<\/p>\n<\/li>\n<li>\n<p>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e UUID \u2014 \u0431\u044d\u043a\u0435\u043d\u0434 \u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c \u2014 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0439 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/Socket.io\" rel=\"noopener noreferrer nofollow\">Socket.io<\/a> \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442-\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>SPA-\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 (\u043e\u0434\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435)<\/p>\n<\/li>\n<li>\n<p>PWA \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u0412\u044b\u0431\u043e\u0440 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0442\u0435\u043a\u0430<\/strong><\/p>\n<p><strong>\u0411\u044d\u043a\u0435\u043d\u0434:<\/strong><\/p>\n<ul>\n<li>\n<p>Node.js \u2014 \u0432\u044b\u0431\u0440\u0430\u043d \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u0443 \u0441 JavaScript \u0438 \u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u0431\u0430\u043b\u0430\u043d\u0441\u0443 \u043c\u0435\u0436\u0434\u0443 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e<\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/Socket.IO\" rel=\"noopener noreferrer nofollow\">Socket.IO<\/a> \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u044f\u0441\u044c \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0431-\u0441\u043e\u043a\u0435\u0442\u0430\u043c\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f\u043c\u0438 (Long Polling \u0438 \u0434\u0440.) \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e <a href=\"http:\/\/Socket.IO\" rel=\"noopener noreferrer nofollow\">Socket.IO<\/a> \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/articles\/498996\/\" rel=\"noopener noreferrer nofollow\">\u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u043d\u0430 \u0425\u0430\u0431\u0440\u0435.<\/p>\n<p><strong>\u0424\u0440\u043e\u043d\u0442\u0435\u043d\u0434:<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.npmjs.com\/package\/react\" rel=\"noopener noreferrer nofollow\">React <\/a>\u2014 \u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.npmjs.com\/package\/right-store\" rel=\"noopener noreferrer nofollow\">Right Store<\/a> \u2014 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c<\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/Socket.IO\" rel=\"noopener noreferrer nofollow\">Socket.IO<\/a> Client \u2014 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u0435\u0431-\u0441\u043e\u043a\u0435\u0442\u0430\u043c\u0438<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.npmjs.com\/package\/vite\" rel=\"noopener noreferrer nofollow\">Vite <\/a>\u2014 \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e\u0442 \u0441\u0442\u0435\u043a \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441 \u2014 \u043d\u0435\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 SEO, \u043d\u043e \u0434\u043b\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0433\u0434\u0435 \u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u044d\u0442\u043e \u043d\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e.<\/p>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0435\u0441\u0448\u043e\u0432\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0435\u0437 \u0411\u0414<\/h3>\n<p><strong>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432<\/strong><\/p>\n<p>\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 (\u043b\u043e\u0433\u0438\u043d\/\u043f\u0430\u0440\u043e\u043b\u044c \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u0446\u0441\u0435\u0442\u0438) \u0441\u043e\u0437\u0434\u0430\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0434\u043b\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<ol>\n<li>\n<p>\u0411\u0430\u0440\u044c\u0435\u0440 \u0432\u0445\u043e\u0434\u0430 \u2014 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u043a\u043e\u043d\u0432\u0435\u0440\u0441\u0438\u044e<\/p>\n<\/li>\n<li>\n<p>\u0418\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u2014 \u0434\u043b\u044f casual-\u0438\u0433\u0440\u044b \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u0438<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u2014 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0411\u0414 \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u0435\u0439<\/p>\n<\/li>\n<\/ol>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435: \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u0430\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0447\u0435\u0440\u0435\u0437 UUID. \u042f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0438 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f UUID<\/p>\n<\/li>\n<li>\n<p>\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 localStorage<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u044f\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u0442 \u0436\u0435 UUID<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"javascript\">export const getAnonUserId = () =&gt; {  \u00a0\u00a0\u00a0\u00a0let userId = localStorage.getItem('userId');  \u00a0\u00a0\u00a0\u00a0if (!userId) {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0userId = window.crypto.randomUUID?.() || Math.random().toString();  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0localStorage.setItem('userId', userId);  \u00a0\u00a0\u00a0\u00a0}  \u00a0\u00a0\u00a0\u00a0return userId;  }<\/code><\/pre>\n<p><strong>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430:<\/strong><\/p>\n<ol>\n<li>\n<p>\u041d\u0443\u043b\u0435\u0432\u043e\u0439 \u043f\u043e\u0440\u043e\u0433 \u0432\u0445\u043e\u0434\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0432\u043e\u0434 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u0430\u0436\u0435 \u043f\u0440\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0445 cookies (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f localStorage)<\/p>\n<\/li>\n<li>\n<p>\u041a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c (Web\/Telegram TWA)<\/p>\n<\/li>\n<li>\n<p>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0438\u043a\u043d\u0435\u0439\u043c\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u0441\u043e\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0433\u0440\u043e\u043a\u043e\u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043d\u0438\u043a\u043d\u0435\u0439\u043c\u044b \u0432\u0440\u043e\u0434\u0435 &#171;\u041f\u0443\u0445\u043b\u044f\u0448&#187; \u0438\u043b\u0438 &#171;\u041a\u0435\u043a\u0441\u0438\u043a&#187;. \u042d\u0442\u043e:<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043b\u0435\u0433\u043a\u0443\u044e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0432 \u043b\u043e\u0431\u0431\u0438<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0432\u0432\u043e\u0434\u0430<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430<\/strong><\/p>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c:<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0411\u0414<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430<\/p>\n<\/li>\n<li>\n<p>\u0425\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 GDPR)<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0443\u0447\u0435\u0442\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<\/ol>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0435\u0435\u0440\u0430: \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430<\/h3>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 \u0444\u0430\u0439\u043b\u0435 index.js, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442:<\/p>\n<ul>\n<li>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e Express-\u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 CORS-\u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <a href=\"http:\/\/Socket.IO\" rel=\"noopener noreferrer nofollow\">Socket.IO<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439<\/p>\n<pre><code class=\"javascript\">import express from 'express'; import cors from 'cors'; import 'dotenv\/config'; import { createServer } from 'http'; import { Server } from 'socket.io'; import { IS_DEV, SESSION_NAME } from '.\/constants\/constants.js'; import { onConnection } from '.\/socket\/index.js'; import '.\/services\/process.service.js';   const PORT = process.env.PORT;   const app = express(); app.use(express.json()); app.use('\/api', routes);   const server = createServer(app);   const io = new Server(server, {   cors: {     origin: '*',     methods: ['GET', 'POST'],   }, });   io.on('connection', (socket) =&gt; {   onConnection(io, socket); });  server.listen(PORT, (error) =&gt; {   if (!error) {     console.log('Server is Successfully Running, and App is listening on port ' + PORT);   } else {     console.log(\"Error occurred, server can't start\", error);   } }); <\/code><\/pre>\n<h3>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0441\u0435\u0441\u0441\u0438\u044f<\/h3>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430 \u0447\u0442\u043e\u0431\u044b \u0441\u044b\u0433\u0440\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435. \u0414\u043b\u044f\u00a0\u044d\u0442\u043e\u0433\u043e \u0431\u044b\u043b\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u041b\u043e\u0431\u0431\u0438. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u044b\u0431\u0440\u0430\u043b \u043a\u043e\u043b-\u0432\u043e \u0438\u0433\u0440\u043e\u043a\u043e\u0432 \u0438 \u043d\u0430\u0436\u0430\u043b \u201c\u0418\u0433\u0440\u0430\u0442\u044c\u201d \u043e\u043d \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u043b\u043e\u0431\u0431\u0438. \u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"javascript\">const sessions = new Map()   const joinSession = (sessionId, userId) =&gt; {   if (sessions.has(sessionId)) {     sessions.get(sessionId).join(userId);   } };   const createSession = (sessionId, userId) =&gt; {   sessions.set(sessionId, new Game(sessionId)); };   const leaveSession = (sessionId, userId) =&gt; {   sessions.get(sessionId).leave(userId); }; <\/code><\/pre>\n<p>\u0418\u0433\u0440\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0439\u0434\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0438\u0433\u0440\u043e\u043a\u043e\u0432.<\/p>\n<p>\u0412\u0435\u0441\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u043b\u043e\u0443 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d \u043d\u0430 UML \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0435:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/421\/5e4\/6b6\/4215e46b6cdd16818426a0343a16e27e.png\" width=\"1600\" height=\"1094\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/421\/5e4\/6b6\/4215e46b6cdd16818426a0343a16e27e.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/421\/5e4\/6b6\/4215e46b6cdd16818426a0343a16e27e.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043d\u043e\u0433\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u0438<\/h3>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043d\u043e\u0433\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u043d\u0438\u043a\u0430\u043a\u0430\u044f CMS. \u0412\u0441\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b \u043b\u0435\u0436\u0430\u043b \u0432 \u043e\u0434\u043d\u043e\u043c JSON \u0444\u0430\u0439\u043b\u0435 \u043d\u0430 \u0444\u0440\u043e\u043d\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u0447\u0442\u043e \u0442\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u043c\u043c\u0438\u0442 \u0438 \u0437\u0430\u043f\u0443\u0448\u0438\u0442\u044c (\u0414\u0430 \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u043d\u043e \u0441\u043e\u0439\u0434\u0435\u0442 \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438\u0437 \u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \ud83d\ude42 ).<\/p>\n<p>\u0418 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e API \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u0432:<\/p>\n<pre><code class=\"javascript\">const AVAILABLE_LANGUAGES = {     'en-US': 0,     'en': 0,     'ru': 1, }   const AVAILABLE_LANGUAGES_KEYS = Object.keys(AVAILABLE_LANGUAGES)   export const getTranslateMap = lang =&gt; Object.entries(TRANSLATIONS).reduce((acc, [k, v]) =&gt; {     acc[k] = v[AVAILABLE_LANGUAGES[lang]]     return acc }, {})   export const translate = (translateMap, key) =&gt; translateMap[key]   export const getLanguageByLocale = () =&gt; {     const lang = window.navigator.language     return AVAILABLE_LANGUAGES_KEYS.includes(lang) ? lang : AVAILABLE_LANGUAGES_KEYS[0] } <\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u0432 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 React context \u0438 \u0434\u0430\u043b\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f hook useTranslate \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434.<\/p>\n<pre><code class=\"javascript\">import { createContext, useCallback, useContext } from \"react\" import { translate } from '..\/services\/translate'   export const ContextTranslate = createContext()   export const useTranslate = () =&gt; {     const translateMap = useContext(ContextTranslate)     return useCallback(key =&gt; translate(translateMap, key), [translateMap]) } <\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f useTranslate:<\/p>\n<pre><code class=\"javascript\">const TranslateExample= () =&gt; {   const t = useTranslate()     return (&lt;p&gt;{t('some.key')}&lt;\/p&gt;) } <\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u044f\u0437\u044b\u043a\u0430 \u0432 \u043c\u0435\u043d\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u044b \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043d\u043e\u0432\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430.<\/p>\n<h3>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u043c <\/h3>\n<p>\u0422\u0435\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u0442\u043e \u043b\u0435\u0433\u043a\u043e! \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0430 body \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0441\u0435 css \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0435 \u0437\u0430 \u0446\u0432\u0435\u0442 \u0438 \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441!<\/p>\n<p>\u0410 \u0432\u043e\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html&gt; &lt;html lang=\"en\"&gt; &lt;head&gt;     &lt;meta charset=\"UTF-8\"&gt;     &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;     &lt;title&gt;Habr&lt;\/title&gt; &lt;\/head&gt; &lt;body&gt;     &lt;style&gt;         body {             --bg-color: #fff;             --text-color: #000;               background-color: var(--bg-color);             color: var(--text-color);               transition: .3s;         }           body.dark {             --bg-color: #000;             --text-color: #fff;         }     &lt;\/style&gt;     &lt;h1&gt;Hello World&lt;\/h1&gt;       &lt;button onclick=\"document.body.classList.toggle('dark')\"&gt;Toggle Theme&lt;\/button&gt; &lt;\/body&gt; &lt;\/html&gt;<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c css \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<h2>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432: Mobile First \u043f\u043e\u0434\u0445\u043e\u0434<\/h2>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 Mobile First? \u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043c\u044b \u0441\u043e\u0437\u043d\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e\u00a0<strong>Mobile First<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442:<\/p>\n<ol>\n<li>\n<p><strong>\u041f\u0435\u0440\u0432\u043e\u043e\u0447\u0435\u0440\u0435\u0434\u043d\u0443\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432<\/strong>\u00a0\u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043e\u0432<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u0432\u043d\u043e\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435<\/strong>\u00a0(progressive enhancement) \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430<\/strong>\u00a0\u043d\u0430\u0434 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438<\/p>\n<\/li>\n<\/ol>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f PWA: \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0441\u0430\u0439\u0442 \u0432 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 PWA &#8212; \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e? Progressive Web Apps \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u043e\u043d\u043b\u0430\u0439\u043d-\u0438\u0433\u0440:<\/p>\n<ul>\n<li>\n<p><strong>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043d\u0430 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0439 \u044d\u043a\u0440\u0430\u043d<\/strong>\u00a0(\u043a\u0430\u043a \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435)<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0444\u0444\u043b\u0430\u0439\u043d-\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c<\/strong>\u00a0(\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Service Worker)<\/p>\n<\/li>\n<li>\n<p><strong>Push-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f<\/strong>\u00a0(\u0434\u043b\u044f \u0432\u043e\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439)<\/p>\n<\/li>\n<li>\n<p><strong>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f<\/strong><\/p>\n<\/li>\n<\/ul>\n<h3>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f PWA<\/h3>\n<ol>\n<li>\n<p><strong>Manifest \u0444\u0430\u0439\u043b<\/strong>\u00a0(<code>manifest.json<\/code>)<\/p>\n<\/li>\n<li>\n<p><strong>Service Worker<\/strong>\u00a0(\u0434\u043b\u044f \u043e\u0444\u0444\u043b\u0430\u0439\u043d-\u0440\u0435\u0436\u0438\u043c\u0430)<\/p>\n<\/li>\n<li>\n<p><strong>HTTPS \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435<\/strong>\u00a0(\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435)<\/p>\n<\/li>\n<li>\n<p><strong>\u0410\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u044b\u0439 \u0434\u0438\u0437\u0430\u0439\u043d<\/strong>\u00a0(\u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0447\u0435\u0440\u0435\u0437 Mobile First)<\/p>\n<\/li>\n<\/ol>\n<h4>Manifest \u0444\u0430\u0439\u043b (public\/manifest.json)<\/h4>\n<pre><code class=\"json\">{           id: \"https:\/\/www.cardscity.online\/\",           name: \"Cards City\",           short_name: \"Cards City\",           display: \"standalone\",           description:             \"Welcome to CardsCity - an exciting online card strategy game where you build your unique city, one card at a time. Your goal is to build 3 gold-colored enterprises. Create your own decks, open reward boxes to get more cards, and think strategically to win game battles.\",           categories: [\"entertainment\", \"games\", \"kids\"],           launch_handler: {             client_mode: \"auto\",           },           orientation: \"any\",           dir: \"ltr\",           related_applications: [],           prefer_related_applications: true,           screenshots: [             {               src: \"assets\/screenshots\/screenshot_mainScreen_narrow_375_667.png\",               sizes: \"375x667\",               type: \"image\/png\",               form_factor: \"narrow\",               label: \"\u0418\u0433\u0440\u0430 Cards City\",             },             {               src: \"assets\/screenshots\/screenshot_mainScreen_wide_1920_1080.png\",               sizes: \"1920x1080\",               type: \"image\/png\",               form_factor: \"wide\",               label: \"\u0418\u0433\u0440\u0430 Cards City\",             },           ],           theme_color: \"#ffffff\",           background_color: \"#ffffff\",           icons: [             {               src: \".\/logo512.png\",               sizes: \"512x512\",               type: \"image\/png\",               purpose: \"maskable\",             },             {               src: \".\/logo256.png\",               sizes: \"256x256\",               type: \"image\/png\",             },             {               src: \".\/logo144.png\",               sizes: \"144x144\",               type: \"image\/png\",               purpose: \"any\",             },             {               src: \".\/logo128.png\",               sizes: \"128x128\",               type: \"image\/png\",             },             {               src: \".\/logo64.png\",               sizes: \"64x64\",               type: \"image\/png\",               purpose: \"any\",             },             {               src: \".\/logo32.png\",               sizes: \"32x32\",               type: \"image\/png\",               purpose: \"any\",             },           ],         } <\/code><\/pre>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b <a href=\"https:\/\/vite-pwa-org.netlify.app\/\" rel=\"noopener noreferrer nofollow\">VitePWA <\/a>\u2014 \u043c\u043e\u0449\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f PWA \u0432 Vite<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u00a0<strong>vite-plugin-pwa<\/strong>\u00a0\u2014 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f Vite, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442:<\/p>\n<ol>\n<li>\n<p>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e Service Worker<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0435-\u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430 \u0438 \u0438\u043a\u043e\u043d\u043e\u043a<\/p>\n<\/li>\n<\/ol>\n<h4>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f VitePWA (vite.config.js)<\/h4>\n<pre><code class=\"json\">{ registerType: \"autoUpdate\",         workbox: {           cleanupOutdatedCaches: true,           globPatterns: [\"**\/*.{js,css,html,ico,png,svg,gif,mp3,webp,webm}\"],           skipWaiting: true,           clientsClaim: true,           maximumFileSizeToCacheInBytes: 300 * 1024 ** 2,           runtimeCaching: [             {               urlPattern: \/\\.(?:png|jpg|jpeg|svg|gif|mp3|webp|webm)$\/,               handler: \"CacheFirst\",               options: {                 cacheName: \"media-cache\",                 expiration: {                   maxEntries: 100,                   maxAgeSeconds: 7 * 24 * 60 * 60,                 },               },             },           ],         }, manifest: {} } <\/code><\/pre>\n<p>\u041d\u043e \u044d\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u0432\u0441\u0435! \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0441\u0430\u0439\u0442 \u0441 PWA \u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <a href=\"https:\/\/www.pwabuilder.com\/\" rel=\"noopener noreferrer nofollow\">https:\/\/www.pwabuilder.com\/<\/a>\u00a0<\/p>\n<p>\u042f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c IOS \u0438 Android \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0442\u0443\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0439\u0442\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438: <a href=\"https:\/\/docs.pwabuilder.com\/#\/builder\/quick-start\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.pwabuilder.com\/#\/builder\/quick-start<\/a><\/p>\n<h2>React + Right Store: \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u043d\u043b\u0430\u0439\u043d-\u0438\u0433\u0440\u044b<\/h2>\n<p>\u0414\u043b\u044f \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 React \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c:<\/p>\n<h4>1. \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434<\/h4>\n<ul>\n<li>\n<p><strong>\u041f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0441\u0442\u044c<\/strong>\u00a0\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 (\u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438, \u043a\u043d\u043e\u043f\u043a\u0438, \u043c\u043e\u0434\u0430\u043b\u043a\u0438)<\/p>\n<\/li>\n<li>\n<p><strong>\u0427\u0435\u0442\u043a\u043e\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438<\/strong>\u00a0\u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/strong>\u00a0\u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430<\/p>\n<\/li>\n<\/ul>\n<h4>2. \u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/h4>\n<ul>\n<li>\n<p>\u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 DOM \u0434\u043b\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u043c\u043e\u0438\u0437\u0430\u0446\u0438\u044e: (useMemo, useCallback, Pure Functions)<\/p>\n<\/li>\n<\/ul>\n<h4>3. \u042d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430<\/h4>\n<ul>\n<li>\n<p>\u0411\u043e\u0433\u0430\u0442\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 TypeScript \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Vite \u0434\u043b\u044f \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430<\/p>\n<\/li>\n<\/ul>\n<h3>Right Store &#8212; \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c<\/h3>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/www.npmjs.com\/package\/right-store\" rel=\"noopener noreferrer nofollow\">Right Store<\/a> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 API:<\/p>\n<pre><code class=\"javascript\">import { useEffect } from 'react' import { createStore } from 'right-store'  type Count = number  const Store = createStore({     initialState: { count: 0 } })  const { useSelector, patchState, getState } = Store const Counter = () =&gt; {     const count: Count = useSelector(state =&gt; state.count)      \/\/ Watcher     useEffect(() =&gt; {         console.log('Count has been updated: ', getState().count)     }, [getState().count])      return (         &lt;div&gt;             &lt;div&gt;                 &lt;button onClick={() =&gt; patchState('count', (count: Count) =&gt; count + 1)}&gt;Increment&lt;\/button&gt;                 &lt;button onClick={() =&gt; patchState('count', count - 1)}&gt;Decrement&lt;\/button&gt;                 &lt;button onClick={() =&gt; console.log(getState())}&gt;Get State&lt;\/button&gt;             &lt;\/div&gt;             &lt;h1&gt;Count is: {count}&lt;\/h1&gt;         &lt;\/div&gt;     ) }<\/code><\/pre>\n<h2>\u0418\u0442\u043e\u0433\u0438. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h2>\n<ol>\n<li>\n<p><strong>\u0423\u0441\u043f\u0435\u0448\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/strong>\u00a0\u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0439 \u043e\u043d\u043b\u0430\u0439\u043d-\u0432\u0435\u0440\u0441\u0438\u0438 <a href=\"https:\/\/www.cardscity.online\/\" rel=\"noopener noreferrer nofollow\">Cards City<\/a><\/p>\n<\/li>\n<li>\n<p><strong>\u0421\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430<\/strong>\u00a0\u043f\u0440\u0438 500+ \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u0445<\/p>\n<\/li>\n<li>\n<p><strong>\u041a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c<\/strong>\u00a0(Web, PWA, iOS, Android)<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043e\u0442\u0437\u044b\u0432\u044b<\/strong>\u00a0\u043e\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043d\u044b\u0445 \u0438\u0433\u0440<\/p>\n<\/li>\n<\/ol>\n<h3>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<ul>\n<li>\n<p><strong>70%<\/strong>\u00a0\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u2014 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<\/li>\n<li>\n<p><strong>10%<\/strong>\u00a0\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a \u0447\u0435\u0440\u0435\u0437 PWA<\/p>\n<\/li>\n<li>\n<p><strong>\u0421\u0440\u0435\u0434\u043d\u044f\u044f \u0441\u0435\u0441\u0441\u0438\u044f<\/strong>\u00a0\u2014 14 \u043c\u0438\u043d\u0443\u0442<\/p>\n<\/li>\n<li>\n<p><strong>Retention (D7)<\/strong>\u00a0\u2014 35%<\/p>\n<\/li>\n<\/ul>\n<h3>\u0413\u043b\u0430\u0432\u043d\u044b\u0435 \u0443\u0440\u043e\u043a\u0438<\/h3>\n<ol>\n<li>\n<p><strong>\u041d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/strong><\/p>\n<ul>\n<li>\n<p>UUID-\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439<\/p>\n<\/li>\n<li>\n<p>Right Store \u0432\u043c\u0435\u0441\u0442\u043e Redux<\/p>\n<\/li>\n<li>\n<p>JSON-\u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b \u0432\u043c\u0435\u0441\u0442\u043e i18n-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Mobile First \u2014 \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c<\/strong><\/p>\n<ul>\n<li>\n<p>3 \u0438\u0437 4 \u0438\u0433\u0440\u043e\u043a\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435<\/p>\n<\/li>\n<li>\n<p>\u0423\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435 UI \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u043b\u0443\u0447\u0448\u0435\u0439 UX \u043d\u0430 \u0432\u0441\u0435\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>PWA \u2014 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0434\u043b\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u044b\u0445 \u0438\u0433\u0440<\/strong><\/p>\n<ul>\n<li>\n<p>\u041d\u0438\u0437\u043a\u0438\u0439 \u0431\u0430\u0440\u044c\u0435\u0440 \u0432\u0445\u043e\u0434\u0430<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430\u0445<\/p>\n<\/li>\n<li>\n<p>\u041e\u0444\u0444\u043b\u0430\u0439\u043d-\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u0421\u043e\u043a\u0435\u0442\u044b \u0440\u0435\u0448\u0430\u044e\u0442<\/strong>\u00a0\u0434\u043b\u044f \u043e\u043d\u043b\u0430\u0439\u043d-\u0438\u0433\u0440<\/p>\n<ul>\n<li>\n<p>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0434\u0435\u0436\u043d\u043e\u0435 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 \u0434\u0432\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430) \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 multiplayer-\u043f\u0440\u043e\u0434\u0443\u043a\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0441\u043e\u0437\u043d\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044f\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435! \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \ud83d\ude42<\/p>\n<p>\u0410 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0438\u0433\u0440\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0430\u043c:<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/www.cardscity.online\/\" rel=\"noopener noreferrer nofollow\">\u041c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0435\u0435\u0440<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/yandex.com\/games\/app\/378942?utm_source=game_popup_menu\" rel=\"noopener noreferrer nofollow\">\u041e\u0434\u043d\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u043d\u0430 \u042f\u043d\u0434\u0435\u043a\u0441 \u0418\u0433\u0440\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/t.me\/cardsCityOnline_bot\" rel=\"noopener noreferrer nofollow\">Telegram Web App<\/a><\/p>\n<\/li>\n<\/ol>\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\/925236\/\"> https:\/\/habr.com\/ru\/articles\/925236\/<\/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<p>\u041f\u0430\u0440\u0443 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043d\u043e\u0439 \u0438\u0433\u0440\u043e\u0439, \u0432\u00a0\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0438\u0433\u0440\u0430\u043b \u043e\u043d\u043b\u0430\u0439\u043d \u0441\u00a0\u0434\u0440\u0443\u0437\u044c\u044f\u043c\u0438,\u00a0\u0431\u044b\u043b\u0430 \u00ab\u041c\u043e\u043d\u043e\u043f\u043e\u043b\u0438\u044f\u00bb. \u0421\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043e\u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0434\u043e\u0435\u0434\u0430\u0442\u044c, \u0438 \u043c\u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0447\u0435\u0433\u043e\u2011\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e. \u041c\u043e\u0438\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435\u043c \u0441\u0442\u0430\u043b\u0430 Machi Koro\u00a0\u2014 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0430\u0440\u0442\u043e\u0447\u043d\u0430\u044f \u0438\u0433\u0440\u0430, \u0433\u0434\u0435 \u043f\u043e\u0431\u0435\u0434\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043d\u0435\u00a0\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u00a0\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0441\u0442\u0438, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u00a0\u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438, \u0447\u0442\u043e\u00a0\u0432\u044b\u0433\u043e\u0434\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442 \u0435\u0451 \u043e\u0442 \u00ab\u041c\u043e\u043d\u043e\u043f\u043e\u043b\u0438\u0438\u00bb.<\/p>\n<p>\u041d\u0430\u00a0\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u043d\u0435\u00a0\u043d\u0430\u0448\u0451\u043b \u0434\u043e\u0441\u0442\u043e\u0439\u043d\u044b\u0445 \u043e\u043d\u043b\u0430\u0439\u043d\u2011\u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432 Machi Koro, \u0447\u0442\u043e\u00a0\u0438 \u043f\u043e\u0434\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u043e \u043c\u0435\u043d\u044f \u043a\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0412\u00a0\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e\u00a0\u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: \u043e\u0442\u00a0\u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u0434\u043e\u00a0\u0432\u044b\u0431\u043e\u0440\u0430 \u0441\u0442\u0435\u043a\u0430 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439.<\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a\u00a0\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u044f \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043b \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p><strong>\u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f:<\/strong><\/p>\n<ol>\n<li>\n<p>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f  <\/p>\n<\/li>\n<li>\n<p>\u041c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0435\u0435\u0440\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c<\/p>\n<\/li>\n<li>\n<p>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c\u0438 \u0441\u0435\u0441\u0441\u0438\u044f\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u043d\u043e\u0433\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u043c <\/p>\n<\/li>\n<li>\n<p>\u0410\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u044f \u043f\u043e\u0434 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430  <\/p>\n<\/li>\n<\/ol>\n<p><strong>\u041d\u0435\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f:<\/strong><\/p>\n<ol>\n<li>\n<p>\u041a\u0440\u043e\u0441\u0441-\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u0430\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c (Firefox, Chrome, Edge, Safari, Telegram TWA)<\/p>\n<\/li>\n<li>\n<p>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e UUID \u2014 \u0431\u044d\u043a\u0435\u043d\u0434 \u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c \u2014 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0439 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/Socket.io\" rel=\"noopener noreferrer nofollow\">Socket.io<\/a> \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442-\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>SPA-\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 (\u043e\u0434\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435)<\/p>\n<\/li>\n<li>\n<p>PWA \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u0412\u044b\u0431\u043e\u0440 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0442\u0435\u043a\u0430<\/strong><\/p>\n<p><strong>\u0411\u044d\u043a\u0435\u043d\u0434:<\/strong><\/p>\n<ul>\n<li>\n<p>Node.js \u2014 \u0432\u044b\u0431\u0440\u0430\u043d \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u0443 \u0441 JavaScript \u0438 \u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u0431\u0430\u043b\u0430\u043d\u0441\u0443 \u043c\u0435\u0436\u0434\u0443 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e<\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/Socket.IO\" rel=\"noopener noreferrer nofollow\">Socket.IO<\/a> \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u044f\u0441\u044c \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0431-\u0441\u043e\u043a\u0435\u0442\u0430\u043c\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f\u043c\u0438 (Long Polling \u0438 \u0434\u0440.) \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e <a href=\"http:\/\/Socket.IO\" rel=\"noopener noreferrer nofollow\">Socket.IO<\/a> \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/articles\/498996\/\" rel=\"noopener noreferrer nofollow\">\u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u043d\u0430 \u0425\u0430\u0431\u0440\u0435.<\/p>\n<p><strong>\u0424\u0440\u043e\u043d\u0442\u0435\u043d\u0434:<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.npmjs.com\/package\/react\" rel=\"noopener noreferrer nofollow\">React <\/a>\u2014 \u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.npmjs.com\/package\/right-store\" rel=\"noopener noreferrer nofollow\">Right Store<\/a> \u2014 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c<\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/Socket.IO\" rel=\"noopener noreferrer nofollow\">Socket.IO<\/a> Client \u2014 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u0435\u0431-\u0441\u043e\u043a\u0435\u0442\u0430\u043c\u0438<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.npmjs.com\/package\/vite\" rel=\"noopener noreferrer nofollow\">Vite <\/a>\u2014 \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e\u0442 \u0441\u0442\u0435\u043a \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441 \u2014 \u043d\u0435\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 SEO, \u043d\u043e \u0434\u043b\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0433\u0434\u0435 \u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u044d\u0442\u043e \u043d\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e.<\/p>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0435\u0441\u0448\u043e\u0432\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0435\u0437 \u0411\u0414<\/h3>\n<p><strong>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432<\/strong><\/p>\n<p>\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 (\u043b\u043e\u0433\u0438\u043d\/\u043f\u0430\u0440\u043e\u043b\u044c \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u0446\u0441\u0435\u0442\u0438) \u0441\u043e\u0437\u0434\u0430\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0434\u043b\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<ol>\n<li>\n<p>\u0411\u0430\u0440\u044c\u0435\u0440 \u0432\u0445\u043e\u0434\u0430 \u2014 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u043a\u043e\u043d\u0432\u0435\u0440\u0441\u0438\u044e<\/p>\n<\/li>\n<li>\n<p>\u0418\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u2014 \u0434\u043b\u044f casual-\u0438\u0433\u0440\u044b \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u0438<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u2014 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0411\u0414 \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u0435\u0439<\/p>\n<\/li>\n<\/ol>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435: \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u0430\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0447\u0435\u0440\u0435\u0437 UUID. \u042f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0438 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f UUID<\/p>\n<\/li>\n<li>\n<p>\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 localStorage<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u044f\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u0442 \u0436\u0435 UUID<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"javascript\">export const getAnonUserId = () =&gt; {  \u00a0\u00a0\u00a0\u00a0let userId = localStorage.getItem('userId');  \u00a0\u00a0\u00a0\u00a0if (!userId) {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0userId = window.crypto.randomUUID?.() || Math.random().toString();  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0localStorage.setItem('userId', userId);  \u00a0\u00a0\u00a0\u00a0}  \u00a0\u00a0\u00a0\u00a0return userId;  }<\/code><\/pre>\n<p><strong>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430:<\/strong><\/p>\n<ol>\n<li>\n<p>\u041d\u0443\u043b\u0435\u0432\u043e\u0439 \u043f\u043e\u0440\u043e\u0433 \u0432\u0445\u043e\u0434\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0432\u043e\u0434 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u0430\u0436\u0435 \u043f\u0440\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0445 cookies (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f localStorage)<\/p>\n<\/li>\n<li>\n<p>\u041a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c (Web\/Telegram TWA)<\/p>\n<\/li>\n<li>\n<p>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0438\u043a\u043d\u0435\u0439\u043c\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u0441\u043e\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0433\u0440\u043e\u043a\u043e\u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043d\u0438\u043a\u043d\u0435\u0439\u043c\u044b \u0432\u0440\u043e\u0434\u0435 &#171;\u041f\u0443\u0445\u043b\u044f\u0448&#187; \u0438\u043b\u0438 &#171;\u041a\u0435\u043a\u0441\u0438\u043a&#187;. \u042d\u0442\u043e:<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043b\u0435\u0433\u043a\u0443\u044e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0432 \u043b\u043e\u0431\u0431\u0438<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0432\u0432\u043e\u0434\u0430<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430<\/strong><\/p>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c:<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0411\u0414<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430<\/p>\n<\/li>\n<li>\n<p>\u0425\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 GDPR)<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0443\u0447\u0435\u0442\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<\/ol>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0435\u0435\u0440\u0430: \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430<\/h3>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 \u0444\u0430\u0439\u043b\u0435 index.js, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442:<\/p>\n<ul>\n<li>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e Express-\u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 CORS-\u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <a href=\"http:\/\/Socket.IO\" rel=\"noopener noreferrer nofollow\">Socket.IO<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439<\/p>\n<pre><code class=\"javascript\">import express from 'express'; import cors from 'cors'; import 'dotenv\/config'; import { createServer } from 'http'; import { Server } from 'socket.io'; import { IS_DEV, SESSION_NAME } from '.\/constants\/constants.js'; import { onConnection } from '.\/socket\/index.js'; import '.\/services\/process.service.js';   const PORT = process.env.PORT;   const app = express(); app.use(express.json()); app.use('\/api', routes);   const server = createServer(app);   const io = new Server(server, {   cors: {     origin: '*',     methods: ['GET', 'POST'],   }, });   io.on('connection', (socket) =&gt; {   onConnection(io, socket); });  server.listen(PORT, (error) =&gt; {   if (!error) {     console.log('Server is Successfully Running, and App is listening on port ' + PORT);   } else {     console.log(\"Error occurred, server can't start\", error);   } }); <\/code><\/pre>\n<h3>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0441\u0435\u0441\u0441\u0438\u044f<\/h3>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430 \u0447\u0442\u043e\u0431\u044b \u0441\u044b\u0433\u0440\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435. \u0414\u043b\u044f\u00a0\u044d\u0442\u043e\u0433\u043e \u0431\u044b\u043b\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u041b\u043e\u0431\u0431\u0438. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u044b\u0431\u0440\u0430\u043b \u043a\u043e\u043b-\u0432\u043e \u0438\u0433\u0440\u043e\u043a\u043e\u0432 \u0438 \u043d\u0430\u0436\u0430\u043b \u201c\u0418\u0433\u0440\u0430\u0442\u044c\u201d \u043e\u043d \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u043b\u043e\u0431\u0431\u0438. \u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"javascript\">const sessions = new Map()   const joinSession = (sessionId, userId) =&gt; {   if (sessions.has(sessionId)) {     sessions.get(sessionId).join(userId);   } };   const createSession = (sessionId, userId) =&gt; {   sessions.set(sessionId, new Game(sessionId)); };   const leaveSession = (sessionId, userId) =&gt; {   sessions.get(sessionId).leave(userId); }; <\/code><\/pre>\n<p>\u0418\u0433\u0440\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0439\u0434\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0438\u0433\u0440\u043e\u043a\u043e\u0432.<\/p>\n<p>\u0412\u0435\u0441\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u043b\u043e\u0443 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d \u043d\u0430 UML \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0435:<\/p>\n<figure class=\"full-width\"><\/figure>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043d\u043e\u0433\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u0438<\/h3>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043d\u043e\u0433\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u043d\u0438\u043a\u0430\u043a\u0430\u044f CMS. \u0412\u0441\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b \u043b\u0435\u0436\u0430\u043b \u0432 \u043e\u0434\u043d\u043e\u043c JSON \u0444\u0430\u0439\u043b\u0435 \u043d\u0430 \u0444\u0440\u043e\u043d\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u0447\u0442\u043e \u0442\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u043c\u043c\u0438\u0442 \u0438 \u0437\u0430\u043f\u0443\u0448\u0438\u0442\u044c (\u0414\u0430 \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u043d\u043e \u0441\u043e\u0439\u0434\u0435\u0442 \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438\u0437 \u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \ud83d\ude42 ).<\/p>\n<p>\u0418 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e API \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u0432:<\/p>\n<pre><code class=\"javascript\">const AVAILABLE_LANGUAGES = {     'en-US': 0,     'en': 0,     'ru': 1, }   const AVAILABLE_LANGUAGES_KEYS = Object.keys(AVAILABLE_LANGUAGES)   export const getTranslateMap = lang =&gt; Object.entries(TRANSLATIONS).reduce((acc, [k, v]) =&gt; {     acc[k] = v[AVAILABLE_LANGUAGES[lang]]     return acc }, {})   export const translate = (translateMap, key) =&gt; translateMap[key]   export const getLanguageByLocale = () =&gt; {     const lang = window.navigator.language     return AVAILABLE_LANGUAGES_KEYS.includes(lang) ? lang : AVAILABLE_LANGUAGES_KEYS[0] } <\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u0432 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 React context \u0438 \u0434\u0430\u043b\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f hook useTranslate \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434.<\/p>\n<pre><code class=\"javascript\">import { createContext, useCallback, useContext } from \"react\" import { translate } from '..\/services\/translate'   export const ContextTranslate = createContext()   export const useTranslate = () =&gt; {     const translateMap = useContext(ContextTranslate)     return useCallback(key =&gt; translate(translateMap, key), [translateMap]) } <\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f useTranslate:<\/p>\n<pre><code class=\"javascript\">const TranslateExample= () =&gt; {   const t = useTranslate()     return (&lt;p&gt;{t('some.key')}&lt;\/p&gt;) } <\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u044f\u0437\u044b\u043a\u0430 \u0432 \u043c\u0435\u043d\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u044b \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043d\u043e\u0432\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430.<\/p>\n<h3>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u043c <\/h3>\n<p>\u0422\u0435\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u0442\u043e \u043b\u0435\u0433\u043a\u043e! \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0430 body \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0441\u0435 css \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0435 \u0437\u0430 \u0446\u0432\u0435\u0442 \u0438 \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441!<\/p>\n<p>\u0410 \u0432\u043e\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html&gt; &lt;html lang=\"en\"&gt; &lt;head&gt;     &lt;meta charset=\"UTF-8\"&gt;     &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;     &lt;title&gt;Habr&lt;\/title&gt; &lt;\/head&gt; &lt;body&gt;     &lt;style&gt;         body {             --bg-color: #fff;             --text-color: #000;               background-color: var(--bg-color);             color: var(--text-color);               transition: .3s;         }           body.dark {             --bg-color: #000;             --text-color: #fff;         }     &lt;\/style&gt;     &lt;h1&gt;Hello World&lt;\/h1&gt;       &lt;button onclick=\"document.body.classList.toggle('dark')\"&gt;Toggle Theme&lt;\/button&gt; &lt;\/body&gt; &lt;\/html&gt;<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c css \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<h2>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432: Mobile First \u043f\u043e\u0434\u0445\u043e\u0434<\/h2>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 Mobile First? \u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043c\u044b \u0441\u043e\u0437\u043d\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e\u00a0<strong>Mobile First<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442:<\/p>\n<ol>\n<li>\n<p><strong>\u041f\u0435\u0440\u0432\u043e\u043e\u0447\u0435\u0440\u0435\u0434\u043d\u0443\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432<\/strong>\u00a0\u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043e\u0432<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u0432\u043d\u043e\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435<\/strong>\u00a0(progressive enhancement) \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430<\/strong>\u00a0\u043d\u0430\u0434 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438<\/p>\n<\/li>\n<\/ol>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f PWA: \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0441\u0430\u0439\u0442 \u0432 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 PWA &#8212; \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e? Progressive Web Apps \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u043e\u043d\u043b\u0430\u0439\u043d-\u0438\u0433\u0440:<\/p>\n<ul>\n<li>\n<p><strong>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043d\u0430 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0439 \u044d\u043a\u0440\u0430\u043d<\/strong>\u00a0(\u043a\u0430\u043a \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435)<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0444\u0444\u043b\u0430\u0439\u043d-\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c<\/strong>\u00a0(\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Service Worker)<\/p>\n<\/li>\n<li>\n<p><strong>Push-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f<\/strong>\u00a0(\u0434\u043b\u044f \u0432\u043e\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439)<\/p>\n<\/li>\n<li>\n<p><strong>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f<\/strong><\/p>\n<\/li>\n<\/ul>\n<h3>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f PWA<\/h3>\n<ol>\n<li>\n<p><strong>Manifest \u0444\u0430\u0439\u043b<\/strong>\u00a0(<code>manifest.json<\/code>)<\/p>\n<\/li>\n<li>\n<p><strong>Service Worker<\/strong>\u00a0(\u0434\u043b\u044f \u043e\u0444\u0444\u043b\u0430\u0439\u043d-\u0440\u0435\u0436\u0438\u043c\u0430)<\/p>\n<\/li>\n<li>\n<p><strong>HTTPS \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435<\/strong>\u00a0(\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435)<\/p>\n<\/li>\n<li>\n<p><strong>\u0410\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u044b\u0439 \u0434\u0438\u0437\u0430\u0439\u043d<\/strong>\u00a0(\u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0447\u0435\u0440\u0435\u0437 Mobile First)<\/p>\n<\/li>\n<\/ol>\n<h4>Manifest \u0444\u0430\u0439\u043b (public\/manifest.json)<\/h4>\n<pre><code class=\"json\">{           id: \"https:\/\/www.cardscity.online\/\",           name: \"Cards City\",           short_name: \"Cards City\",           display: \"standalone\",           description:             \"Welcome to CardsCity - an exciting online card strategy game where you build your unique city, one card at a time. Your goal is to build 3 gold-colored enterprises. Create your own decks, open reward boxes to get more cards, and think strategically to win game battles.\",           categories: [\"entertainment\", \"games\", \"kids\"],           launch_handler: {             client_mode: \"auto\",           },           orientation: \"any\",           dir: \"ltr\",           related_applications: [],           prefer_related_applications: true,           screenshots: [             {               src: \"assets\/screenshots\/screenshot_mainScreen_narrow_375_667.png\",               sizes: \"375x667\",               type: \"image\/png\",               form_factor: \"narrow\",               label: \"\u0418\u0433\u0440\u0430 Cards City\",             },             {               src: \"assets\/screenshots\/screenshot_mainScreen_wide_1920_1080.png\",               sizes: \"1920x1080\",               type: \"image\/png\",               form_factor: \"wide\",               label: \"\u0418\u0433\u0440\u0430 Cards City\",             },           ],           theme_color:<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-466140","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/466140","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=466140"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/466140\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=466140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=466140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=466140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}