<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Soumya Mondal</title>
    <description>The latest articles on DEV Community by Soumya Mondal (@coderx).</description>
    <link>https://dev.to/coderx</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F930389%2F07b42c3d-ba01-4eeb-a557-b1893878c428.png</url>
      <title>DEV Community: Soumya Mondal</title>
      <link>https://dev.to/coderx</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/coderx"/>
    <language>en</language>
    <item>
      <title>Create Calender heatmap in react like Github (from scratch)</title>
      <dc:creator>Soumya Mondal</dc:creator>
      <pubDate>Sat, 20 Apr 2024 16:00:00 +0000</pubDate>
      <link>https://dev.to/coderx/create-calender-heatmap-in-react-like-github-from-scratch-1i0m</link>
      <guid>https://dev.to/coderx/create-calender-heatmap-in-react-like-github-from-scratch-1i0m</guid>
      <description>&lt;p&gt;You must have seen those cool user activity heatmaps that shows the number of commits you've done over time using your github account. This has been a really crucial part of our journey.&lt;/p&gt;

&lt;p&gt;Today I was able to create the same calender heatmap (without any packages) like GitHub and Leetcode under 30 minutes, and I've also recorded a simple video on that starting from scratch.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/JjdTltl2q3c"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;I've got an amazing response on twitter and I Hope you'll like this video as well. &lt;/p&gt;

&lt;p&gt;In case you want to see more of these, I've a whole playlist on react machine coding and building components from scratch. You can head over to @indgeek on YouTube.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Shortest pathfinder in React using BFS</title>
      <dc:creator>Soumya Mondal</dc:creator>
      <pubDate>Fri, 19 Apr 2024 19:32:22 +0000</pubDate>
      <link>https://dev.to/coderx/shortest-pathfinder-in-react-using-bfs-545c</link>
      <guid>https://dev.to/coderx/shortest-pathfinder-in-react-using-bfs-545c</guid>
      <description>&lt;p&gt;Ever imagined your DSA skills could be implemented directly into your development projects? &lt;br&gt;
Here you are, I've just curated a video where I showcase how to find the shortest path between two nodes avoiding their obstacles.&lt;/p&gt;

&lt;p&gt;This pathfinder is created based on the Breadth First Search algorithm from graph. &lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/D5H2HZV7j1Y"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;I've received a lot of positive comments on all the social media combined for this tutorial and I hope for a positive reply from you as well. &lt;/p&gt;

</description>
      <category>bfs</category>
      <category>pathfinder</category>
      <category>shortestpath</category>
      <category>dsaanddev</category>
    </item>
    <item>
      <title>Drag and Drop file upload with progress bar in ReactJS</title>
      <dc:creator>Soumya Mondal</dc:creator>
      <pubDate>Fri, 19 Apr 2024 19:26:55 +0000</pubDate>
      <link>https://dev.to/coderx/drag-and-drop-file-upload-with-progress-bar-in-reactjs-570e</link>
      <guid>https://dev.to/coderx/drag-and-drop-file-upload-with-progress-bar-in-reactjs-570e</guid>
      <description>&lt;p&gt;You know drag and drop file uploads should be provided as the default behavior for input type file. Yet the pioneers of the web never were ever able to provide such functionalities. &lt;/p&gt;

&lt;p&gt;However I've created a project where I successfully implemented drag-and-drop file upload along with a progress bar and that provides you a cloud-uploaded URL as well. &lt;/p&gt;

&lt;p&gt;How cool is that! &lt;/p&gt;

&lt;p&gt;I've used no packages for the implementation of drag and drop upload, here's how! Created a tutorial on that topic to help you grasp the topic in a better way.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/r6wtq3aZ4Q4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;I'm sure you'll like the way I've explained, if you've any doubts at all, make sure to ask questions right away.&lt;/p&gt;

