{"componentChunkName":"component---src-templates-blog-list-template-js","path":"/131","result":{"data":{"allMarkdownRemark":{"edges":[{"node":{"excerpt":"You’re probably hosting your MongoDB on a reliable cloud service provider say Atlas for instance because you really want to focus on your…","fields":{"slug":"/engineering/self-hosted-mongo/"},"html":"<p>You’re probably hosting your MongoDB on a reliable cloud service provider say <a href=\"https://cloud.mongodb.com\">Atlas</a> for instance because you really want to focus on your idea and delegate all the subtle key management areas such as networking, storage, access, etc.</p>\n<p>It all looks good initially until your small idea starts turning into a business and the cost starts skyrocketing. Even if that is not the case, this post will still give you a general overview of the technical complexities involved (and bucks saved!) if you were to migrate to a self-hosted solution.</p>\n<p>BTW, how much savings are we talking about? Let’s do a quick comparison between an <strong>Atlas</strong> instance and a self-hosted MongoDB on <strong>AWS</strong>.</p>\n<p><strong>Atlas (~$166/month)</strong></p>\n<p><img src=\"/94fecf1b8693eb8cee36cf67cd0b3c27/atlas.webp\" alt=\"&#x22;Atlas Pricing&#x22;\" title=\"Atlas Pricing\">\n$0.23/hour based on the above-selected requirements (~ <a href=\"https://cloud.mongodb.com\">cloud.mongodb.com</a>)</p>\n<p><br><br><strong>AWS (~$36/month)</strong>\n<img src=\"/b206ff21d0982a656091f9f9d0338ed8/aws.webp\" alt=\"&#x22;AWS Pricing&#x22;\" title=\"AWS Pricing\"></p>\n<p>$0.0416/hour for the instance and additional pricing based on the EBS type and storage (~ <a href=\"https://calculator.aws/\">calculator.aws</a>)</p>\n<blockquote>\n<p>It is almost 4.5x savings just in terms of the infrastructure!</p>\n</blockquote>\n<p>Now that you know the major why(s) and are still reading this post, without further ado, let’s dive into the tech.</p>\n<hr />\n<h1 id=\"outline\" style=\"position:relative;\"><a href=\"#outline\" aria-label=\"outline permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Outline</h1>\n<ol>\n<li>Setting up the infrastructure</li>\n<li>Setting up MongoDB</li>\n<li>Bulk migration</li>\n<li>Delta-sync to bridge the connection switch latency (not applicable to stale clusters)</li>\n</ol>\n<p>Since the entire content can be a bit exhausting in one place, I’m going to divide this into 2 related posts.</p>\n<h1 id=\"1-setting-up-the-infrastructure\" style=\"position:relative;\"><a href=\"#1-setting-up-the-infrastructure\" aria-label=\"1 setting up the infrastructure permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1. Setting up the Infrastructure</h1>\n<p>I’m going to mention below the guide for setting up an instance running <strong>RedHat Enterprise Linux 8</strong> on AWS. This is because MongoDB generally performs better with the xfs file-system.</p>\n<h2 id=\"spin-up-an-ec2-instance\" style=\"position:relative;\"><a href=\"#spin-up-an-ec2-instance\" aria-label=\"spin up an ec2 instance permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Spin up an EC2 Instance</h2>\n<p>I’ve used a <code>t3.small</code> instance that comes with <strong>2 vCPUs</strong> and <strong>2Gb of RAM</strong> albeit you can select any instance of your choice.</p>\n<blockquote>\n<p>It is recommended that your DB should have access to at least <strong>1GB of RAM</strong> and <strong>2 real cores</strong> as that directly affects the performance during caching &#x26; concurrency mechanisms as handled by the default engine <a href=\"https://docs.mongodb.com/manual/core/wiredtiger/\"><strong>WiredTiger</strong></a>. You can read more about the <a href=\"https://docs.mongodb.com/manual/administration/production-notes/#allocate-sufficient-ram-and-cpu\"><strong>production notes related to the RAM and CPU requirements here</strong></a>.</p>\n</blockquote>\n<p><em>Configuration Overview:</em></p>\n<ul>\n<li>OS: <strong>Redhat Enterprise Linux 8 (x64 intel-based)</strong></li>\n<li>Instance Type: <strong>t3.small</strong></li>\n<li>Storage: <strong>10GB</strong>(os) + <strong>30GB</strong>(data) + <strong>3GB</strong>(logs) of <strong>EBS</strong> i.e. 3 separate volumes</li>\n</ul>\n<p>I’m assuming that you’re familiar with creating a VM on AWS.</p>\n<p>Now, once the instance is in running state, assign an <strong>Elastic IP</strong> to it and then simply do a remote login into the machine.</p>\n<blockquote>\n<p>We'll need the <strong>Elastic IP</strong> to setup public hostname for the instance</p>\n</blockquote>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">$ ssh -i &lt;PEM_FILE&gt; ec2-user@&lt;ELASTIC_IP&gt;</span></span></code></pre>\n<h2 id=\"mount-additional-volumes\" style=\"position:relative;\"><a href=\"#mount-additional-volumes\" aria-label=\"mount additional volumes permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Mount Additional Volumes</h2>\n<p>We have added 2 additional EBS volumes other than the Root FS for Data and Logs which are yet to be mounted (<em>Remember the 30Gb and 3Gb?</em>). You can list the volume blocks using,</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">$ sudo lsblk</span></span></code></pre>\n<p>The additional volumes will be listed right after the root block (refer to the arrows)</p>\n<p><img src=\"/df4109156286da8daf0fb9272bb4a65e/lsblk.webp\" alt=\"&#x22;sudo lsblk&#x22;\" title=\"List volume blocks\"></p>\n<p>In the image above, you can see that the additional volumes are named</p>\n<ol>\n<li><strong>xvdb</strong> (30Gb space to store data)</li>\n<li><strong>xvdc</strong> (3Gb space to store logs)</li>\n</ol>\n<p>Now, let’s create the file-systems in those volumes.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">$ sudo mkfs.xfs -L mongodata /dev/xvdb</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">$ sudo mkfs.xfs -L mongologs /dev/xvdc</span></span></code></pre>\n<blockquote>\n<p><code>-L</code> is an alias option for setting the <strong>volume label</strong></p>\n</blockquote>\n<p>And then mount the volumes.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">$ sudo mount -t xfs /dev/xvdb /var/lib/mongo</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">$ sudo mount -t xfs /dev/xvdc /var/log/mongodb</span></span></code></pre>\n<p>In order for these changes to reflect, the system must be rebooted. Hence, now we also need the partition persistence so that in case of an unintentional reboot we don’t lose the Database storage.</p>\n<p>We can achieve this by specifying the mount rules in the fstab file. <a href=\"https://geek-university.com/linux/etc-fstab-file/\">You can read more about it here</a>.</p>\n<p>Before that let's copy the UUID of the above partitions(<em>because they are unique and won't change over a system restart</em>)</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">$ sudo blkid</span></span></code></pre>\n<p><img src=\"/e90f9e288a7e788688ffbe69e0adb549/blkid.webp\" alt=\"&#x22;sudo blkid&#x22;\" title=\"List attached block info\"></p>\n<p>Copy the UUIDs listed for <strong>/dev/xvdb</strong> and <strong>/dev/xvdc</strong>. Refer to the <strong>“LABEL”</strong> for block identification</p>\n<p>Now open the <code>/etc/fstab</code> file and paste the configuration in the following format.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">UUID=&lt;COPIED_UUID_FOR_DATA&gt; /var/lib/mongo xfs defaults,nofail 0 0</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">UUID=&lt;COPIED_UUID_FOR_LOGS&gt; /var/log/mongodb xfs defaults,nofail 0 0</span></span></code></pre>\n<h2 id=\"update-hostname\" style=\"position:relative;\"><a href=\"#update-hostname\" aria-label=\"update hostname permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Update Hostname</h2>\n<p>The hostname will be used to identify your database server on the network. You can either use the above assigned <strong>Elastic IP</strong> or Domain name (if available). Open the <code>/etc/hostname</code> file and append the entry. For e.g.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">ip-xx.us-east-2.compute.internal **&lt;ELASTIC_IP&gt; &lt;DOMAIN_1&gt; &lt;DOMAIN_2&gt;** ...</span></span></code></pre>\n<h2 id=\"update-the-process-limits-optional\" style=\"position:relative;\"><a href=\"#update-the-process-limits-optional\" aria-label=\"update the process limits optional permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Update the Process Limits (Optional)</h2>\n<p>This is optionally required in order to control the maximum number of acceptable connections while keeping the system stable.\nOpen the <code>/etc/security/limits.conf</code> file and add the following entries.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">* soft nofile 64000</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">* hard nofile 64000</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">* soft nproc 32000</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">* hard nproc 32000</span></span></code></pre>\n<p>Now that all of the infra related prerequisites are sorted, <strong>reboot</strong> the instance, and let’s proceed to MongoDB installation.</p>\n<hr />\n<h1 id=\"1-setting-up-mongodb\" style=\"position:relative;\"><a href=\"#1-setting-up-mongodb\" aria-label=\"1 setting up mongodb permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1. Setting up MongoDB</h1>\n<h2 id=\"add-the-repo-source\" style=\"position:relative;\"><a href=\"#add-the-repo-source\" aria-label=\"add the repo source permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Add the Repo Source</h2>\n<p>Create a file <code>/etc/yum.repos.d/mongodb-org.4.2.repo</code> and add the following package repository details.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"8\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">[mongodb-org-4.2]</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">name=MongoDB Repository</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">baseurl=https://repo.mongodb.org/yum/redhat/</span><span class=\"mtk12\">$releasever</span><span class=\"mtk1\">/mongodb-org/4.2/x86_64/</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">gpgcheck=1</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">enabled=1</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc</span></span></code></pre>\n<p>Now let’s install MongoDB.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"9\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">$ sudo yum -y install mongodb-org</span></span></code></pre>\n<h2 id=\"create-directories-and-setup-permissions\" style=\"position:relative;\"><a href=\"#create-directories-and-setup-permissions\" aria-label=\"create directories and setup permissions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Create directories and setup permissions</h2>\n<p>MongoDB by default uses the following paths to store the data and the internal logs:</p>\n<blockquote>\n<p><strong>/var/lib/mongo</strong> → Data<br><strong>/var/log/mongodb</strong> → Logs</p>\n</blockquote>\n<p><strong>Create the directories</strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"10\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">$ sudo mkdir /var/lib/mongo</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">$ sudo mkdir /var/log/mongodb</span></span></code></pre>\n<p><strong>Change user &#x26; group permissions</strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"11\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">$ sudo chown mongod:mongod /var/lib/mongo</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">$ sudo chown mongod:mongod /var/log/mongod</span></span></code></pre>\n<h2 id=\"create-an-admin-user\" style=\"position:relative;\"><a href=\"#create-an-admin-user\" aria-label=\"create an admin user permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Create an Admin User</h2>\n<p>The <strong>mongod daemon/service</strong> must be first running before we proceed to create a user.\nLet’s use the default config(stored in <code>/etc/mongod.conf</code>) for now and start the daemon process.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"12\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">$ sudo -u mongod mongod -f /etc/mongod.conf</span></span></code></pre>\n<p>The above command will start the mongod daemon in fork mode (default).</p>\n<p>Now, let’s login to the server and create our first admin user.</p>\n<p><strong>Open a mongo shell</strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"13\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">$ mongo</span></span></code></pre>\n<p><strong>Use the \"admin\" database to create the root-admin</strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"14\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&gt; use admin</span></span></code></pre>\n<p><strong>Create the admin user</strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"15\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&gt; db.createUser({user: </span><span class=\"mtk8\">&quot;admin&quot;</span><span class=\"mtk1\">, pwd: </span><span class=\"mtk8\">&quot;password&quot;</span><span class=\"mtk1\">, roles: [{role: </span><span class=\"mtk8\">&quot;root&quot;</span><span class=\"mtk1\">, db: </span><span class=\"mtk8\">&quot;admin&quot;</span><span class=\"mtk1\">}]})</span></span></code></pre>\n<p><strong>Create a regular user</strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"16\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&gt; db.createUser({user: </span><span class=\"mtk8\">&quot;normal_user&quot;</span><span class=\"mtk1\">, pwd: </span><span class=\"mtk8\">&quot;password&quot;</span><span class=\"mtk1\">, roles: [{role: </span><span class=\"mtk8\">&quot;readWriteAnyDatabase&quot;</span><span class=\"mtk1\">, db: </span><span class=\"mtk8\">&quot;admin&quot;</span><span class=\"mtk1\">}]})</span></span></code></pre>\n<p><strong>Shutdown the server for now. We'll restart again with the modified config</strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"17\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&gt; </span><span class=\"mtk11\">db.shutDownServer</span><span class=\"mtk1\">()</span></span></code></pre>\n<h2 id=\"setting-up-authentication\" style=\"position:relative;\"><a href=\"#setting-up-authentication\" aria-label=\"setting up authentication permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Setting up Authentication</h2>\n<p>Here, we’ll enable the database authentication and modify the bind-address for our server to be accessible in the public domain.\nOpen <code>/etc/mongod.conf</code> and make the below changes.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"18\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk3\"># network interfaces</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">net:</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  port: 27017</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  bindIp: 0.0.0.0 </span><span class=\"mtk3\"># accessible on the network address</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">security:</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  authorization: enabled </span><span class=\"mtk3\"># creds will be required for making db operations</span></span></code></pre>\n<p>Save the config and <strong>restart</strong> the server.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"19\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">$ sudo -u mongod mongod -f /etc/mongod.conf</span></span></code></pre>\n<h2 id=\"test-login\" style=\"position:relative;\"><a href=\"#test-login\" aria-label=\"test login permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Test Login</h2>\n<p>You can verify if the credentials work using,</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"20\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">$ mongo -u admin -p password</span></span></code></pre>\n<p>That is it about the initial setup! Please stay tuned for my next related post on the detailed migration process and tips on keeping the DB production-ready.</p>\n<p>P.S. Thanks to <a href=\"https://twitter.com/MrEnvoy17\">Piyush Kumar</a> for helping curate this post!</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n</style>","frontmatter":{"date":"June 30, 2020","updated_date":null,"description":"Learn how to optimize your DB cost? This article will help you with the complete migration steps from a cloud to a self-hosted environment.","title":"Self-Hosted MongoDB","tags":["MongoDB","Mongo","AWS","Atlas"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":2.0408163265306123,"src":"/static/1ded984fa0b8dec44a3794c8bf5b7b2e/58556/cover.webp","srcSet":"/static/1ded984fa0b8dec44a3794c8bf5b7b2e/61e93/cover.webp 200w,\n/static/1ded984fa0b8dec44a3794c8bf5b7b2e/1f5c5/cover.webp 400w,\n/static/1ded984fa0b8dec44a3794c8bf5b7b2e/58556/cover.webp 800w,\n/static/1ded984fa0b8dec44a3794c8bf5b7b2e/502a6/cover.webp 925w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Chinmaya Pati","github":"cnp96","avatar":null}}}},{"node":{"excerpt":"Roadmap of IDX-auto-tester We're delightfully Announcing the upcoming releases of LoginRadius Identity-Experience-Framework Open-Source…","fields":{"slug":"/engineering/roadmap-idx-autotester/"},"html":"<h1 id=\"roadmap-of-idx-auto-tester\" style=\"position:relative;\"><a href=\"#roadmap-of-idx-auto-tester\" aria-label=\"roadmap of idx auto tester permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Roadmap of IDX-auto-tester</h1>\n<p>We're delightfully Announcing the upcoming releases of LoginRadius Identity-Experience-Framework Open-Source Automation</p>\n<p>These full-version releases will include more test coverage and major changes with several improvements &#x26; code optimizations, the details have been given below.<br>\nThe below changes are planned to go live in multiple scheduled major releases starting with mid of June 2020.  </p>\n<h2 id=\"release-roadmap\" style=\"position:relative;\"><a href=\"#release-roadmap\" aria-label=\"release roadmap permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Release Roadmap:</h2>\n<h3 id=\"july-2020\" style=\"position:relative;\"><a href=\"#july-2020\" aria-label=\"july 2020 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>July 2020:</h3>\n<h4 id=\"test-cases\" style=\"position:relative;\"><a href=\"#test-cases\" aria-label=\"test cases permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Test Cases:</h4>\n<ul>\n<li><strong>Improving the ratio of Good Test Cases in Test repository:</strong> We will be adding more test cases in Registration and Login flow to cover as much as possible Use Cases.</li>\n<li><strong>Increasing Negative Test Case Coverage:</strong> We are also focusing on negative test cases that are the most important part of the Test Coverage in Testing Life Cycle.</li>\n<li><strong>Delivering Manual Test Cases</strong>: We know that understanding of the test steps or mining the test cases by reading the code is not so easy for everyone, so we will also deliver the written Test Cases with the expected outcomes.</li>\n</ul>\n<blockquote>\n<p><em>CI/CD pipelines for automation is to make everyday development tasks simple that can save time and reduce human intervention to check them every single code commit.</em></p>\n</blockquote>\n<h3 id=\"august-2020\" style=\"position:relative;\"><a href=\"#august-2020\" aria-label=\"august 2020 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>August 2020:</h3>\n<h4 id=\"usability-improvements\" style=\"position:relative;\"><a href=\"#usability-improvements\" aria-label=\"usability improvements permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Usability Improvements:</h4>\n<ul>\n<li>Adding Command-line parameters for parallel run.</li>\n<li>Improving the naming conventions of functions for better readability.  </li>\n<li>Better Error and Exception Handling for failed assertions.</li>\n<li>Adding detailed descriptive comments to functions, custom-commands, and test cases for better understanding.</li>\n</ul>\n<h4 id=\"documentations\" style=\"position:relative;\"><a href=\"#documentations\" aria-label=\"documentations permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Documentations:</h4>\n<ul>\n<li>Improved Installation &#x26; usage guide</li>\n<li>More about different nightwatch configurations.</li>\n<li>More about working with <code>headless</code> mode</li>\n</ul>\n<blockquote>\n<p><em>We are not just delivering automation we deliver values to our customers, some useful tips \"to working with selenium and nightwatch\" can be expected with this release</em></p>\n</blockquote>\n<h3 id=\"september-2020\" style=\"position:relative;\"><a href=\"#september-2020\" aria-label=\"september 2020 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>September 2020:</h3>\n<h4 id=\"code-level-improvements-and-optimizations\" style=\"position:relative;\"><a href=\"#code-level-improvements-and-optimizations\" aria-label=\"code level improvements and optimizations permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Code Level Improvements and Optimizations:</h4>\n<ul>\n<li>Applying Page Object Model for application pages instead of static CSS-selector class.</li>\n<li>Applying async functioning in Test Cases and Custom-Commands to overcome the callback.    </li>\n<li>Updating the Custom-Command as per the latest version of nightwatch.</li>\n<li>Browser Compatibility Testing.</li>\n</ul>\n<h4 id=\"better-reporting\" style=\"position:relative;\"><a href=\"#better-reporting\" aria-label=\"better reporting permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Better Reporting:</h4>\n<ul>\n<li>More detailed, readable and graphical-representation of html reports will be added.</li>\n</ul>\n<blockquote>\n<p><em>Although current configuration does not support different browsers, still you can run on any browser by making few changes in nightwatch.json detailed guide is <a href=\"https://nightwatchjs.org/guide/running-tests/\">here</a></em></p>\n</blockquote>\n<h3 id=\"october-2020\" style=\"position:relative;\"><a href=\"#october-2020\" aria-label=\"october 2020 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>October 2020:</h3>\n<h4 id=\"overcoming-the-limitations\" style=\"position:relative;\"><a href=\"#overcoming-the-limitations\" aria-label=\"overcoming the limitations permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Overcoming the Limitations:</h4>\n<ul>\n<li>The build will be coming up with testing support of IEF feature <code>optional</code> and <code>disabled</code> email verification flows.</li>\n<li>Test Cases for <code>multifactor-authentication</code></li>\n</ul>\n<p>It is agreed that we are committed to delivering you a seamless experience in automation, but still, if you face any issue or need any enhancements, please report us <a href=\"https://github.com/LoginRadius/idx-auto-tester/issues\">here </a></p>\n<!--stackedit_data:\neyJoaXN0b3J5IjpbMjY2MTYyNjE4LDE5MDkzNjIxNjIsLTIyNT\ngwODM3OSwtNDI4ODY2Mjk2LDk1NTk3ODQ4NSwtMTU4Mjc5MDcy\nOF19\n-->\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"June 30, 2020","updated_date":null,"description":null,"title":"Roadmap of idx-auto-tester","tags":["Automation","idx","roadmap"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7699115044247788,"src":"/static/af8901a2791cbe7b9510d719854dd766/58556/roadmap_idx_auto_tester.webp","srcSet":"/static/af8901a2791cbe7b9510d719854dd766/61e93/roadmap_idx_auto_tester.webp 200w,\n/static/af8901a2791cbe7b9510d719854dd766/1f5c5/roadmap_idx_auto_tester.webp 400w,\n/static/af8901a2791cbe7b9510d719854dd766/58556/roadmap_idx_auto_tester.webp 800w,\n/static/af8901a2791cbe7b9510d719854dd766/99238/roadmap_idx_auto_tester.webp 1200w,\n/static/af8901a2791cbe7b9510d719854dd766/135cd/roadmap_idx_auto_tester.webp 1280w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Rakesh Pareek","github":"rkpareek","avatar":null}}}},{"node":{"excerpt":"Today we will learn about the progressive web app, a very interesting and trending topic in current times,  We will start with the basic…","fields":{"slug":"/engineering/build-pwa-using-vanilla-javascript/"},"html":"<p>Today we will learn about the progressive web app, a very interesting and trending topic in current times,  We will start with the basic steps first on how Progressive Web App works with vanilla js. Also, we’ll cover the concept of PWAS without using any of the frameworks, it's just a plain <code>vanillaJS</code>.</p>\n<h2 id=\"what-are-progressive-web-apps\" style=\"position:relative;\"><a href=\"#what-are-progressive-web-apps\" aria-label=\"what are progressive web apps permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What are Progressive Web Apps?</h2>\n<p>A Progressive Web app is an application which is built on top of <em>HTML</em>, <em>JS</em> and <em>CSS</em> with some extra features like <code>service worker</code> and <code>manifest.json</code> file. These extra features will give the ability to run the web application offline.</p>\n<p>Various big companies are moving towards the progressive web app instead of native apps, as it gives some much flexibility to end-users. In some websites you can find the + icon at the right side of the address bar, those are progressive web apps. </p>\n<h2 id=\"setup-your-base-app-for-pwa\" style=\"position:relative;\"><a href=\"#setup-your-base-app-for-pwa\" aria-label=\"setup your base app for pwa permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Setup your base app for PWA</h2>\n<p>We will be using <code>npm</code> to start our project, so firstly create a root folder using this command <code>mkdir first-pwa-app</code> or another name of your choice then go to that directory by using this command <code>cd first-pwa-app</code>. Run <code>npm init</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"sh\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">npm init</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">package name: (first-pwa-app)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">version: (1.0.0)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">description: This is the first PWA example</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">entry point: (index.js): index.html</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">test</span><span class=\"mtk1\"> command:</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">git repository:</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">keywords:</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">author: Mohammed Modi</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">license: (ISC)</span></span></code></pre>\n<p>Once you fill up those details your final output of the <code>package.json</code> file will be below</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"json\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;first-pwa-app&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;version&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;1.0.0&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;description&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;This is the first PWA example&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;main&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;index.html&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;scripts&quot;</span><span class=\"mtk1\">: {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">&quot;test&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;echo </span><span class=\"mtk6\">\\&quot;</span><span class=\"mtk8\">Error: no test specified</span><span class=\"mtk6\">\\&quot;</span><span class=\"mtk8\"> && exit 1&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  },</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;author&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;Mohammed Modi&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;license&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;ISC&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>After that, we need to install the <code>serve</code> dependency to serve the application in localhost so install it using npm <code>npm i serve --save</code>. And then add a script in the <code>package.json</code> file.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"json\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk14\">...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;scripts&quot;</span><span class=\"mtk1\">: {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">&quot;test&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;echo </span><span class=\"mtk6\">\\&quot;</span><span class=\"mtk8\">Error: no test specified</span><span class=\"mtk6\">\\&quot;</span><span class=\"mtk8\"> && exit 1&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">&quot;serve&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;serve .&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  },</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk14\">...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>So finally our application is ready to serve in localhost. Now let's add some <code>html</code> and <code>css</code></p>\n<h3 id=\"setting-up-the-javascript\" style=\"position:relative;\"><a href=\"#setting-up-the-javascript\" aria-label=\"setting up the javascript permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Setting up the Javascript</h3>\n<p>Create a directory for the app and add js, css, and images subdirectories. It should look like this when you’re finished:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">/first-pwa-app   # Project Folder</span>\n<span class=\"grvsc-line\">    /css     # Stylesheets</span>\n<span class=\"grvsc-line\">    /js      # Javascript</span>\n<span class=\"grvsc-line\">    /images  # Image files.</span>\n<span class=\"grvsc-line\">    package.json</span>\n<span class=\"grvsc-line\">    package-lock.json</span>\n<span class=\"grvsc-line\">    index.html</span>\n<span class=\"grvsc-line\">    manifest.json</span>\n<span class=\"grvsc-line\">    sw.js</span></code></pre>\n<p>You will understand the use of <code>manifest.json</code> and <code>sw.js</code> files once we move ahead in this tutorial.</p>\n<h3 id=\"add-some-code-for-app-interface\" style=\"position:relative;\"><a href=\"#add-some-code-for-app-interface\" aria-label=\"add some code for app interface permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Add Some code for app interface</h3>\n<p>When writing the code for Progressive Web Application we need to keep in mind two requirements</p>\n<ol>\n<li>The landing page should have some content even if the javascript is not loaded</li>\n<li>The App should be responsive and can be properly interactive in any device.</li>\n</ol>\n<p>For this app, to handle the first requirement we will add the static text in the Html page and for the second requirement, we will use the viewport.</p>\n<p>So let's add this code inside the <code>index.html</code> file.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"html\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;!</span><span class=\"mtk12\">DOCTYPE</span><span class=\"mtk1\"> </span><span class=\"mtk12\">html</span><span class=\"mtk1\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">html</span><span class=\"mtk1\"> </span><span class=\"mtk12\">lang</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;en&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">head</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">meta</span><span class=\"mtk1\"> </span><span class=\"mtk12\">charset</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;utf-8&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">title</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">My First PWA</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">title</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">link</span><span class=\"mtk1\"> </span><span class=\"mtk12\">rel</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;stylesheet&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">href</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;css/style.css&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">meta</span><span class=\"mtk1\"> </span><span class=\"mtk12\">name</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;viewport&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">content</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;width=device-width, initial-scale=1.0&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">head</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">body</span><span class=\"mtk1\"> </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;fullscreen&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">div</span><span class=\"mtk1\"> </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;container&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">h1</span><span class=\"mtk1\"> </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;title&quot;</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">My First PWA!</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">h1</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">div</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">body</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">html</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>Next, we need to create a file <code>css/style.css</code> and paste this code inside this</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"css\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk6\">body</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">font-family</span><span class=\"mtk1\">: </span><span class=\"mtk8\">sans-serif</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">/* Make content area fill the entire browser window */</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">/* Make content area fill the entire browser window */</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk6\">html</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk6\">.fullscreen</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">display</span><span class=\"mtk1\">: </span><span class=\"mtk8\">flex</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">height</span><span class=\"mtk1\">: </span><span class=\"mtk7\">100%</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">margin</span><span class=\"mtk1\">: </span><span class=\"mtk7\">0</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">padding</span><span class=\"mtk1\">: </span><span class=\"mtk7\">0</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">width</span><span class=\"mtk1\">: </span><span class=\"mtk7\">100%</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">/* Center the content in the browser window */</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk6\">.container</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">margin</span><span class=\"mtk1\">: </span><span class=\"mtk8\">auto</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk6\">.title</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">font-size</span><span class=\"mtk1\">: </span><span class=\"mtk7\">3rem</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>Once you add the code save all the files and run the script <code>npm run serve</code> which will start your application in <code>http://localhost:5000/</code></p>\n<p><img src=\"/d45aabc5af10728bee3cc83c94921028/1.webp\" alt=\"First Build\"></p>\n<h3 id=\"testing-the-app\" style=\"position:relative;\"><a href=\"#testing-the-app\" aria-label=\"testing the app permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Testing the App</h3>\n<p>As we can see our application is running in the browser, let test it using the <a href=\"https://chrome.google.com/webstore/detail/lighthouse/blipmdconlkpinefehnmjammfjpmpbjk?hl=en\">LightHouse Extension</a> in Google Chrome browser. For the best result, I recommend testing in an <strong>incognito tab</strong> of google chrome.</p>\n<p><img src=\"/b371425d18bfe6a98cbc80f27e3d16ef/2.webp\" alt=\"First Test\"></p>\n<p>As you can see we have green signals for both of our above requirement:</p>\n<ol>\n<li>Has a <meta name=\"viewport\"> tag with width or initial-scale</li>\n<li>Contains some content when JavaScript is not available</li>\n</ol>\n<p>But still, there is lots of work to do, so let's start with the first feature of PWA's.</p>\n<h3 id=\"adding-a-web-app-manifest\" style=\"position:relative;\"><a href=\"#adding-a-web-app-manifest\" aria-label=\"adding a web app manifest permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Adding a Web App Manifest</h3>\n<p>Let's create a new file called <code>manifest.json</code> in the root of our application. To understand more about the manifest file check out [this doc]</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"json\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;My First Progressive Web app&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;short_name&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;First PWA&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;lang&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;en-US&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;start_url&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;/index.html&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;display&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;standalone&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;background_color&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;white&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;theme_color&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;white&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>Now update the <code>index.html</code> head tag by adding the manifest.json file as a link</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"html\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">head</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  ...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">link</span><span class=\"mtk1\"> </span><span class=\"mtk12\">rel</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;manifest&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">href</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;/manifest.json&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  ...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">head</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>We should also declare the theme colour which should match with your manifest.json file as <code>meta tag</code>.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"html\" data-index=\"8\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">head</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  ...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">meta</span><span class=\"mtk1\"> </span><span class=\"mtk12\">name</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;theme-color&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">content</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;white&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  ...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">head</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>Once you run the lighthouse test again you can see we got green signals in some points like</p>\n<ol>\n<li>Sets a theme colour for the address bar.</li>\n</ol>\n<p><img src=\"/f3c402b3b411ef9ff23a4a52cf37c143/3.webp\" alt=\"Improving the Application\"></p>\n<h3 id=\"app-icons\" style=\"position:relative;\"><a href=\"#app-icons\" aria-label=\"app icons permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>App Icons</h3>\n<p>Still, we need to add more attributes to our <code>manifest.json</code> files like <strong>icons</strong> so let's add the icons inside the <code>images</code> folder, I have used to icons <code>pwa-icon-256.webp</code> and <code>pwa-icon-256.webp</code> for this demo you can find in this repo. You can use various sizes in it. And finally, add the <code>favicon.webp</code> in the root of the project.</p>\n<p>So let's add the <code>icons</code> attribute after the <code>short-name</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"json\" data-index=\"9\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;My First Progressive Web app&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;short_name&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;First PWA&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;icons&quot;</span><span class=\"mtk1\">: [</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">&quot;src&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;.images/pwa-icon-256.webp&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">&quot;sizes&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;256x256&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">&quot;type&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;image/png&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    },</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">&quot;src&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;.images/pwa-icon-512.webp&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">&quot;sizes&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;512x512&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">&quot;type&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;image/png&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  ],</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;lang&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;en-US&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;start_url&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;/index.html&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;display&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;standalone&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;background_color&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;white&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;theme_color&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;white&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>And the index.html will head can will look like</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"html\" data-index=\"10\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">head</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  ...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">link</span><span class=\"mtk1\"> </span><span class=\"mtk12\">rel</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;apple-touch-icon&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">href</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;images/pwa-icon-256.webp&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  ...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">head</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>You can also verify the <code>manifest.json</code> file by opening Chrome DevTools, in the <strong>Application Tab</strong>, the first tab in the sidebar <strong>manifest</strong></p>\n<p><img src=\"/9dd3daf070045ba6f6cd2b03d5fabd2b/5.webp\" alt=\"Application Manifest\"></p>\n<p>After running the test again, we can see all the <code>manifest.json</code> related issues are solved, The remaining issues can be resolved by adding the service worker.</p>\n<h3 id=\"adding-service-worker\" style=\"position:relative;\"><a href=\"#adding-service-worker\" aria-label=\"adding service worker permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Adding Service Worker</h3>\n<p>The next requirement of our app will be the service worker. The service worker is a script that runs in the background without any user interaction.</p>\n<p>The task of service worker will be to download and cache our content and then serve it when the user is offline. To understand more on service workers you can check this doc <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API\">from mozilla</a>.</p>\n<p>To integrate service workers we need to create a file called <code>sw.js</code> in the root of our project.</p>\n<blockquote>\n<p><strong>Note</strong>: Service worker will only have the access to the files of the <strong>current and sub-directories</strong> hence we need to place it in the root of our project</p>\n</blockquote>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"11\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">let</span><span class=\"mtk1\"> </span><span class=\"mtk12\">cacheName</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&quot;my-first-pwa&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">let</span><span class=\"mtk1\"> </span><span class=\"mtk12\">filesToCache</span><span class=\"mtk1\"> = [</span><span class=\"mtk8\">&quot;/&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;/index.html&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;/css/style.css&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;/js/main.js&quot;</span><span class=\"mtk1\">];</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">/* Start the service worker and cache all of the app&#39;s content */</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">self</span><span class=\"mtk1\">.</span><span class=\"mtk11\">addEventListener</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;install&quot;</span><span class=\"mtk1\">, (</span><span class=\"mtk12\">e</span><span class=\"mtk1\">) </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">e</span><span class=\"mtk1\">.</span><span class=\"mtk11\">waitUntil</span><span class=\"mtk1\">(</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">caches</span><span class=\"mtk1\">.</span><span class=\"mtk11\">open</span><span class=\"mtk1\">(</span><span class=\"mtk12\">cacheName</span><span class=\"mtk1\">).</span><span class=\"mtk11\">then</span><span class=\"mtk1\">(</span><span class=\"mtk4\">function</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">cache</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">cache</span><span class=\"mtk1\">.</span><span class=\"mtk11\">addAll</span><span class=\"mtk1\">(</span><span class=\"mtk12\">filesToCache</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    })</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  );</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">});</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">/* Serve cached content when offline */</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">self</span><span class=\"mtk1\">.</span><span class=\"mtk11\">addEventListener</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;fetch&quot;</span><span class=\"mtk1\">, (</span><span class=\"mtk12\">e</span><span class=\"mtk1\">) </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">e</span><span class=\"mtk1\">.</span><span class=\"mtk11\">respondWith</span><span class=\"mtk1\">(</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">caches</span><span class=\"mtk1\">.</span><span class=\"mtk11\">match</span><span class=\"mtk1\">(</span><span class=\"mtk12\">e</span><span class=\"mtk1\">.</span><span class=\"mtk12\">request</span><span class=\"mtk1\">).</span><span class=\"mtk11\">then</span><span class=\"mtk1\">((</span><span class=\"mtk12\">response</span><span class=\"mtk1\">) </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">response</span><span class=\"mtk1\"> || </span><span class=\"mtk11\">fetch</span><span class=\"mtk1\">(</span><span class=\"mtk12\">e</span><span class=\"mtk1\">.</span><span class=\"mtk12\">request</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    })</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  );</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">});</span></span></code></pre>\n<p>The first 2 variables <code>cacheName</code> and <code>filesToCache</code> are used to create an offline cache in the browser. <code>cacheName</code> is used to create a cache of specific name and <code>filesToCache</code> will be the list of files that we need to cache, <code>/</code> will store the root files that is <code>index.html</code> even if the user does not specify the file name in the URL and then all other files specified in the array.</p>\n<blockquote>\n<p><strong>Note</strong>: Here I have used the <code>filesToCache</code> array as a list of static files just to demonstrate the purpose of PWA, it will stop working in production if even one file fails to load.</p>\n</blockquote>\n<p>Finally, we will load our service worker, for that create <code>js/main.js</code> file and copy the below code.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"12\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">window</span><span class=\"mtk1\">.</span><span class=\"mtk11\">onload</span><span class=\"mtk1\"> = () </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk8\">&quot;use strict&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk8\">&quot;serviceWorker&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk4\">in</span><span class=\"mtk1\"> </span><span class=\"mtk12\">navigator</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">navigator</span><span class=\"mtk1\">.</span><span class=\"mtk12\">serviceWorker</span><span class=\"mtk1\">.</span><span class=\"mtk11\">register</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;./sw.js&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">};</span></span></code></pre>\n<p>And add this script in the <code>index.html</code> file.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"html\" data-index=\"13\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk1\"> </span><span class=\"mtk12\">src</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;js/main.js&quot;</span><span class=\"mtk17\">&gt;&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>So the final version of our <code>index.html</code> file will look like:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"html\" data-index=\"14\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;!</span><span class=\"mtk12\">DOCTYPE</span><span class=\"mtk1\"> </span><span class=\"mtk12\">html</span><span class=\"mtk1\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">html</span><span class=\"mtk1\"> </span><span class=\"mtk12\">lang</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;en&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">head</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">meta</span><span class=\"mtk1\"> </span><span class=\"mtk12\">charset</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;utf-8&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">title</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Hello World</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">title</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">link</span><span class=\"mtk1\"> </span><span class=\"mtk12\">rel</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;apple-touch-icon&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">href</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;images/pwa-icon-256.webp&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">link</span><span class=\"mtk1\"> </span><span class=\"mtk12\">rel</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;stylesheet&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">href</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;css/style.css&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">link</span><span class=\"mtk1\"> </span><span class=\"mtk12\">rel</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;manifest&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">href</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;/manifest.json&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">meta</span><span class=\"mtk1\"> </span><span class=\"mtk12\">name</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;viewport&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">content</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;width=device-width, initial-scale=1.0&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">meta</span><span class=\"mtk1\"> </span><span class=\"mtk12\">name</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;theme-color&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">content</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;white&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">head</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">body</span><span class=\"mtk1\"> </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;fullscreen&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">div</span><span class=\"mtk1\"> </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;container&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">h1</span><span class=\"mtk1\"> </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;title&quot;</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Hello World!</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">h1</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">div</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk1\"> </span><span class=\"mtk12\">src</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;js/main.js&quot;</span><span class=\"mtk17\">&gt;&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">body</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">html</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>Now our application is made as fully PWA supported, you can verify it by running the lighthouse test.</p>\n<p><img src=\"/c791b96c049bd3429260884230620b4d/6.webp\" alt=\"Full PWA Supported\"></p>\n<h4 id=\"finishing-up\" style=\"position:relative;\"><a href=\"#finishing-up\" aria-label=\"finishing up permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Finishing Up</h4>\n<p>We are done with the code, now the last thing remaining in to host it in any of the <code>https</code> domain. As the PWA will be required to run in <a href=\"/everything-you-want-to-know-about-authorization-headers/\">the secure domain</a>.</p>\n<p>You can get the full source code of this example in this <a href=\"https://github.com/LoginRadius/engineering-blog-samples/tree/master/ProgressiveWebApp/MyFirstPWA\">Github repo</a></p>\n<p>I hope you enjoyed the progressive web apps using vanilla js tutorial and found it useful. Please let me know what you think in the comments below.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk6 { color: #D7BA7D; }\n  .dark-default-dark .mtk14 { color: #F44747; }\n  .dark-default-dark .mtk17 { color: #808080; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n</style>","frontmatter":{"date":"June 26, 2020","updated_date":null,"description":"A simple step-by-step tutorial, all done with pure JavaScript, to set up a simple PWA that can be accessed offline using a web app manifest and a service worker.","title":"How to Build a PWA in Vanilla JS","tags":["PWA","JavaScript"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7699115044247788,"src":"/static/59164c7de73786d49d2361d64689b1c7/58556/cover.webp","srcSet":"/static/59164c7de73786d49d2361d64689b1c7/61e93/cover.webp 200w,\n/static/59164c7de73786d49d2361d64689b1c7/1f5c5/cover.webp 400w,\n/static/59164c7de73786d49d2361d64689b1c7/58556/cover.webp 800w,\n/static/59164c7de73786d49d2361d64689b1c7/99238/cover.webp 1200w,\n/static/59164c7de73786d49d2361d64689b1c7/135cd/cover.webp 1280w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Mohammed Modi","github":"mohammed786","avatar":null}}}},{"node":{"excerpt":"In this blog, we’ll be implementing authentication with password hashing in a Node.js web application. For this, we’ll be using crypto, a…","fields":{"slug":"/engineering/password-hashing-with-nodejs/"},"html":"<p>In this blog, we’ll be implementing authentication with password hashing in a Node.js web application. For this, we’ll be using <strong>crypto</strong>, a package password hashing for Node.js.</p>\n<p>The Crypto module for Node JS helps developers to hash user passwords.</p>\n<p>Pre-requisites: </p>\n<ul>\n<li>Basic knowledge of HTML/JavaScript</li>\n<li>Node js should be installed in your system.</li>\n<li>express module for creating the server.</li>\n<li>mongoose module for MongoDB connection and queries.</li>\n<li>Crypto module for hashing.</li>\n<li>body-parser for parsing JSON data</li>\n</ul>\n<p>Step 1. First, create a directory structure as below :</p>\n<p><code>hashApp</code></strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">--model</span>\n<span class=\"grvsc-line\">----user.js</span>\n<span class=\"grvsc-line\">--route</span>\n<span class=\"grvsc-line\">----user.js</span>\n<span class=\"grvsc-line\">--server.js</span></code></pre>\n<p>  Step 2. Create <strong>model/user.js</strong> file and add the following code :</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk3\">// Importing modules </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">mongoose</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">require</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;mongoose&#39;</span><span class=\"mtk1\">); </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">crypto</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">require</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;crypto&#39;</span><span class=\"mtk1\">); </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Creating user schema </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">UserSchema</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">mongoose</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Schema</span><span class=\"mtk1\">({ </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">name :</span><span class=\"mtk1\"> { </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">type :</span><span class=\"mtk1\"> </span><span class=\"mtk10\">String</span><span class=\"mtk1\">, </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">required :</span><span class=\"mtk1\"> </span><span class=\"mtk4\">true</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }, </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">email :</span><span class=\"mtk1\"> { </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">type :</span><span class=\"mtk1\"> </span><span class=\"mtk10\">String</span><span class=\"mtk1\">, </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">required :</span><span class=\"mtk1\"> </span><span class=\"mtk4\">true</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }, </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">hash :</span><span class=\"mtk1\"> </span><span class=\"mtk10\">String</span><span class=\"mtk1\">, </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">salt :</span><span class=\"mtk1\"> </span><span class=\"mtk10\">String</span><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}); </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Method to set salt and hash the password for a user </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">UserSchema</span><span class=\"mtk1\">.</span><span class=\"mtk12\">methods</span><span class=\"mtk1\">.</span><span class=\"mtk11\">setPassword</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">function</span><span class=\"mtk1\">(</span><span class=\"mtk12\">password</span><span class=\"mtk1\">) { </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">     </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span><span class=\"mtk3\">// Creating a unique salt for a particular user </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">this</span><span class=\"mtk1\">.</span><span class=\"mtk12\">salt</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">crypto</span><span class=\"mtk1\">.</span><span class=\"mtk11\">randomBytes</span><span class=\"mtk1\">(</span><span class=\"mtk7\">16</span><span class=\"mtk1\">).</span><span class=\"mtk11\">toString</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;hex&#39;</span><span class=\"mtk1\">); </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk3\">// Hashing user&#39;s salt and password with 1000 iterations, </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">     </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">this</span><span class=\"mtk1\">.</span><span class=\"mtk12\">hash</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">crypto</span><span class=\"mtk1\">.</span><span class=\"mtk11\">pbkdf2Sync</span><span class=\"mtk1\">(</span><span class=\"mtk12\">password</span><span class=\"mtk1\">, </span><span class=\"mtk4\">this</span><span class=\"mtk1\">.</span><span class=\"mtk12\">salt</span><span class=\"mtk1\">,  </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk7\">1000</span><span class=\"mtk1\">, </span><span class=\"mtk7\">64</span><span class=\"mtk1\">, </span><span class=\"mtk8\">`sha512`</span><span class=\"mtk1\">).</span><span class=\"mtk11\">toString</span><span class=\"mtk1\">(</span><span class=\"mtk8\">`hex`</span><span class=\"mtk1\">); </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}; </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Method to check the entered password is correct or not </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">UserSchema</span><span class=\"mtk1\">.</span><span class=\"mtk12\">methods</span><span class=\"mtk1\">.</span><span class=\"mtk11\">validPassword</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">function</span><span class=\"mtk1\">(</span><span class=\"mtk12\">password</span><span class=\"mtk1\">) { </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">hash</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">crypto</span><span class=\"mtk1\">.</span><span class=\"mtk11\">pbkdf2Sync</span><span class=\"mtk1\">(</span><span class=\"mtk12\">password</span><span class=\"mtk1\">,  </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">this</span><span class=\"mtk1\">.</span><span class=\"mtk12\">salt</span><span class=\"mtk1\">, </span><span class=\"mtk7\">1000</span><span class=\"mtk1\">, </span><span class=\"mtk7\">64</span><span class=\"mtk1\">, </span><span class=\"mtk8\">`sha512`</span><span class=\"mtk1\">).</span><span class=\"mtk11\">toString</span><span class=\"mtk1\">(</span><span class=\"mtk8\">`hex`</span><span class=\"mtk1\">); </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk4\">this</span><span class=\"mtk1\">.</span><span class=\"mtk12\">hash</span><span class=\"mtk1\"> === </span><span class=\"mtk12\">hash</span><span class=\"mtk1\">; </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}; </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Exporting module to allow it to be imported in other files </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">User</span><span class=\"mtk1\"> = </span><span class=\"mtk10\">module</span><span class=\"mtk1\">.</span><span class=\"mtk10\">exports</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">mongoose</span><span class=\"mtk1\">.</span><span class=\"mtk11\">model</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;User&#39;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">UserSchema</span><span class=\"mtk1\">); </span></span></code></pre>\n<p>Step 3. Create <strong>route/user.js</strong> file and add the following code:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk3\">// Importing modules </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">express</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">require</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;express&#39;</span><span class=\"mtk1\">); </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">router</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">express</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Router</span><span class=\"mtk1\">(); </span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Importing User Schema </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">User</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">require</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;../model/user&#39;</span><span class=\"mtk1\">); </span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// User login api </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">router</span><span class=\"mtk1\">.</span><span class=\"mtk11\">post</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;/login&#39;</span><span class=\"mtk1\">, (</span><span class=\"mtk12\">req</span><span class=\"mtk1\">, </span><span class=\"mtk12\">res</span><span class=\"mtk1\">) </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> { </span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk3\">// Find user with requested email </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">User</span><span class=\"mtk1\">.</span><span class=\"mtk11\">findOne</span><span class=\"mtk1\">({ </span><span class=\"mtk12\">email :</span><span class=\"mtk1\"> </span><span class=\"mtk12\">req</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\">.</span><span class=\"mtk12\">email</span><span class=\"mtk1\"> }, </span><span class=\"mtk4\">function</span><span class=\"mtk1\">(</span><span class=\"mtk12\">err</span><span class=\"mtk1\">, </span><span class=\"mtk12\">user</span><span class=\"mtk1\">) { </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">user</span><span class=\"mtk1\"> === </span><span class=\"mtk4\">null</span><span class=\"mtk1\">) { </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">res</span><span class=\"mtk1\">.</span><span class=\"mtk11\">status</span><span class=\"mtk1\">(</span><span class=\"mtk7\">400</span><span class=\"mtk1\">).</span><span class=\"mtk11\">send</span><span class=\"mtk1\">({ </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk12\">message :</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;User not found.&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            }); </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        } </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk15\">else</span><span class=\"mtk1\"> { </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">user</span><span class=\"mtk1\">.</span><span class=\"mtk11\">validPassword</span><span class=\"mtk1\">(</span><span class=\"mtk12\">req</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\">.</span><span class=\"mtk12\">password</span><span class=\"mtk1\">)) { </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">res</span><span class=\"mtk1\">.</span><span class=\"mtk11\">status</span><span class=\"mtk1\">(</span><span class=\"mtk7\">201</span><span class=\"mtk1\">).</span><span class=\"mtk11\">send</span><span class=\"mtk1\">({ </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk12\">message :</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;User Logged In&quot;</span><span class=\"mtk1\">, </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                }) </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            } </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk15\">else</span><span class=\"mtk1\"> { </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">res</span><span class=\"mtk1\">.</span><span class=\"mtk11\">status</span><span class=\"mtk1\">(</span><span class=\"mtk7\">400</span><span class=\"mtk1\">).</span><span class=\"mtk11\">send</span><span class=\"mtk1\">({ </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk12\">message :</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Wrong Password&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                }); </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            } </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        } </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }); </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}); </span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// User signup api </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">router</span><span class=\"mtk1\">.</span><span class=\"mtk11\">post</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;/signup&#39;</span><span class=\"mtk1\">, (</span><span class=\"mtk12\">req</span><span class=\"mtk1\">, </span><span class=\"mtk12\">res</span><span class=\"mtk1\">, </span><span class=\"mtk12\">next</span><span class=\"mtk1\">) </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> { </span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Creating empty user object </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">let</span><span class=\"mtk1\"> </span><span class=\"mtk12\">newUser</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">User</span><span class=\"mtk1\">(); </span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk3\">// Initialize newUser object with request data </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">newUser</span><span class=\"mtk1\">.</span><span class=\"mtk12\">name</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">req</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\">.</span><span class=\"mtk12\">name</span><span class=\"mtk1\">, </span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">newUser</span><span class=\"mtk1\">.</span><span class=\"mtk12\">email</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">req</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\">.</span><span class=\"mtk12\">email</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">newUser</span><span class=\"mtk1\">.</span><span class=\"mtk12\">password</span><span class=\"mtk1\">=</span><span class=\"mtk12\">req</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\">.</span><span class=\"mtk12\">password</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk3\">// Call setPassword function to hash password </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk12\">newUser</span><span class=\"mtk1\">.</span><span class=\"mtk11\">setPassword</span><span class=\"mtk1\">(</span><span class=\"mtk12\">req</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\">.</span><span class=\"mtk12\">password</span><span class=\"mtk1\">); </span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk3\">// Save newUser object to database </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">newUser</span><span class=\"mtk1\">.</span><span class=\"mtk11\">save</span><span class=\"mtk1\">((</span><span class=\"mtk12\">err</span><span class=\"mtk1\">, </span><span class=\"mtk12\">User</span><span class=\"mtk1\">) </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> { </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">err</span><span class=\"mtk1\">) { </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">res</span><span class=\"mtk1\">.</span><span class=\"mtk11\">status</span><span class=\"mtk1\">(</span><span class=\"mtk7\">400</span><span class=\"mtk1\">).</span><span class=\"mtk11\">send</span><span class=\"mtk1\">({ </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk12\">message :</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Failed to add user.&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            }); </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        } </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk15\">else</span><span class=\"mtk1\"> { </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">res</span><span class=\"mtk1\">.</span><span class=\"mtk11\">status</span><span class=\"mtk1\">(</span><span class=\"mtk7\">201</span><span class=\"mtk1\">).</span><span class=\"mtk11\">send</span><span class=\"mtk1\">({ </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk12\">message :</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;User added successfully.&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            }); </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        } </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }); </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}); </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Export module to allow it to be imported in other files </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk10\">module</span><span class=\"mtk1\">.</span><span class=\"mtk10\">exports</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">router</span><span class=\"mtk1\">; </span></span></code></pre>\n<p>Step 4. Create <strong>server.js</strong> file :</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk3\">// Importing modules</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">express</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">require</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;express&#39;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">mongoose</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">require</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;mongoose&#39;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">bodyparser</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">require</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;body-parser&#39;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Initialize express app</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">app</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">express</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Mongodb connection url</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">MONGODB_URI</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&quot;mongodb://localhost:27017/hashAppDb&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Connect to MongoDB</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">mongoose</span><span class=\"mtk1\">.</span><span class=\"mtk11\">connect</span><span class=\"mtk1\">(</span><span class=\"mtk12\">MONGODB_URI</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">mongoose</span><span class=\"mtk1\">.</span><span class=\"mtk12\">connection</span><span class=\"mtk1\">.</span><span class=\"mtk11\">on</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;connected&#39;</span><span class=\"mtk1\">, () </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;Connected to MongoDB @ 27017&#39;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">});</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Using bodyparser to parse json data</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">app</span><span class=\"mtk1\">.</span><span class=\"mtk11\">use</span><span class=\"mtk1\">(</span><span class=\"mtk12\">bodyparser</span><span class=\"mtk1\">.</span><span class=\"mtk11\">json</span><span class=\"mtk1\">());</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Importing routes</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">user</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">require</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;./route/user&#39;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Use user route when url matches /api/user/</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">app</span><span class=\"mtk1\">.</span><span class=\"mtk11\">use</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;/api/user&#39;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">user</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Creating server</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">port</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">3000</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">app</span><span class=\"mtk1\">.</span><span class=\"mtk11\">listen</span><span class=\"mtk1\">(</span><span class=\"mtk12\">port</span><span class=\"mtk1\">, () </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Server r</span><span class=\"mtk14\">u</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">nning</span><span class=\"mtk1\"> </span><span class=\"mtk12\">at</span><span class=\"mtk1\"> </span><span class=\"mtk12\">port</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot; + port)</span><span class=\"mtk14\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">});</span></span></code></pre>\n<p>Step 5. Run server.js file using command </p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">node server.js</span></code></pre>\n<p>Step 6. Open Postman and create a post request to <strong>localhost:3000/api/user/signup</strong> with following body parameter: </p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">{</span>\n<span class=\"grvsc-line\">&quot;name&quot; : &quot;test&quot;.</span>\n<span class=\"grvsc-line\">&quot;email&quot; : &quot;test@test.com&quot;,</span>\n<span class=\"grvsc-line\">&quot;password&quot; : &quot;test1234&quot;</span>\n<span class=\"grvsc-line\">}</span></code></pre>\n<p>Run the request and you will get  a success response:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">{</span>\n<span class=\"grvsc-line\">&quot;message&quot; : &quot;user added sucessfully&quot;</span>\n<span class=\"grvsc-line\">}</span></code></pre>\n<p>User data is stored in the database as below:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">    &quot;_id&quot;: {</span>\n<span class=\"grvsc-line\">        &quot;$oid&quot;: &quot;5ab71ef2afb6db0148052f6f&quot;</span>\n<span class=\"grvsc-line\">    },</span>\n<span class=\"grvsc-line\">    &quot;name&quot;: &quot;test&quot;,</span>\n<span class=\"grvsc-line\">    &quot;email&quot;: &quot;test@test.com&quot;,</span>\n<span class=\"grvsc-line\">    &quot;salt&quot;: &quot;ddee18ef6a6804fbb919b25f790005e3&quot;,</span>\n<span class=\"grvsc-line\">    &quot;hash&quot;: &quot;bbf13ae4db87d475ca0ee5f97e397248a23509fc10c82f1e3cf110</span>\n<span class=\"grvsc-line\">     b352c3ca6cc057955ace9d541573929cd7a74a280a02e8cb549136b43df7704caaa555b38a&quot;,</span>\n<span class=\"grvsc-line\">    &quot;__v&quot;: 0</span>\n<span class=\"grvsc-line\">}</span></code></pre>\n<p>If we have sensitive data or information that you need to be protected, ensuring it is secured correctly is important. With the above process, we can now successfully store our hashed password into our database with a bit of additional security.</p>\n<p>You can check the code on <a href=\"https://github.com/LoginRadius/engineering-blog-samples/tree/master/NodeJs/PasswordHasingNodejs\">Github</a>.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk14 { color: #F44747; }\n</style>","frontmatter":{"date":"June 25, 2020","updated_date":null,"description":null,"title":"Password hashing with NodeJS","tags":["Security","NodeJs"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.4598540145985401,"src":"/static/7c5686f355f37377e26ec91cbaa6cbed/58556/cover.webp","srcSet":"/static/7c5686f355f37377e26ec91cbaa6cbed/61e93/cover.webp 200w,\n/static/7c5686f355f37377e26ec91cbaa6cbed/1f5c5/cover.webp 400w,\n/static/7c5686f355f37377e26ec91cbaa6cbed/58556/cover.webp 800w,\n/static/7c5686f355f37377e26ec91cbaa6cbed/99238/cover.webp 1200w,\n/static/7c5686f355f37377e26ec91cbaa6cbed/ba24a/cover.webp 1440w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Ashish Sharma","github":"ashish8947","avatar":null}}}},{"node":{"excerpt":"The online gambling industry is one of the potential sectors that may make it through the pandemic with the least possible damage. In fact…","fields":{"slug":"/identity/online-casino-and-gambling-cyber-threat/"},"html":"<p>The online gambling industry is one of the potential sectors that may make it through the pandemic with the least possible damage. In fact, according to a study by the GrandViewResearch, online gambling is about to witness massive growth, and in the US alone, it will reach a value of <a href=\"https://www.grandviewresearch.com/industry-analysis/online-gambling-market?utm_source=prnewswire.com&#x26;utm_medium=referral&#x26;utm_campaign=PRN_Aug27_onlinegambling_ICT_RD1&#x26;utm_content=Content\">$102.9 billion by 2025</a>.</p>\n<p><em>No wonder the online gambling ecosystem is at its finest phase!</em> </p>\n<p>With the COVID-19 situation confining people to their homes, there's a lot more population playing on the internet. They have even outperformed their physical counterparts by massive numbers.</p>\n<p>In an environment where gambling occurs online, thousands of billions of casino money are transacted via credit and debit cards, wire transfers, and e-wallets. It is no surprise that gambling companies are one of the most favorable targets for scammers and hackers.</p>\n<p><a href=\"https://www.loginradius.com/blog/2019/10/cybersecurity-attacks-business/\">Cybercriminals target their resources</a> in two major ways: one they steal the <em>obvious -</em> money and the other they look for confidential data shared by gamblers online.</p>\n<p>Needless-to-say, the online gambling industry, therefore, needs to take the necessary steps to build safe and secure platforms for casino operators and consumers at large.</p>\n<h2 id=\"online-casino-a-multi-billion-dollar-industry--whats-about-to-change\" style=\"position:relative;\"><a href=\"#online-casino-a-multi-billion-dollar-industry--whats-about-to-change\" aria-label=\"online casino a multi billion dollar industry  whats about to change permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Online Casino, a Multi-Billion Dollar Industry- What's About to Change</h2>\n<p>The online gambling industry has undergone various changes over the past decades and is simultaneously expected to exhibit numerous transformations in the years to come. </p>\n<p>For example, the online gambling market is expected to grow at a compound annual growth rate (CAGR) of 11.5% from 2020 to 2027. That's huge!</p>\n<p><img src=\"/dcaea615ec0b1e5cb662a885016707fd/usa-online-gambling-market-size.webp\"></p>\n<p>Source: www.grandviewresearch.com</p>\n<p>This also means almost every player in the industry will compete to sustain in the competition, software developers will create more innovative games, and casinos will incorporate new <a href=\"https://www.loginradius.com/blog/2020/01/improving-customer-experience-in-the-gaming-industry/#:~:text=Online%20Gaming%20Industry%20Growth,around%2080%25%20of%20this%20revenue.\">ideas to improve customer experience</a>. So, what are these new ideas? </p>\n<p>Here are five key trends that could change the entire casino and gambling landscape.</p>\n<h3 id=\"1-rise-of-cryptocurrency-transactions-in-casinos\" style=\"position:relative;\"><a href=\"#1-rise-of-cryptocurrency-transactions-in-casinos\" aria-label=\"1 rise of cryptocurrency transactions in casinos permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1. Rise of Cryptocurrency Transactions in Casinos</h3>\n<p>Cryptocurrencies are no longer the future. The majority of online gambling and casino operators have already switched to Bitcoin and other cryptocurrencies as their standard mode of payment. Clearly, they see many advantages. Some of which include:</p>\n<ul>\n<li>All operations are automatically recorded within the game, which is why nothing goes unnoticed. All settlement between players and casinos are entirely transparent. </li>\n<li>Gamblers need not enter their data during deposits. Also, it is virtually impossible to hack blockchain systems.</li>\n<li>Cryptocurrency payment transaction fees are either zero or considerably smaller than in paper currency transactions.</li>\n<li>Replenishment of deposits and withdrawals would require comparatively lesser time than the traditional payment method.</li>\n<li>Players can execute all transactions anonymously by replenishing casino accounts using cryptocurrencies.</li>\n</ul>\n<h3 id=\"2-adoption-of-ar-and-vr-in-casinos\" style=\"position:relative;\"><a href=\"#2-adoption-of-ar-and-vr-in-casinos\" aria-label=\"2 adoption of ar and vr in casinos permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2. Adoption of AR and VR in Casinos</h3>\n<p><a href=\"https://www.cnbc.com/2016/10/10/virtual-reality-gambling-expected-to-grow-800-percent-by-2021-driven-by-high-rollers.html\">Virtual reality (VR) is another dimension</a> that has been working its way into the gaming industry - with many casinos already integrating it into their environment.</p>\n<p>What this technology does is it designs an entirely new environment, a whole new reality. An example of this is poker, where multiple players share one environment, adding to the experience.</p>\n<p>Similar to virtual reality, there is another technology called augmented reality (AR). Unlike VR, however, AR supplements the current environment with computer overlays. Heard of Pokémon Go? It uses AR, and now it is gearing up to enter the gambling industry.</p>\n<p>Considering that this technology improves an already established environment, live gaming is expected to become even more captivating.</p>\n<h3 id=\"3-customers-evolving-gambling-habits\" style=\"position:relative;\"><a href=\"#3-customers-evolving-gambling-habits\" aria-label=\"3 customers evolving gambling habits permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>3. Customer's Evolving Gambling Habits</h3>\n<p>It is no brainer that the customer's habit evolves with time. Social gambling and the rising popularity of gambling applications are some of the biggest indicators in this regard. Players can now easily compete on leaderboards and participate in social slots, whenever they want to.</p>\n<p><a href=\"https://www.casino.org/features/gambling-statistics/\">Mobile technology</a> has been a massive influence on people with a huge percentage of the world's population owning a smartphone. Casinos are more than ever investing in gaming applications and creating mobile-friendly games. It seems like mobile games will soon take over their desktop competition.</p>\n<p><img src=\"/7a8a4ff3f1397bb6f5311421ac9afd61/europe-online-gambling-market-share.webp\"></p>\n<p><em>Source: www.grandviewresearch.com</em></p>\n<h3 id=\"4-stricter-casinos--gambling-regulations\" style=\"position:relative;\"><a href=\"#4-stricter-casinos--gambling-regulations\" aria-label=\"4 stricter casinos  gambling regulations permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>4. Stricter Casinos &#x26; Gambling Regulations</h3>\n<p>The world is getting pretty serious about gambling. Some countries have already legalized online gambling, while others are looking forward to making a move in 2020. </p>\n<p>For example, Belarus legalized online casinos in 2019, Ukraine introduced a bill to legalize gaming. Russia has simplified the identification procedure required in betting, and even the UK accepted the obligatory requirements related to customer identification. </p>\n<h3 id=\"5-evolution-of-live-casinos\" style=\"position:relative;\"><a href=\"#5-evolution-of-live-casinos\" aria-label=\"5 evolution of live casinos permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>5. Evolution of Live Casinos</h3>\n<p>Another milestone in online gambling is probably the rapid evolution of live casinos. Games are carried out by dealers with professional lighting and sound equipment from exclusive studios. </p>\n<p>Then, cameras are mounted at various room angles, so players can witness everything that's happening inside the studio. Going forward, the concept of a live casino will gain even more popularity.</p>\n<h2 id=\"why-is-online-gambling-and-casino-security-so-crucial\" style=\"position:relative;\"><a href=\"#why-is-online-gambling-and-casino-security-so-crucial\" aria-label=\"why is online gambling and casino security so crucial permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Why Is Online Gambling and Casino Security So Crucial</h2>\n<p>In 2020, reducing the effects of cyber attacks and online fraud is crucial to sustaining the online gambling industry. Hackers are becoming extremely advanced, using tools and implementing sophisticated techniques like signal manipulation through fake apps and app-based hacking to breach data and break down online security protocols.</p>\n<p>Besides, Statista.com estimates that the global online gambling market will be valued at more than <a href=\"https://www.statista.com/statistics/270728/market-volume-of-online-gaming-worldwide/\">$94 billion USD in 2024</a> - meaning more the figure, more the risk of cybercrime.</p>\n<p><img src=\"/447af15e60d0fa1d107db8480a662d81/online-gambling-market-2017-2024-1-1024x763.webp\"></p>\n<p>Source: statista</p>\n<p>More than ever now is the time when cyber protection will play a critical role in the continued development and success of this revolutionary online gambling industry.</p>\n<h2 id=\"recent-cyber-attacks-in-online-gambling-sites\" style=\"position:relative;\"><a href=\"#recent-cyber-attacks-in-online-gambling-sites\" aria-label=\"recent cyber attacks in online gambling sites permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Recent Cyber Attacks in Online Gambling Sites</h2>\n<p>The primary <a href=\"https://www.loginradius.com/blog/2020/05/cyber-threats-business-risk-covid-19/\">threat to cybersecurity</a> that online casinos face is hacking. It may include targeted attacks forcing servers to get swamped with bot traffic, or it may consist of more sophisticated tactics designed to gain access to confidential customer data. </p>\n<p>Here are a few instances of recent breaches that will help you understand its severity in today's online gambling threat landscape. </p>\n<ul>\n<li>A group of professional Chinese hackers has officially confirmed that they have been <a href=\"https://www.zdnet.com/article/chinese-hackers-have-breached-online-betting-and-gambling-sites/\">hacking into gambling companies</a> and online betting websites in Southeast Asia since 2019. </li>\n<li>According to what is believed to be one of the biggest breaches of government data, betting companies acquired <a href=\"https://www.dailymail.co.uk/news/article-7904287/Betting-firms-granted-access-database-28-MILLION-children.html\">28 million children's database</a> in England, Wales, and Northern Ireland. The news surfaces in January 2020. </li>\n<li>SBTech, a popular supplier of sports betting and iGaming platform solutions, suffered a <a href=\"https://egr.global/intel/news/sbtech-partners-experience-72-hour-downtime-after-cybersecurity-attack/\">ransomware attack in March 2020</a>. Following which, it shut down its global datacentres. For more than 72 hours, clients were left without a consumer-facing website. Luckily, no data breach was recorded. </li>\n</ul>\n<h2 id=\"types-of-attacks-on-online-casino-betting-and-gambling-sites\" style=\"position:relative;\"><a href=\"#types-of-attacks-on-online-casino-betting-and-gambling-sites\" aria-label=\"types of attacks on online casino betting and gambling sites permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Types of Attacks on Online Casino, Betting and Gambling Sites </h2>\n<p><img src=\"/56b1a367212942a6aa6dc7e70988cb07/online-gambling-casino-and-betting-sectors.webp\" alt=\"online gambling, casino and betting sectors\"></p>\n<p>Online gambling and casino sites face security threats from several sources. For starters, some external hackers launch attacks to commit fraud from the comfort of their home or anywhere (for that matter). Next, some insiders hold administrative positions inside the business itself and <a href=\"https://www.loginradius.com/blog/2019/09/prevent-credential-stuffing-attacks/\">steal customer details</a>. </p>\n<p>Anyway, let's understand some of the major types of cyberattacks impacting the gambling industry. </p>\n<h3 id=\"expediting\" style=\"position:relative;\"><a href=\"#expediting\" aria-label=\"expediting permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Expediting </h3>\n<p>Expediting gameplay abuse is not new to the casino and online gambling industry. It is an automated threat that utilizes bots to speed up time-consuming actions, mostly to offer unfair advantages to players by violating rules in the gameplay. </p>\n<p>Expediting attacks decline user appeal, result in loss of subscription revenue, and may even risk your reputation as an online game service provider.</p>\n<h3 id=\"ddos-attack\" style=\"position:relative;\"><a href=\"#ddos-attack\" aria-label=\"ddos attack permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>DDoS Attack</h3>\n<p>In Distributed Denial of Service (DDoS) attacks, hackers flood gambling sites with an unexpected surge of traffic, leading to insignificant delays in loading times or completely crashing your website. </p>\n<p>Most naturally, players lose interest in the gambling company and jump off to their competitors.</p>\n<h3 id=\"scraping\" style=\"position:relative;\"><a href=\"#scraping\" aria-label=\"scraping permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Scraping </h3>\n<p>Scraping is another automated attack where hackers use bots to steal data from APIs, websites, and databases and consequently use those to exploit gambling operations. </p>\n<p>Scrapers often lead to increased risk of latency on gambling sites using excessive bandwidth with their requests, making legitimate customers suffer from long load times.</p>\n<h3 id=\"account-takeover-attacks\" style=\"position:relative;\"><a href=\"#account-takeover-attacks\" aria-label=\"account takeover attacks permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Account Takeover Attacks</h3>\n<p><a href=\"https://www.loginradius.com/blog/2020/04/corporate-account-takeover-attacks/\">Account takeover attack</a> is a complex challenge for the online gambling industry. Hackers gain illegal access to a genuine user profile to perform payment or identity fraud. </p>\n<p>In the gambling space, they steal players' resources and sell them on the dark market. They lure victims into accepting malicious friend requesting or by clicking on infected links. </p>\n<h3 id=\"sql-injection\" style=\"position:relative;\"><a href=\"#sql-injection\" aria-label=\"sql injection permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>SQL Injection </h3>\n<p>A Structured Query Language (SQL) injection attack happens when a hacker feeds infected SQL statements to take over the database server and add, modify, or delete data according to their will. </p>\n<p>By breaking into application security measures, hackers can easily pass through validation and approval checkpoints. This method of attack is mostly used by attackers to gain access over personal data, intellectual properties of gamblers, customer information, gaming secrets, and more.</p>\n<h2 id=\"how-loginradius-can-enhance-the-experience-of-online-gaming-with-advance-security\" style=\"position:relative;\"><a href=\"#how-loginradius-can-enhance-the-experience-of-online-gaming-with-advance-security\" aria-label=\"how loginradius can enhance the experience of online gaming with advance security permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How LoginRadius Can Enhance the Experience of Online Gaming With Advance Security</h2>\n<p><img src=\"/f6adf15845c70af1b864640f5cc863bf/How-LoginRadius-Can-Enhance-the-Experience-of-Online-Gaming.webp\" alt=\"How LoginRadius Can Enhance the Experience of Online Gaming\"></p>\n<p>LoginRadius is a powerful <a href=\"https://www.loginradius.com/blog/2019/06/customer-identity-and-access-management/\">customer identity and access management (CIAM)</a> platform that protects online gamblers' identity and prevents even the most sophisticated bots from infecting the gaming provider. It detects and blocks automated threats, including expediting, scraping, account takeover, DDoS, and more.</p>\n<p>Here's how the LoginRadius platform protects the gaming industry from malicious bot attacks and significantly improving customer experience.</p>\n<ul>\n<li><strong>Multi-Factor Authentication</strong>: The platform adds additional layers of protection by enabling two-factor or <a href=\"https://www.loginradius.com/blog/2019/06/what-is-multi-factor-authentication/\">multifactor authentication</a> on both player and admin accounts. It also offers real-time fraud analysis and data management features. </li>\n</ul>\n<p><a href=\"https://www.loginradius.com/resource/fixing-broken-authentication-with-adaptive-mfa/\"><img src=\"/8cd06df3a6214819919656d4dece050d/adaptive-mfa.webp\" alt=\"adaptive-mfa\"></a></p>\n<ul>\n<li><strong>Passwordless Login</strong>: Eliminating the <a href=\"https://www.loginradius.com/blog/2019/10/passwordless-authentication-the-future-of-identity-and-security/\">use of passwords</a> altogether can surprisingly improve gamblers' retention and loyalty because there will be no passwords to hack in the first place. Also, there is a one-touch login feature where customers login with a magic link or OTP.</li>\n<li><strong>Security Compliance</strong>: LoginRadius is <a href=\"https://www.loginradius.com/compliances/\">compliant with international regulatory standards</a> like COPPA, CCPA, and GDPR. The platform does not allow minor users to register.</li>\n<li><strong>360-Degree View</strong>: Gambling service providers can enjoy a comprehensive view of their customer demographics and detect abnormal user activity. The objective is to help them understand the players' behavior and offer <a href=\"https://www.loginradius.com/customer-experience-solutions/\">them better experiences</a>. </li>\n<li><strong>Consent Management</strong>: It is another popular addition to the LoginRadius identity platform. The feature manages the consent of gamblers about data collection, storage, and communication. If need be, they can also <a href=\"https://www.loginradius.com/blog/2020/05/consent-management/\">change existing permissions</a>.  </li>\n</ul>\n<h2 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h2>\n<p>Adhering to the COVID situation and keeping social distancing in mind, more and more people are turning to the multi-billion dollar gambling industry to find solace. Protecting online casinos, betting, and gambling site from malicious bots is a big deal. </p>\n<p>With the ongoing pandemic situation, gambling providers should primarily focus on ensuring that gambling is fair, crime-free, and protects minors. A <a href=\"https://www.loginradius.com/blog/identity/perfect-ciam-platform/\">CIAM platform</a> can help you tap all these touchpoints.</p>\n<p><a href=\"https://www.loginradius.com/contact-us?utm_source=blog&#x26;utm_medium=web&#x26;utm_campaign=online-casino-and-gambling-cyber-threat\"><img src=\"/8fce571f703a5970dbb1359a2fe0e51a/book-a-demo-loginradius.webp\" alt=\"book-free-demo-loginradius\"></a></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"June 25, 2020","updated_date":null,"description":"The online gambling industry, needs to take the necessary steps to build safe and secure platforms for casino operators and consumers.","title":"Online Casino and Gambling Industry Is Gaining Momentum, So Is the Cyber Threat","tags":["security"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.408450704225352,"src":"/static/19bf37c964e8bdffca34c56ef5ff6584/c0524/Online-Casino-and-Gambling-Industry.webp","srcSet":"/static/19bf37c964e8bdffca34c56ef5ff6584/61e93/Online-Casino-and-Gambling-Industry.webp 200w,\n/static/19bf37c964e8bdffca34c56ef5ff6584/1f5c5/Online-Casino-and-Gambling-Industry.webp 400w,\n/static/19bf37c964e8bdffca34c56ef5ff6584/c0524/Online-Casino-and-Gambling-Industry.webp 769w","sizes":"(max-width: 769px) 100vw, 769px"}}},"author":{"id":"Rakesh Soni","github":"oyesoni","avatar":"rakesh-soni.webp"}}}},{"node":{"excerpt":"Idx-Auto-Tester is LoginRadius Identify Experience Automation Framework which refers to IEF Automation, is an open-source automation…","fields":{"slug":"/engineering/introduction-of-idx-auto-tester/"},"html":"<p><a href=\"https://github.com/LoginRadius/idx-auto-tester\">Idx-Auto-Tester</a> is LoginRadius Identify Experience Automation Framework which refers to IEF Automation, is an open-source automation framework built-in Nightwatch| Node.js tool with delivering all the standard authentication cases of LoginRadius Identity Experience.\nThis automation framework has been created for <a href=\"https://www.loginradius.com/docs/libraries/identity-experience-framework/overview/#identity-experience-framework\">The LoginRadius Identity Experience Framework</a> which is a ready-to-use solution that provides predefined layouts for all necessary authentication actions. It has all of the user accounts flows available, such as login, registration, forgotten password, and profile management.</p>\n<h2 id=\"technology-used-to-create-idx-auto-tester\" style=\"position:relative;\"><a href=\"#technology-used-to-create-idx-auto-tester\" aria-label=\"technology used to create idx auto tester permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Technology used to create Idx-Auto-Tester</h2>\n<p>We used Nightwatch.js end-to-end testing framework to create our Idx-Auto-Tester. This framework relies on Selenium and provides several commands and assertions within the framework to perform operations on DOM elements. It internally uses the powerful W3C Webdriver API or the Selenium Webdriver and simplifies writing end-to-end automated tests in Node.js and effortlessly sets up for Continuous Integration.</p>\n<p>Nightwatch uses JavaScript language (Node.js) and CSS/XPath to identify an element. It has Built-in command-line test runner which can run the tests either sequentially or in parallel, together, by group, tags, or by single.</p>\n<h2 id=\"installation\" style=\"position:relative;\"><a href=\"#installation\" aria-label=\"installation permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Installation</h2>\n<p>Step 1: <a href=\"http://www.oracle.com/technetwork/java/javase/downloads/index.html\">Download and Install Java</a>.</p>\n<p>Step 2: <a href=\"https://nodejs.org/en/\">Install Node.js</a>.</p>\n<p>Step 3: Install Nightwatch. In the command line, navigate to any directory and type</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">  npm install -g nightwatch (here ‘g’ is for installing globally).</span></code></pre>\n<p>Step 4: Create a folder structure as shown below where Project is the root.</p>\n<p><img src=\"https://lh6.googleusercontent.com/ELzKfQlR5jHkRzeVW_9S0VxLD8vSfo2hJCvQxf37DZjwaod1Me05BzIs2Vk9unKneDda1PpI6TdmhvH7KnqFgCP0cRhIxORM9sfTn9RSTlTC40pwScwLLprVX2uu6sltu3kClQsc\"></p>\n<p>Step 5. Now it is required to install selenium-server-standalone.jar and chromedriver.exe along with other dependencies to execute test cases.</p>\n<p>As all the dependencies are added in nightwatch.json, so by executing below command, these will be added in node_modules folder</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">  npm install</span></code></pre>\n<h2 id=\"configuring-and-setting-up-nightwatchjs\" style=\"position:relative;\"><a href=\"#configuring-and-setting-up-nightwatchjs\" aria-label=\"configuring and setting up nightwatchjs permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Configuring and Setting up Nightwatch.js</h2>\n<p>Now we have installed all the dependencies and configuration setup for the automation framework. Nightwatch.js offers an in-built test runner which expects a JSON configuration file to be passed. The default configuration file is nightwatch.json which should be present in the project’s root directory.</p>\n<p>Step 6. In the root folder, create “nightwatch.js” file and place the following line:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk11\">require</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;nightwatch/bin/runner.js&quot;</span><span class=\"mtk1\">)</span></span></code></pre>\n<p>Step 7. Now create <code>nightwatch.json</code> configuration file with the configurations mentioned as below code snippet for testing with Selenium and JavaScript.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"json\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;src_folders&quot;</span><span class=\"mtk1\">: [</span><span class=\"mtk8\">&quot;test&quot;</span><span class=\"mtk1\">],</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;output_folder&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;tests_output&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;custom_commands_path&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;helpers/custom-commands&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;custom_assertions_path&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;page_objects_path&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;globals_path&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;test_workers&quot;</span><span class=\"mtk1\">: {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">&quot;enabled&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk4\">false</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">&quot;workers&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk7\">3</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  },</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;selenium&quot;</span><span class=\"mtk1\">: {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">&quot;start_process&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk4\">true</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">&quot;server_path&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;node_modules/selenium-server-standalone-jar/jar/selenium-server-standalone-3.13.0.jar&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">&quot;log_path&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">&quot;host&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;127.0.0.1&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">&quot;port&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk7\">4444</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">&quot;cli_args&quot;</span><span class=\"mtk1\">: {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">&quot;webdriver.chrome.driver&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;node_modules/chromedriver/lib/chromedriver/chromedriver.exe&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">&quot;webdriver.ie.driver&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  },</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">&quot;test_settings&quot;</span><span class=\"mtk1\">: {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">&quot;default&quot;</span><span class=\"mtk1\">: {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">&quot;skip_testcases_on_fail&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk4\">false</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">&quot;launch_url&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;http://localhost&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">&quot;selenium_port&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk7\">4444</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">&quot;selenium_host&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;127.0.0.1&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">&quot;silent&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk4\">true</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">&quot;screenshots&quot;</span><span class=\"mtk1\">: {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">&quot;enabled&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk4\">true</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">&quot;path&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;screenshots&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      },</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">&quot;desiredCapabilities&quot;</span><span class=\"mtk1\">: {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">&quot;browserName&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;chrome&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">&quot;javascriptEnabled&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk4\">false</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">&quot;acceptSslCerts&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk4\">false</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">&quot;chromeOptions&quot;</span><span class=\"mtk1\">: {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          </span><span class=\"mtk12\">&quot;args&quot;</span><span class=\"mtk1\">: [</span><span class=\"mtk8\">&quot;--headless-none&quot;</span><span class=\"mtk1\">]</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    },</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">&quot;firefox&quot;</span><span class=\"mtk1\">: {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">&quot;desiredCapabilities&quot;</span><span class=\"mtk1\">: {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">&quot;browserName&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;firefox&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">&quot;javascriptEnabled&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk4\">true</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">&quot;acceptSslCerts&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk4\">true</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">&quot;cli_args&quot;</span><span class=\"mtk1\">: {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          </span><span class=\"mtk12\">&quot;globals&quot;</span><span class=\"mtk1\">: {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk12\">&quot;env&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;fire  fox&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    },</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">&quot;ie&quot;</span><span class=\"mtk1\">: {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">&quot;desiredCapabilities&quot;</span><span class=\"mtk1\">: {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">&quot;browserName&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;internet explorer&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">&quot;javascriptEnabled&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk4\">true</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">&quot;acceptSslCerts&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk4\">true</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">&quot;cli_args&quot;</span><span class=\"mtk1\">: {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          </span><span class=\"mtk12\">&quot;globals&quot;</span><span class=\"mtk1\">: {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk12\">&quot;env&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;ie&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>Step 8. Now its time to design test case of any scenario, same as created in our <a href=\"https://github.com/LoginRadius/idx-auto-tester\">Idx-Auto-Tester</a> Framework under <strong>test</strong> folder named as <strong>TC<em>01</em>UserLogin</strong></p>\n<p>To create functions/methods, we used nightwatch custom commands approach to create commands for all the required functions under custom-commands folder, like as there is command created for <strong>createUser.js</strong> which used to create the user and call it under test case.</p>\n<blockquote>\n<p>Note: We are using 'Function-style commands' of Nightwatch to create command to resolve the asynchronous queueing system problem while running the test case.</p>\n</blockquote>\n<p>Step 9. The final thing we are required to do is to execute the tests from the base directory of the project using the command:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">npm test</span></code></pre>\n<blockquote>\n<p>Important Tip : A script has been added in package.json to define test execution command:</p>\n</blockquote>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"json\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk8\">&quot;scripts&quot;</span><span class=\"mtk1\">:</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">&quot;test&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;node nightwatch.js --reporter html-reporter.js test&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span></code></pre>\n<p>This command will validate the tests and dependencies and then execute the test suite, which will open up the mentioned browser and execute the desired test steps.</p>\n<h2 id=\"parallel-testing-with-nightwatchjs-in-selenium-webdriver\" style=\"position:relative;\"><a href=\"#parallel-testing-with-nightwatchjs-in-selenium-webdriver\" aria-label=\"parallel testing with nightwatchjs in selenium webdriver permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Parallel Testing with Nightwatch.js in Selenium WebDriver</h2>\n<p>It is required to update the configuration to execute the tests in parallel by enabling the test_workers as true. This will enable parallel execution and execute all tests on a defined number of workers.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"json\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk8\">&quot;test_workers&quot;</span><span class=\"mtk1\">: {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">&quot;enabled&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk4\">true</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">&quot;workers&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk7\">3</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  },</span></span></code></pre>\n<h2 id=\"this-is-all-about-idx-auto-tester-framework-implementation\" style=\"position:relative;\"><a href=\"#this-is-all-about-idx-auto-tester-framework-implementation\" aria-label=\"this is all about idx auto tester framework implementation permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>This is all about Idx-Auto-Tester Framework Implementation</h2>\n<p>In this framework design, we have covered various flows of LoginRadius Identity Experience Automation testing with Selenium Javascript. I hope we are now clear about the approach for an end-to-end automation testing with Selenium JavaScript using Nightwatch.js with the reference of Idx-Auto-Tester. We are aware of all the prerequisites required for setting up Nightwatch.js. It automates the entire test suite quickly with minimal configuration and is readable as well as easy to update. Our framework is also capable to use the best feature provided by Nightwatch.js framework which is the parallel testing of cases that proves to be time-efficient. The test results can directly be read from the terminal and also stored at a specified output folder.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n</style>","frontmatter":{"date":"June 22, 2020","updated_date":null,"description":null,"title":"Introduction of Idx-Auto-Tester","tags":["Automation","Idx-Auto-Tester"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7699115044247788,"src":"/static/4cce23ed76b3e769d45c63bf586f8166/58556/idx-auto-tester.webp","srcSet":"/static/4cce23ed76b3e769d45c63bf586f8166/61e93/idx-auto-tester.webp 200w,\n/static/4cce23ed76b3e769d45c63bf586f8166/1f5c5/idx-auto-tester.webp 400w,\n/static/4cce23ed76b3e769d45c63bf586f8166/58556/idx-auto-tester.webp 800w,\n/static/4cce23ed76b3e769d45c63bf586f8166/99238/idx-auto-tester.webp 1200w,\n/static/4cce23ed76b3e769d45c63bf586f8166/135cd/idx-auto-tester.webp 1280w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Himanshi Sharma","github":"Himanshi0512","avatar":null}}}}]},"markdownRemark":{"excerpt":"Identity is evolving, and developers are at the forefront of this transformation. Every day brings a new learning—adapting to new standards…","fields":{"slug":"/identity/developer-first-identity-provider-loginradius/"},"html":"<p>Identity is evolving, and developers are at the forefront of this transformation. Every day brings a new learning—adapting to new standards and refining approaches to building secure, seamless experiences.</p>\n<p>We’re here to support developers on that journey. We know how important simplicity, efficiency, and well-structured documentation are when working with identity and access management solutions. That’s why we’ve redesigned the <a href=\"https://www.loginradius.com/\">LoginRadius website</a>—to be faster, more intuitive, and developer-first in every way.</p>\n<p>The goal? Having them spend less time searching and more time building.</p>\n<h2 id=\"whats-new-and-improved-on-the-loginradius-website\" style=\"position:relative;\"><a href=\"#whats-new-and-improved-on-the-loginradius-website\" aria-label=\"whats new and improved on the loginradius website permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What’s New and Improved on the LoginRadius Website?</h2>\n<p>LoginRadius’ vision is to give developers a product that simplifies identity management so they can focus on building, deploying, and scaling their applications. To enhance this experience, we’ve spent the last few months redesigning our interface— making navigation more intuitive and reassuring that essential resources are easily accessible.</p>\n<p>Here’s a closer look at what’s new and why it’s important:</p>\n<h3 id=\"a-developer-friendly-dark-theme\" style=\"position:relative;\"><a href=\"#a-developer-friendly-dark-theme\" aria-label=\"a developer friendly dark theme permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>A Developer-Friendly Dark Theme</h3>\n<p><img src=\"/f46881583c7518a93bb24e94c32320de/a-developer-friendly-dark-theme.webp\" alt=\"This image shows how LoginRadius offers several authentication methods like traditional login, social login, passwordless login, passkeys and more in a dark mode.\">    </p>\n<p>Developers spend long hours working in dark-themed IDEs and terminals, so we’ve designed the LoginRadius experience to be developer-friendly and align with that preference.</p>\n<p>The new dark mode reduces eye strain, enhances readability, and provides a seamless transition between a coding environment and our platform. Our new design features a clean, modern aesthetic with a consistent color scheme and Barlow typography, ensuring better readability. High-quality graphics and icons are thoughtfully placed to enhance the content without adding visual clutter.</p>\n<p>So, whether you’re navigating our API docs or configuring authentication into your system, our improved interface will make those extended development hours more comfortable and efficient.</p>\n<h3 id=\"clear-categorization-for-loginradius-capabilities\" style=\"position:relative;\"><a href=\"#clear-categorization-for-loginradius-capabilities\" aria-label=\"clear categorization for loginradius capabilities permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Clear Categorization for LoginRadius Capabilities</h3>\n<p><img src=\"/e5358b82be414940f3fb146013845933/capabilities.webp\" alt=\"This image shows a breakdown of all the LoginRadius CIAM capabilities, including authentication, security, UX, scalability and multi-brand management.\"></p>\n<p>We’ve restructured our website to provide a straightforward breakdown of our customer identity and access management platform capabilities, helping you quickly find what you need:</p>\n<ul>\n<li>Authentication: Easily understand <a href=\"https://www.loginradius.com/blog/identity/authentication-option-for-your-product/\">how to choose the right login method</a>, from traditional passwords and OTPs to social login, federated SSO, and passkeys with few lines of code.</li>\n<li>Security: Implement no-code security features like bot detection, IP throttling, breached password alerts, DDoS protection, and adaptive MFA to safeguard user accounts.</li>\n<li>User Experience: Leverage AI builder, hosted pages, and drag-and-drop workflows to create smooth, branded sign-up and login experiences.</li>\n<li>High Performance &#x26; Scalability: Confidently scale with sub-100ms API response times, 100% uptime, 240K+ RPS, and 28+ global data center regions.</li>\n<li>Multi-Brand Management: Efficiently manage multiple identity apps, choosing isolated or shared data stores based on your brand’s unique needs.</li>\n</ul>\n<p>This structured layout ensures you can quickly understand each capability and how it integrates into your identity ecosystem.</p>\n<h3 id=\"developer-first-navigation\" style=\"position:relative;\"><a href=\"#developer-first-navigation\" aria-label=\"developer first navigation permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Developer-First Navigation</h3>\n<p><img src=\"/a8c155c2b6faf3d5f4b4de4e2b14d763/developers-menu.webp\" alt=\"This image shows the LoginRadius menu bar, highlighting the developer dropdown.\">   </p>\n<p>We’ve been analyzing developer workflows to identify how you access key resources. That’s why we redesigned our navigation with one goal in mind: to reduce clicks and make essential resources readily available.</p>\n<p>The new LoginRadius structure puts APIs, SDKs, and integration guides right at the menu bar under the Developers dropdown so you can get started faster. Our Products, Solutions, and Customer Services are also clearly categorized, helping development teams quickly find the right tools and make informed decisions.</p>\n<h3 id=\"quick-understanding-of-integration-benefits\" style=\"position:relative;\"><a href=\"#quick-understanding-of-integration-benefits\" aria-label=\"quick understanding of integration benefits permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Quick Understanding of Integration Benefits</h3>\n<p><img src=\"/b2f9a964a2da0ea83e2f8596b833bba7/we-support-your-tech-stack.webp\" alt=\"This image shows a list of popular programming languages and frameworks offered by LoginRadius.\"></p>\n<p>Developers now have a clear view of the tech stack available with LoginRadius, designed to support diverse business needs.</p>\n<p>Our platform offers pre-built SDKs for Node.js, Python, Java, and more, making CIAM integration seamless across popular programming languages and frameworks.</p>\n<h2 id=\"over-to-you-now\" style=\"position:relative;\"><a href=\"#over-to-you-now\" aria-label=\"over to you now permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Over to You Now!</h2>\n<p>Check out our <a href=\"https://www.loginradius.com/\">revamped LoginRadius website</a> and see how the improved experience makes it easier to build, scale, and secure your applications.</p>\n<p>Do not forget to explore the improved navigation and API documentation, and get started with our free trial today. We’re excited to see what you’ll build with LoginRadius!</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"February 21, 2025","updated_date":null,"description":"LoginRadius’ vision is to give developers a product that simplifies identity management so they can focus on building, deploying, and scaling their applications. To enhance this experience, we’ve redesigned our website interface, making navigation more intuitive and reassuring that essential resources are easily accessible.","title":"Revamped & Ready: Introducing the New Developer-First LoginRadius Website","tags":["Developer tools","API","Identity Management","User Authentication"],"pinned":true,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7857142857142858,"src":"/static/80b4e4fbe176a10a327d273504607f32/58556/hero-section.webp","srcSet":"/static/80b4e4fbe176a10a327d273504607f32/61e93/hero-section.webp 200w,\n/static/80b4e4fbe176a10a327d273504607f32/1f5c5/hero-section.webp 400w,\n/static/80b4e4fbe176a10a327d273504607f32/58556/hero-section.webp 800w,\n/static/80b4e4fbe176a10a327d273504607f32/99238/hero-section.webp 1200w,\n/static/80b4e4fbe176a10a327d273504607f32/7c22d/hero-section.webp 1600w,\n/static/80b4e4fbe176a10a327d273504607f32/1258b/hero-section.webp 2732w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Rakesh Soni","github":"oyesoni","avatar":"rakesh-soni.webp"}}}},"pageContext":{"limit":6,"skip":780,"currentPage":131,"type":"///","numPages":164,"pinned":"ee8a4479-3471-53b1-bf62-d0d8dc3faaeb"}},"staticQueryHashes":["1171199041","1384082988","2100481360","23180105","528864852"]}