</description>
      <category>reactproject</category>
      <category>fileupload</category>
      <category>dnd</category>
    </item>
    <item>
      <title>🔐How to encrypt variables in NodeJS</title>
      <dc:creator>Soumya Mondal</dc:creator>
      <pubDate>Thu, 22 Sep 2022 02:54:15 +0000</pubDate>
      <link>https://dev.to/coderx/how-to-encrypt-variables-in-nodejs-8na</link>
      <guid>https://dev.to/coderx/how-to-encrypt-variables-in-nodejs-8na</guid>
      <description>&lt;p&gt;Ever imagined what would happen if someone gets access to your MongoDB account where all your crucial information are stored.&lt;/p&gt;

&lt;p&gt;All this comes down to another major issue when you have more than a few users who've submitted their confidential data relying on you.&lt;/p&gt;

&lt;h1&gt;
  
  
  Need of Encryption 💁‍♂️
&lt;/h1&gt;

&lt;p&gt;Storing user's data without any encryption at all might not be a good idea. &lt;/p&gt;

&lt;p&gt;A good fix to avoid compromising with someone's privacy would be to &lt;strong&gt;encrypt&lt;/strong&gt;🔒 data before storing in Database and &lt;strong&gt;decrypt&lt;/strong&gt;🔓 data while accessing from the Database.&lt;/p&gt;




&lt;h2&gt;
  
  
  -&amp;gt; How to Encrypt variables 🛡️
&lt;/h2&gt;

&lt;p&gt;While hash can be a good idea to implement before storing your user submitted variables, that might not work to regain data from the Database.&lt;/p&gt;

&lt;p&gt;Again npm packages like &lt;em&gt;'bcrypt'&lt;/em&gt; &amp;amp; &lt;em&gt;'crypto'&lt;/em&gt; can be super useful and complicated at the same time. &lt;/p&gt;

&lt;p&gt;Let's see a method that's easy to understand as well as implementable in a flash.&lt;/p&gt;




&lt;h2&gt;
  
  
  -&amp;gt; Using Keyhasher
&lt;/h2&gt;

&lt;p&gt;Assuming you already have a nodejs project set up, let's first install the npm package using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i keyhasher
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running this in the terminal will install the package.&lt;br&gt;
Let's require the package in the Node project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;keyhasher&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Try to keep this at the top of the project file.&lt;/p&gt;




&lt;h3&gt;
  
  
  --&amp;gt; How Keyhasher Works
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/keyhasher"&gt;Keyhasher&lt;/a&gt; has two functions for Encryption and Decryption respectively. &lt;/p&gt;

&lt;p&gt;Both the funtions takes in two arguments, the hashable or reverse hashable input and the Passkey 🔑.&lt;/p&gt;

&lt;p&gt;Simple example of the functions are given as-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;hashAble&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hi&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;572&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Hashed Phrase: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;hashAble&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Hashed Phrase: X4A=&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;rawWord&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;revHash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;X4A=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;572&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Output: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;rawWord&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Output: Hi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the hash Function, "Hi" is the text that is being encrypted, while I've used '572' as the Passkey🔑 that can be provided either directly to function or by using environment variable.&lt;/p&gt;

&lt;p&gt;The function returns a Phrase "X4A=", which can be stored into the database.&lt;/p&gt;

&lt;p&gt;With change to the passcode the Encrypted phrase changes. The same password is needed to decrypt the Encrypted phrase.&lt;/p&gt;




&lt;h3&gt;
  
  
  --&amp;gt; Securing the Passcode
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The passcode can be any integer number&lt;/strong&gt; like 12383473, 3481234, 341343, 8534582, 98, 1236, 894.&lt;/p&gt;

&lt;p&gt;A better practice would be to store the passcode🔑 in the configuration file.&lt;/p&gt;

&lt;p&gt;Create a &lt;code&gt;.env&lt;/code&gt; file and store your passkey in the following format.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PASSCODE = "23143341"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After storing the passcode safely, it can be used in the project with following syntax.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;hashAble&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hi&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PASSCODE&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Hashed Phrase: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;hashAble&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Hashed Phrase: X4A=&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;rawWord&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;revHash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;X4A=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PASSCODE&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Output: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;rawWord&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Output: Hi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>encrypt</category>
      <category>hashing</category>
      <category>npm</category>
      <category>node</category>
    </item>
  </channel>
</rss>
