<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Ronak Paul's blog]]></title><description><![CDATA[I am a full stack developer and student. And I love to write blogs about programming, DevOps, Web 3.0, blockchain, Web Development etc.]]></description><link>https://blog.ronakpaul.com</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 17:43:56 GMT</lastBuildDate><atom:link href="https://blog.ronakpaul.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[From Localhost to Live: Deploy Your Backend to AWS EC2]]></title><description><![CDATA[It’s always easy to deploy your frontend in a click with the help of various platforms like vercel, netlify, Github Pages etc. But it is somewhat tricky to deploy your backend to the cloud so that everyone can hit it.
Although platforms like vercel, ...]]></description><link>https://blog.ronakpaul.com/from-localhost-to-live-deploy-your-backend-to-aws-ec2</link><guid isPermaLink="true">https://blog.ronakpaul.com/from-localhost-to-live-deploy-your-backend-to-aws-ec2</guid><category><![CDATA[ec2]]></category><category><![CDATA[AWS]]></category><category><![CDATA[backend]]></category><category><![CDATA[deployment]]></category><category><![CDATA[EC2 instance]]></category><category><![CDATA[server]]></category><category><![CDATA[Cloud]]></category><category><![CDATA[Full Stack Development]]></category><dc:creator><![CDATA[Ronak Paul]]></dc:creator><pubDate>Wed, 09 Jul 2025 14:18:30 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1752070534947/c29c5a25-020b-4c47-be0f-8b1bafef409f.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>It’s always easy to deploy your frontend in a click with the help of various platforms like <strong>vercel</strong>, <strong>netlify</strong>, <strong>Github Pages</strong> etc. But it is somewhat tricky to deploy your backend to the cloud so that everyone can hit it.</p>
<p>Although platforms like <strong>vercel</strong>, <strong>renderer</strong> also supports deploying your backend in a click but it is always recommanded to host your backend in your own server using a cloud platform like <strong>AWS</strong>, <strong>GCP</strong>, <strong>Azure</strong> etc because those platforms ( vercel and renderer ) adds latency and stops working when not hitted for weeks.</p>
<p>While you are developing a Full Stack Project as a side project or for a hackathon, you may encountered the problem of deploying your backend. So I am gonna make this easy for you by writing this blog.</p>
<p>Let’s get started. 💪</p>
<p><strong>I will not gonna explain how to setup a AWS account. It should be straight forward if you are a dev.</strong> 🤷‍♂️</p>
<h2 id="heading-launch-ec2-instance">Launch EC2 instance</h2>
<p>To launch a EC2 instance, search EC2 in the search bar and select it then click on the <strong>Launch instance</strong> button.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1752040758009/cbe4a507-addb-46e9-b46b-4b2f5ea45bc3.png" alt class="image--center mx-auto" /></p>
<p>Now, you will get the below screen.</p>
<p>Give a name to your server and select the <strong>Ubuntu OS image</strong>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1752040978610/cb56fb52-f0d6-44d2-be9c-feef9f04b9bb.png" alt class="image--center mx-auto" /></p>
<p>Keep the <strong>Instance type</strong> as t2.micro for the free tier (It gives 750 hours per month of t2.micro instance usage) and then create a key pair if you don’t have one or use the existing one.</p>
<p>‼️ <strong>You should have the pem file in your computer to SSH to this server so keep it safe.</strong></p>
<p>Now in the <strong>Network settings</strong> you can allow HTTPS and HTTP traffic from the internet by selecting the checkboxes.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1752041783773/8af2cbd4-6d31-4cce-9d90-181a42c4b358.png" alt class="image--center mx-auto" /></p>
<p>Now you can click on the <strong>Launch instance</strong> button in the right side.</p>
<p>You can check all your running instances over <strong>EC2 &gt; Instances</strong></p>
<h2 id="heading-ssh-ec2-server">SSH EC2 Server</h2>
<p>SSH connection to your newly created EC2 server is simple. Just click on the <strong>instance ID</strong> from the row and copy the Public DNS. Then do the following:</p>
<ul>
<li><p>Open your terminal</p>
</li>
<li><p>Locate your private key file in the terminal using the <strong>cd</strong> command</p>
</li>
<li><p>Change the file permission of the pem file using the below command to make sure that the file is not publicly viewable</p>
<pre><code class="lang-bash">  chmod 400 <span class="hljs-string">"your-pem-file-name.pem"</span>
</code></pre>
</li>
<li><p>Connect to your server’s public DNS using SSH</p>
<pre><code class="lang-bash">  ssh -i <span class="hljs-string">"your-pem-file-name.pem"</span> ubuntu@your_public_dns
</code></pre>
</li>
</ul>
<p>After running the above command, you will see this screen and then you are good to run commands remotely in your AWS EC2 server.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1752048644369/aaf3cdad-c534-4042-9b2c-b31883a2bdb2.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-writing-a-simple-backend">Writing a simple backend</h2>
<p>Let’s write a simple backend using <strong>Express.js</strong>. The backend will simply increment a counter and store the value in a variable and you can also retrieve the counter value using another route. You can deploy any of your backend code using this method.</p>
<ul>
<li><p>Create a folder named “backend-test“ or anything of your choice and <strong>cd</strong> into it.</p>
</li>
<li><p>Install the required packages using npm</p>
<pre><code class="lang-bash">  npm install express
</code></pre>
</li>
<li><p>Create a index.js file and paste the below code there.</p>
<pre><code class="lang-javascript">  <span class="hljs-keyword">const</span> express = <span class="hljs-built_in">require</span>(<span class="hljs-string">"express"</span>)

  <span class="hljs-keyword">const</span> app = express();

  <span class="hljs-keyword">const</span> PORT = <span class="hljs-number">8000</span>;

  <span class="hljs-keyword">let</span> counter = <span class="hljs-number">0</span>;

  app.get(<span class="hljs-string">"/incre"</span>, <span class="hljs-function">(<span class="hljs-params">req, res</span>) =&gt;</span> {
      counter++;

      res.status(<span class="hljs-number">200</span>).json({<span class="hljs-attr">message</span>:<span class="hljs-string">"Incremented the counter successfully"</span>})
  })

  app.get(<span class="hljs-string">"/status"</span>, <span class="hljs-function">(<span class="hljs-params">req,res</span>) =&gt;</span> {
      res.status(<span class="hljs-number">200</span>).json({<span class="hljs-attr">message</span>:<span class="hljs-string">"status fetched successfully"</span>, counter})
  })

  app.listen(PORT, <span class="hljs-function">() =&gt;</span> {
      <span class="hljs-built_in">console</span>.log(<span class="hljs-string">`Server is running at <span class="hljs-subst">${PORT}</span>`</span>)
  })
</code></pre>
</li>
<li><p>Now run the server using the below command. This will run the server in your local environment. You can test the endpoints in postman or directly from the browser since these are <strong>GET endpoints.</strong></p>
<pre><code class="lang-bash">  node index.js
</code></pre>
</li>
</ul>
<p>Now you have to push your local code to <strong>GitHub</strong> so that you can pull it in your EC2 server and spin it up there.</p>
<h2 id="heading-setup-backend-code-in-ec2">Setup Backend Code in EC2</h2>
<p>Until now you pushed your local backed code to <strong>GitHub</strong>. Now you have to pull it into your EC2 server. So do the following to start the backend in your EC2 server.</p>
<ul>
<li><p>SSH into the server using the above instructions</p>
</li>
<li><p>Install Node in the EC2 server using <strong>NVM ( Node Version Manager )</strong></p>
<pre><code class="lang-bash">  curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
</code></pre>
<p>  Now exit from the ubuntu shell and again SSH. Then run the below command</p>
<pre><code class="lang-bash">  nvm install --lts
</code></pre>
<p>  It will download the latest LTS version of node into the server. You can check the node version using the <code>node —-version</code> command.</p>
</li>
<li><p>Now pull your code from the GitHub using the below command and <strong>cd</strong> into the folder.</p>
<pre><code class="lang-bash">  git pull <span class="hljs-string">"&lt;Github Repo URL&gt;"</span>
</code></pre>
</li>
<li><p>Now install the node modules using <code>npm install</code> command and start the index file using the <code>node index.js</code> command</p>
</li>
<li><p>Now you can hit the public DNS with the given port of your backend application, in this case it is 8000. But you will see that it can’t hit the URL, it will keep loading</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1752065844044/952d4e9c-7570-4211-89ad-204b4668a017.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>In this case you need to update the inbound roules of the security group.</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1752066028369/07b5dc43-92f0-4b1c-9124-1c7cc8430387.png" alt class="image--center mx-auto" /></p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1752066179954/0f2175a2-1649-4de5-9fe2-55ffd471b2f0.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Now again try hitting the public DNS with the port and correct route. You will see the response like below</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1752066339007/25c06433-54fb-4a68-82cd-cc9f219ce5de.png" alt class="image--center mx-auto" /></p>
<p>  But, you can see that it is showing <strong>Not Secure</strong> in the search bar. We will fix it by adding a certificate to it.</p>
</li>
</ul>
<h2 id="heading-setup-nginx">Setup NGINX</h2>
<p>Before setting up <strong>nginx</strong>, you need to know why we are using nginx.</p>
<p><strong>Nginx</strong> (pronounced "engine-X") is <strong>an open-source web server and reverse proxy</strong>, widely recognized for its high performance, scalability, and low resource usage. It also functions as a load balancer, HTTP cache, and mail proxy.</p>
<p>Here we will use nginx as a <strong>reverse proxy</strong>. A reverse proxy server acts as an intermediary between clients and one or more backend servers. It sits in front of the servers, receiving client requests and forwarding them to the appropriate server, while also returning responses from the server back to the client.</p>
<p>Now let’s install and setup nginx into the EC2 server using the below steps:</p>
<ul>
<li><p>Installing nginx</p>
<pre><code class="lang-bash">  sudo apt update
  sudo apt install nginx
</code></pre>
</li>
<li><p>After installing nginx, try hitting the same public DNS and you will see the following response if it is successfully installed.</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1752066549376/1a5a2e8e-0fec-4a21-9516-7575ac0a3d5e.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Now we will create the reverse proxy. To do that run the below commands in the root of the server</p>
<pre><code class="lang-bash">  sudo rm sudo vi /etc/nginx/nginx.conf
  sudo vi /etc/nginx/nginx.conf
</code></pre>
<p>  And paste the below code into it.<br />  <strong><em>Please replace the server name with your own purchased domain name.</em></strong></p>
<pre><code class="lang-bash">  events {
      <span class="hljs-comment"># Event directives...</span>
  }

  http {
      server {
      listen 80;
      server_name bt.ronakpaul.com;

      location / {
          proxy_pass http://localhost:8000;
          proxy_http_version 1.1;
          proxy_set_header Upgrade <span class="hljs-variable">$http_upgrade</span>;
          proxy_set_header Connection <span class="hljs-string">'upgrade'</span>;
          proxy_set_header Host <span class="hljs-variable">$host</span>;
          proxy_cache_bypass <span class="hljs-variable">$http_upgrade</span>;
      }
      }
  }
</code></pre>
</li>
</ul>
<h2 id="heading-domain-and-certificate">Domain and Certificate</h2>
<p>Now you need to add domain name record to point your domain name to the server ip address. To do so, go to the platform from where you had purchased the domain, for me it is hostinger.</p>
<p>Add a <strong>A name record</strong> to the platform like below. You can give any subdomain name and it should point to the AWS EC2 public ip address.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1752067279274/c8aa179b-91f4-4639-9fc5-6167b77d0755.png" alt class="image--center mx-auto" /></p>
<p>Now you can see that we can hit the server using our own domain</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1752067570006/9b08771f-f1c1-4ee0-9368-0ece6773013e.png" alt class="image--center mx-auto" /></p>
<p>Now we have to add the certificate, so that it can be accessed using https. To add a certificate, do the following:</p>
<ul>
<li><p>Run this command in the server to install Certbot.</p>
<pre><code class="lang-bash">  sudo snap install --classic certbot
</code></pre>
</li>
<li><p>Execute the following command in the server to ensure that the <code>certbot</code> command can be run.</p>
<pre><code class="lang-bash">  sudo ln -s /snap/bin/certbot /usr/bin/certbot
</code></pre>
</li>
<li><p>Now, run the below command to get a certificate and have Certbot edit your nginx configuration automatically to serve it, turning on HTTPS access in a single step.</p>
<pre><code class="lang-bash">  sudo certbot --nginx
</code></pre>
</li>
<li><p>It’s done. Now you just need to run the index.js file using <strong>pm2</strong> ( Process Manager 2 ) so that the process does not stop when you exit from the terminal or shutdown the pc. To do so, install pm2 by the below command</p>
<pre><code class="lang-bash">  npm install pm2 -g
</code></pre>
<p>  Start the index.js file using pm2</p>
<pre><code class="lang-bash">  pm2 start index.js
</code></pre>
</li>
</ul>
<p>Now you can finally see that your backend is fully deployed and accessable over https on your own domain.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1752068724915/d88c75b4-5489-4235-a03b-6d686e0e69ae.png" alt class="image--center mx-auto" /></p>
<p>So you now can connect your backend with frontend by hitting it with fetch or axios.</p>
<p>Happy coding guys ☕️</p>
]]></content:encoded></item><item><title><![CDATA[Automate and Orchestrate your workflow using Kestra]]></title><description><![CDATA[Before diving into the world of Kestra, I want to thank Kunal Kushwaha for organizing HackFrost hackathon and introducing us to such an amazing tool. I loved to use Kestra ❤️ throughout the hackathon and will definately use Kestra for my future proje...]]></description><link>https://blog.ronakpaul.com/automate-and-orchestrate-your-workflow-using-kestra</link><guid isPermaLink="true">https://blog.ronakpaul.com/automate-and-orchestrate-your-workflow-using-kestra</guid><category><![CDATA[hackfrost2024]]></category><category><![CDATA[WeMakeDevs]]></category><category><![CDATA[#Kestra]]></category><category><![CDATA[Workflow Automation]]></category><dc:creator><![CDATA[Ronak Paul]]></dc:creator><pubDate>Tue, 03 Dec 2024 18:55:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1733161185077/5fce865a-b92d-4974-a2b6-adf824077170.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Before diving into the world of <strong>Kestra,</strong> I want to thank <a class="user-mention" href="https://hashnode.com/@kunalk">Kunal Kushwaha</a> for organizing <strong>HackFrost hackathon</strong> and introducing us to such an amazing tool. I loved to use Kestra ❤️ throughout the hackathon and will definately use <strong>Kestra</strong> for my future projects as well. So lets get started.</p>
<h1 id="heading-introduction">Introduction</h1>
<p><strong>Kestra</strong> is a open source <strong>orchestration</strong> platform for making and managing your workflows. And to make any workflows in <strong>Kestra</strong> you just need to write <strong>YAML</strong>. Nothing fancy over here. Isn’t it cool ?</p>
<p>Not only this, in kestra you can schedule your workflows using <strong>cron jobs</strong> ( cron jobs are use to schedule some task for execution in specific time interval ). And also you can trigger a flow when somethings happens on other platforms like AWS, GitHub etc.</p>
<p><strong>Kestra</strong> also has hundreds of plugins for different usecases. Like for connecting different services such as MongoDB, dynamoDB, ApacheKafka etc. Which you can integrate to your workflow.</p>
<p>Here is the official site of Kestra: <a target="_blank" href="https://kestra.io/">kestra.io</a></p>
<hr />
<h1 id="heading-running-kestra">Running Kestra</h1>
<p><strong>Kestra</strong> has a cloud hosted platform but it is in private alpha stage ( eagerly waiting for the public launch ). But you can run Kestra on your local device using <strong>Docker</strong>. Although there are other methods to run kestra, which you can checkout <a target="_blank" href="https://kestra.io/docs/installation">here</a>.</p>
<h3 id="heading-prerequisites">Prerequisites</h3>
<ul>
<li><p>Docker installed on your machine</p>
</li>
<li><p>Smile on your face 😄</p>
</li>
</ul>
<h3 id="heading-steps">Steps</h3>
<ol>
<li>Spinning up docker container for kestra in your terminal by the below command</li>
</ol>
<pre><code class="lang-bash">docker run --pull=always --rm -it -p 8080:8080 --user=root -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/tmp kestra/kestra:latest server <span class="hljs-built_in">local</span>
</code></pre>
<blockquote>
<p>Note: By this method your works in the Kestra will not be persistent. So make sure to store the YAML files on separate folder.</p>
</blockquote>
<ol start="2">
<li>Now go to your browser and enter <strong>http://localhost:8080</strong> in the address bar, hit enter.</li>
</ol>
<p>Now you are good to get started with Kestra.</p>
<p>Let’s now understand some key terms in <strong>Kestra</strong>.</p>
<hr />
<h1 id="heading-flows">Flows</h1>
<p>In Kestra, Flows defines how your workflow will looklike in a <strong>YAML</strong> file format. And after writing the flow in <strong>YAML</strong>, you can also see its topology or visual representation of the flow in the <strong>Topology</strong> section. A YAML file for the flow keeps it language agnostic.</p>
<p>A simple example of <strong>Kestra flow</strong> is given below:</p>
<pre><code class="lang-yaml"><span class="hljs-attr">id:</span> <span class="hljs-string">first_flow_example</span>
<span class="hljs-attr">namespace:</span> <span class="hljs-string">ronak.blog</span>
<span class="hljs-attr">description:</span> <span class="hljs-string">"Flow is to just log a message"</span>

<span class="hljs-attr">tasks:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">id:</span> <span class="hljs-string">logging_task</span>
    <span class="hljs-attr">type:</span> <span class="hljs-string">io.kestra.plugin.core.log.Log</span>
    <span class="hljs-attr">message:</span> <span class="hljs-string">"Successfully executed a kestra flow with log"</span>
</code></pre>
<p>In the above kestra flow there are certain keywords which I am explaining in detail below:</p>
<p>In each flow, there are three required fields: <strong>id</strong>, <strong>namespace</strong>, <strong>tasks</strong></p>
<ul>
<li><p><strong>id:</strong> The id field is use to give a name to a flow. Each <strong>flow’s id</strong> in the same <strong>namespace</strong> should be different but for different namespaces it could be same as well.</p>
</li>
<li><p><strong>namespace:</strong> You can think namespaces as like a folder structure. Where you can segregate different flows according to their namespace. And you can’t change a flow’s namespace once it is created or saved.</p>
</li>
<li><p><strong>tasks:</strong> The tasks field is use to define one or multiple tasks for the flow. And the tasks will execute as per the order i.e. top to bottom. Each task has its own <strong>id</strong>, <strong>type</strong>, and other fields associated with that type. In the type field you can choose what kind of task you want to do like fetching documents from <strong>mongodb</strong> or <strong>dynamodb</strong> etc. Each task type is already predefined. You can see the documentation to see all the task types, although I will be explaining some of the popular and frequently used task types in this blog.</p>
</li>
<li><p><strong>description:</strong> The description field is a optional field, which is use to just give a description to the flow for much more clarity. We can give description to each tasks as well.</p>
</li>
</ul>
<hr />
<h1 id="heading-task-types">Task Types</h1>
<p>Kestra provides multiple task types like <strong>Core</strong>, <strong>Scripts</strong>, <strong>Internal Storage</strong>, <strong>KV Store</strong>, <strong>Plugins</strong>. Some of the popular and frequently used task types are given below:</p>
<ul>
<li><p><strong>io.kestra.plugin.core.log.Log:</strong> This task type is use to log messages in the Kestra log section while executing a flow. <a target="_blank" href="https://kestra.io/plugins/core/tasks/log/io.kestra.plugin.core.log.log">Checkout Doc</a></p>
</li>
<li><p><strong>io.kestra.plugin.core.http.Requests:</strong> This task type is use to make a http request for the given uri. <a target="_blank" href="https://kestra.io/plugins/core/tasks/http/io.kestra.plugin.core.http.request">Checkout Doc</a></p>
</li>
<li><p><strong>io.kestra.plugin.scripts.python.Script:</strong> This task type is use to run <strong>Python</strong> code in a task. <a target="_blank" href="https://kestra.io/plugins/plugin-script-python/tasks/io.kestra.plugin.scripts.python.script">Checkout Doc</a></p>
</li>
<li><p><strong>io.kestra.plugin.mongodb.Find:</strong> This task type is use to fetch documents from a given mongodb database uri. <a target="_blank" href="https://kestra.io/plugins/plugin-mongodb/tasks/io.kestra.plugin.mongodb.find">Checkout Doc</a></p>
</li>
<li><p><strong>io.kestra.plugin.git.Clone:</strong> This task type is use to clone a repository from <strong>GitHub</strong>. <a target="_blank" href="https://kestra.io/plugins/plugin-git/tasks/io.kestra.plugin.git.clone">Checkout Doc</a></p>
</li>
<li><p><strong>io.kestra.plugin.scripts.node.Script:</strong> This task type is use to run Javascript on Node runtime in a task. <a target="_blank" href="https://kestra.io/plugins/plugin-script-node/tasks/io.kestra.plugin.scripts.node.script">Checkout Doc</a></p>
</li>
</ul>
<p>For all the plugins and task types checkout <a target="_blank" href="https://kestra.io/plugins">here</a>.</p>
<blockquote>
<p>Note: I will be writing a separate blog on various cool task types</p>
</blockquote>
<hr />
<h1 id="heading-inputs">Inputs</h1>
<p>As we take inputs in programming languages to make our program more dynamic. We. can also take inputs in <strong>Kestra workflow</strong> to make our workflow more dynamic. The concept is simple you can take input from the user and depending on that you can execute your flow.</p>
<p>In kestra, <strong>inputs</strong> is a <strong>key-value</strong> pair, which contains <strong>id</strong>, <strong>type</strong>, <strong>defaults</strong> fields in YAML.</p>
<p>Below is a simple flow with inputs:</p>
<pre><code class="lang-yaml"><span class="hljs-attr">id:</span> <span class="hljs-string">flow-with-inputs</span>
<span class="hljs-attr">namespace:</span> <span class="hljs-string">ronak.blog</span>

<span class="hljs-attr">inputs:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">id:</span> <span class="hljs-string">name</span>
    <span class="hljs-attr">type:</span> <span class="hljs-string">STRING</span>
    <span class="hljs-attr">default:</span> <span class="hljs-string">"Ronak"</span>

  <span class="hljs-bullet">-</span> <span class="hljs-attr">id:</span> <span class="hljs-string">age</span>
    <span class="hljs-attr">type:</span> <span class="hljs-string">INT</span>
    <span class="hljs-attr">default:</span> <span class="hljs-number">20</span>

<span class="hljs-attr">tasks:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">id:</span> <span class="hljs-string">logging_task</span>
    <span class="hljs-attr">type:</span> <span class="hljs-string">io.kestra.plugin.core.log.Log</span>
    <span class="hljs-attr">message:</span> <span class="hljs-string">"My name is: <span class="hljs-template-variable">{{inputs.name}}</span> and age is <span class="hljs-template-variable">{{inputs.age}}</span>"</span>
</code></pre>
<p>In the above <strong>YAML</strong> file, we have inputs field which contains two types of inputs one is name <strong>(STRING)</strong> and age <strong>(INT)</strong>. And we are accessing the inputs in our tasks by the following syntax <strong>inputs.[input_id]</strong></p>
<p>We can do more complex kind of inputs as well like <strong>SELECT</strong>, <strong>DATE</strong> etc. But I will discuss those in a separate blog in depth.</p>
<p>But if you want to read you can checkout <a target="_blank" href="https://kestra.io/docs/workflow-components/inputs">here</a>.</p>
<hr />
<h1 id="heading-outputs">Outputs</h1>
<p>As the name suggests, <strong>outputs</strong> in <strong>Kestra</strong> are use to pass values from one task or flow to another. There are various methods to pass outputs from one task or flow to another for different situations or usecases.</p>
<p>For example you can to fetch some data from the database and want to process that data in <strong>python</strong>. In this scenario you will make two tasks: one for fetching the data’s from the database and other for processing the data in python. But before processing the data, you have to pass the fetched data to the processing task, for that you will use outputs in kestra.</p>
<p>Below is a very simple example of outputs:</p>
<pre><code class="lang-yaml"><span class="hljs-attr">id:</span> <span class="hljs-string">flow-with-outputs</span>
<span class="hljs-attr">namespace:</span> <span class="hljs-string">ronak.blog</span>

<span class="hljs-attr">inputs:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">id:</span> <span class="hljs-string">api_url</span>
    <span class="hljs-attr">type:</span> <span class="hljs-string">STRING</span>
    <span class="hljs-attr">defaults:</span> <span class="hljs-string">https://example.com/</span>

<span class="hljs-attr">tasks:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">id:</span> <span class="hljs-string">fetch-data</span>
    <span class="hljs-attr">type:</span> <span class="hljs-string">io.kestra.plugin.core.http.Request</span>
    <span class="hljs-attr">uri:</span> <span class="hljs-string">"<span class="hljs-template-variable">{{ inputs.api_url }}</span>"</span>

  <span class="hljs-bullet">-</span> <span class="hljs-attr">id:</span> <span class="hljs-string">log-fetched-data</span>
    <span class="hljs-attr">type:</span> <span class="hljs-string">io.kestra.plugin.core.log.Log</span>
    <span class="hljs-attr">message:</span> <span class="hljs-string">"Fetch data body: <span class="hljs-template-variable">{{outputs.fetch-data.body}}</span>"</span>
</code></pre>
<p>In the above <strong>YAML</strong> file, there are two tasks: fetch-data and log-fetched-data. And we are accessing the outputs of fetch-data by the following syntax:</p>
<p><strong>outputs.[task_id].[output_value]</strong></p>
<blockquote>
<p>Note: Other task types outputs can be pass in different ways but the syntax for accessing it will be the same.</p>
</blockquote>
<hr />
<h1 id="heading-triggers">Triggers</h1>
<p>Trigger’s are one of the great feature of <strong>Kestra</strong> (My favorite ❤️). The trigger’s are use to trigger a flow in Kestra on the basis of some events. Suppose you wants to trigger a flow when some image is uploaded to your <strong>AWS S3</strong> bucket for processing it and then saving to <strong>S3</strong>. In this case you can use trigger to make you flow.</p>
<p>There are various kinds of triggers available in Kestra. And those are:</p>
<ul>
<li><p><strong>Schedule Trigger:</strong> This kind of trigger is use to schedule your flow for execution at certain interval of time using cron jobs.</p>
</li>
<li><p><strong>Webhook Trigger:</strong> This kind of trigger is use to execute a flow on the basis of API requests from other sites or platform. (Suppose running a flow when a user clicks on a button on your site’s frontend)</p>
</li>
<li><p><strong>Polling Trigger:</strong> This kind of trigger polls a external system for presence of data and on the basis of that it executes a flow.</p>
</li>
<li><p><strong>Plugin based Triggers</strong>: Some plugin’s also has its own special kinds of trigger like S3’s trigger and others.</p>
</li>
<li><p><strong>Flow Trigger:</strong> This kind of trigger are use to execute a flow when another flow finishes its execution.</p>
</li>
<li><p><strong>Realtime Tigger:</strong> This kind of trigger can be use when we need realtime behaviour in flow execution.</p>
</li>
</ul>
<p>Overall, each trigger has its own uniqueness and usecases.</p>
<p>Below is an example of a simple <strong>Schedule Trigger:</strong></p>
<pre><code class="lang-yaml"><span class="hljs-attr">id:</span> <span class="hljs-string">flow_with_triggers</span>
<span class="hljs-attr">namespace:</span> <span class="hljs-string">ronak.blog</span>
<span class="hljs-attr">tasks:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">id:</span> <span class="hljs-string">log_task</span>
    <span class="hljs-attr">type:</span> <span class="hljs-string">io.kestra.plugin.core.log.Log</span>
    <span class="hljs-attr">message:</span> <span class="hljs-string">This</span> <span class="hljs-string">is</span> <span class="hljs-string">my</span> <span class="hljs-string">first</span> <span class="hljs-string">trigger</span> <span class="hljs-string">flow</span>

<span class="hljs-attr">triggers:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">id:</span> <span class="hljs-string">schedule_trigger</span>
    <span class="hljs-attr">type:</span> <span class="hljs-string">io.kestra.plugin.core.trigger.Schedule</span>
    <span class="hljs-attr">cron:</span> <span class="hljs-number">0</span> <span class="hljs-number">8</span> <span class="hljs-string">*</span> <span class="hljs-string">*</span> <span class="hljs-string">*</span> <span class="hljs-comment"># Everyday 8 AM</span>
</code></pre>
<p>In the above <strong>YAML</strong> file, the flow will execute everyday 8 AM.</p>
<hr />
<h1 id="heading-error-and-retries">Error and Retries</h1>
<p>Error and Retries are also a imporant feature in <strong>Kestra</strong>. We know that error are found to happen in any system. So Kestra provides a way to do some task on a error in the <strong>flow</strong> or <strong>namespace</strong> like sending a <strong>Email</strong> or <strong>Slack message</strong> on getting a error in the flow.</p>
<p>And also you can retry the execution of the flow on encountering with an error.</p>
<p>Below is a simple example of error handling flow:</p>
<pre><code class="lang-yaml"><span class="hljs-attr">id:</span> <span class="hljs-string">flow_with_error</span>
<span class="hljs-attr">namespace:</span> <span class="hljs-string">ronak.blog</span>

<span class="hljs-attr">tasks:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">id:</span> <span class="hljs-string">fail</span>
    <span class="hljs-attr">type:</span> <span class="hljs-string">io.kestra.plugin.core.execution.Fail</span> <span class="hljs-comment"># for forced failure</span>

<span class="hljs-attr">errors:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">id:</span> <span class="hljs-string">alert_on_failure</span>
    <span class="hljs-attr">type:</span> <span class="hljs-string">io.kestra.plugin.notifications.slack.SlackIncomingWebhook</span>
    <span class="hljs-attr">url:</span> <span class="hljs-string">"<span class="hljs-template-variable">{{ secret('SLACK_WEBHOOK') }}</span>"</span>
    <span class="hljs-attr">payload:</span> <span class="hljs-string">|
      {
        "channel": "#alerts",
        "text": "Failure alert for flow {{ flow.namespace }}.{{ flow.id }} with ID {{ execution.id }}"
      }</span>
</code></pre>
<p>In the above <strong>YAML</strong> file, the flow will give an error and after that a slack message will be send to the given <strong>SLACK_WEBHOOK</strong> with the respective message.</p>
<p>And a simple example of retry flow:</p>
<pre><code class="lang-yaml"><span class="hljs-attr">id:</span> <span class="hljs-string">flow_with_retry</span>
<span class="hljs-attr">namespace:</span> <span class="hljs-string">ronak.blog</span>

<span class="hljs-attr">tasks:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">id:</span> <span class="hljs-string">api_request</span>
    <span class="hljs-attr">type:</span> <span class="hljs-string">io.kestra.plugin.core.http.Request</span>
    <span class="hljs-attr">uri:</span> <span class="hljs-string">https://example.com/products</span>
    <span class="hljs-attr">retry:</span>
      <span class="hljs-attr">type:</span> <span class="hljs-string">constant</span> <span class="hljs-comment"># type: string</span>
      <span class="hljs-attr">interval:</span> <span class="hljs-string">PT20S</span> <span class="hljs-comment"># type: Duration</span>
      <span class="hljs-attr">maxDuration:</span> <span class="hljs-string">PT1H</span> <span class="hljs-comment"># type: Duration</span>
      <span class="hljs-attr">maxAttempt:</span> <span class="hljs-number">10</span> <span class="hljs-comment"># type: int</span>
      <span class="hljs-attr">warningOnRetry:</span> <span class="hljs-literal">true</span> <span class="hljs-comment"># type: boolean, default is false</span>
</code></pre>
<p>In the above <strong>YAML</strong> file, the flow will request at the given http endpoint and retry for every 20 seconds upto 1 hour and maximum of 10 attempts until the endpoint is hitted successfully.</p>
<hr />
<h1 id="heading-conclusion">Conclusion</h1>
<p>So far I loved <strong>Kestra</strong>. And the thing that it is open source, exicites me more. In my future blogs I will be writing more on this tool from concept deep dive to actual project implementation. Till then Byy 👋</p>
<p>I hope you liked the blog. Let me know what do you think about <strong>Kestra.</strong></p>
]]></content:encoded></item><item><title><![CDATA[Easily Launch Your Local PostgreSQL Database and pgAdmin with Docker]]></title><description><![CDATA[Hey everyone 👋, Couple of days ago I started building an web application using postgreSQL as the database. I found out that it is little bit tidious task to setup up a connection for postgreSQL (Since I am a linux user). So I thought why not use doc...]]></description><link>https://blog.ronakpaul.com/easily-launch-your-local-postgresql-database-and-pgadmin-with-docker</link><guid isPermaLink="true">https://blog.ronakpaul.com/easily-launch-your-local-postgresql-database-and-pgadmin-with-docker</guid><category><![CDATA[postgresql setup]]></category><category><![CDATA[PostgreSQL]]></category><category><![CDATA[Docker]]></category><category><![CDATA[pgAdmin]]></category><category><![CDATA[database]]></category><dc:creator><![CDATA[Ronak Paul]]></dc:creator><pubDate>Wed, 13 Mar 2024 11:05:46 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1710324387560/f93f27e8-dc2e-44f3-862f-b96ad7814153.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey everyone 👋, Couple of days ago I started building an web application using <strong>postgreSQL</strong> as the database. I found out that it is little bit tidious task to setup up a connection for <strong>postgreSQL</strong> (Since I am a linux user). So I thought why not use <strong>docker</strong> to pull up the image of <strong>postgreSQL</strong> and <strong>pgAdmin</strong> and then run it in the docker container itself.</p>
<p>So in this blog, I am going to give a step by step procedure to run <strong>postgreSQL</strong> and <strong>pgAdmin</strong> in the docker container. And in the next blog I will make a <strong>TODO</strong> app using postgreSQL.</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<p>There is only one prerequisite to setup <strong>postgreSQL</strong> on your local machine.</p>
<ul>
<li>Basic <strong>Docker</strong> commands</li>
</ul>
<p>Before proceeding, you should have <strong>Docker</strong> installed on your system.</p>
<h2 id="heading-postgresql-amp-pgadmin">PostgreSQL &amp; pgAdmin</h2>
<p>Well before going into the steps to run postgreSQL, let's first understand what is <strong>postgreSQL</strong>.</p>
<p><strong>PostgreSQL</strong> is an advanced, open-source, enterprise-level relational database that supports both <strong>SQL</strong> (relational) and <strong>JSON</strong> (non-relational) querying.</p>
<p>On the other hand, <strong>pgAdmin</strong> is an open source management tool for postgreSQL. It provides an powerful graphical interface that simplifies the creation, maintenance, and use of the database objects. You can write SQL queries directly from the query tool provided by pgAdmin.</p>
<p>So basically, PostgreSQL is the main database and pgAdmin is for managing your PostgreSQL databases.</p>
<h2 id="heading-postgresql-setup">PostgreSQL setup</h2>
<h3 id="heading-pulling-docker-images">Pulling docker images</h3>
<p>Now let's setup our <strong>postgreSQL</strong> database using <strong>Docker</strong>.</p>
<p>So, first of all, we have to pull the images of the <strong>postgreSQL</strong> and <strong>pgAdmin</strong> from the docker registry using the below commands.</p>
<pre><code class="lang-bash">docker pull postgres
</code></pre>
<p><em>The above command will pull the</em> <strong><em>postgreSQL</em></strong> <em>database image from docker registry.</em></p>
<pre><code class="lang-bash">docker pull dpage/pgadmin4
</code></pre>
<p><em>The above command will pull the</em> <strong><em>pgAdmin4</em></strong> <em>image from docker registry.</em></p>
<p>To see all the pulled docker images. You can run the below command:</p>
<pre><code class="lang-bash">docker images
</code></pre>
<h3 id="heading-spinning-up-the-docker-containers">Spinning up the docker containers</h3>
<p>Since we successfully pulled the two docker images, now we can move to the next step.</p>
<p>In this step, we will start the <strong>postgreSQL</strong> database and <strong>pgAdmin</strong> in the docker containers and also map the <strong>host port</strong> to the <strong>container port</strong> so that we can communicate to the container from our machine.</p>
<p>Now run the below command to start the <strong>postgreSQL</strong> database container. After running the command, you will see bunch of lines printed on the terminal and it is running.</p>
<pre><code class="lang-bash">docker run -p 5432:5432 -e POSTGRES_PASSWORD=<span class="hljs-string">'YOUR-PASSWORD'</span> postgres
</code></pre>
<p>Here is the breakdown of the above command :</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1710327340239/cc050c44-0865-42a4-a908-c7defb763a3c.png" alt class="image--center mx-auto" /></p>
<p>Now open a different tab in the terminal and also run the below command to start the <strong>pgAdmin</strong> container in that tab. Here also you will see bunch of lines printed on the terminal and it is running.</p>
<pre><code class="lang-bash">docker run -p 8080:80  -e PGADMIN_DEFAULT_EMAIL=<span class="hljs-string">'YOUR-EMAIL'</span> -e PGADMIN_DEFAULT_PASSWORD=<span class="hljs-string">'YOUR-pgAdmin-PASSWORD'</span> dpage/pgadmin4
</code></pre>
<p>This command's breakdown is also same as above, just it has two environment variables.</p>
<p>Wow!!! Your database and <strong>pgAdmin</strong> containers are now up and running.</p>
<p>To list out which containers are running, you can open up another tab in the terminal and run the below command.</p>
<pre><code class="lang-bash">docker ps
</code></pre>
<p>And to stop a container, you can run the below command.</p>
<pre><code class="lang-bash">docker stop &lt;CONTAINER-ID&gt;
</code></pre>
<h3 id="heading-connect-postgresql-to-pgadmin">Connect postgreSQL to pgAdmin</h3>
<p>Go to any browser on your desktop/laptop and open <strong>http://localhost:8080</strong> . This will open up the <strong>pgAdmin4</strong> on the web.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">❌</div>
<div data-node-type="callout-text">If the<strong> http://localhost:8080</strong> does not opens up then there is a problem in the previous steps. To resolve this, you can stop the containers and again do previous steps correctly.</div>
</div>

<p>You will see the below login page of <strong>pgAdmin4</strong>. Just fill out the login page with the Email and Password which you have given while starting the <strong>pgAdmin</strong> container.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1710308458213/3bf550df-a587-4b21-b16c-d2398a252142.png" alt class="image--center mx-auto" /></p>
<p>Now if the login credentials are correct then you will see a page like below.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1710308908728/68817760-9d1e-451d-a940-d1c32f27eb7e.png" alt class="image--center mx-auto" /></p>
<p>Now click on the <strong>Add New Server</strong> button inside the quick links section. Then a dialog box will open up like below, which will ask you to setup the database server name and other credentials of the <strong>postgreSQL</strong> database.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1710324701399/16b29972-1b02-44c0-a8d4-ee34b46a1644.png" alt class="image--center mx-auto" /></p>
<p>Now give a name to the server. For now I am giving the name as <strong>todo</strong>. Then go to the connection section of the dialog box, there you will see bunch of fields like below.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1710324898656/b717b9ee-fae1-4c52-836c-f418c5374b1f.png" alt class="image--center mx-auto" /></p>
<p>Here you have to fill three input fields.</p>
<ul>
<li><p><strong>Host name/address:</strong> In this field you have to give the host name i.e. my machine name. For example:</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1710325439855/f4b73cbb-2796-470b-8921-8ddc8743b15d.png" alt class="image--center mx-auto" /></p>
</li>
<li><p><strong>Username:</strong> By default, the username is <strong>postgres</strong>.</p>
</li>
<li><p><strong>Password:</strong> Give the password which you have given while starting the <strong>postgres</strong> container.</p>
</li>
</ul>
<p>Now click the save button and if everything is correct then it will create a server for you and below page will be displayed otherwise an error message will be shown.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1710325658519/ac65bfd0-089e-4538-9d18-0c65d7946b9e.png" alt class="image--center mx-auto" /></p>
<p>Now you can see, In the left size there is all the options. For writing queries in the database, you can simply right click on the <strong>postgres</strong> option under the <strong>Databases</strong> and then select the <strong>query tool</strong> option. Then a new query page will open up like below.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1710325907935/daa52b4c-2313-4b28-8c1b-c7db6a8d7d9e.png" alt class="image--center mx-auto" /></p>
<p>Now you can simply run queries over here and click on the run button to see the output.</p>
<p>Congratulations 🥳 !!! You successfully setup <strong>postgreSQL</strong> database and <strong>pgAdmin</strong> using Docker.</p>
<p>In the next blog, I will make an <strong>TODO</strong> web application using <strong>postgreSQL</strong> as the database.</p>
<p>Stay tuned for more blogs like this and subscribe to my newsletter.</p>
<p>Bye 👋</p>
]]></content:encoded></item><item><title><![CDATA[Empowering UI: Unveiling the Server-Driven Approach]]></title><description><![CDATA[Hey everyone 👋, everything that used long ago, comes back as new in the present day, like clothing styles 👕 and many more. In this blog, I am going to talk about SDUI (Server Driven User interface), which is under the hood using the old traditional...]]></description><link>https://blog.ronakpaul.com/empowering-ui-unveiling-the-server-driven-approach</link><guid isPermaLink="true">https://blog.ronakpaul.com/empowering-ui-unveiling-the-server-driven-approach</guid><category><![CDATA[SDUI demo]]></category><category><![CDATA[SDUI ]]></category><category><![CDATA[server-driven-ui]]></category><category><![CDATA[Mobile Development]]></category><category><![CDATA[app development]]></category><category><![CDATA[User Interface]]></category><category><![CDATA[React Native]]></category><category><![CDATA[Flutter]]></category><category><![CDATA[Kotlin]]></category><category><![CDATA[Android]]></category><category><![CDATA[iOS]]></category><dc:creator><![CDATA[Ronak Paul]]></dc:creator><pubDate>Tue, 30 Jan 2024 05:48:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1706592984149/ba73020b-0f25-4be6-bcdd-bdc68f32d5c3.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey everyone 👋, everything that used long ago, comes back as new in the present day, like clothing styles 👕 and many more. In this blog, I am going to talk about <strong>SDUI</strong> (<strong>Server Driven User interface</strong>), which is under the hood using the old traditional method, which I will explain throughout this blog.</p>
<p>I am pretty sure that after reading this blog, you will understand almost everything about <strong>Server Driven User interfaces</strong>. Also, I am going to give you a demo by making a small SDUI project. So stay with me till the end of this blog. Let's get started.</p>
<h2 id="heading-then-vs-now">Then vs Now</h2>
<p>Well, before going into <strong>SDUI</strong>, let's understand how things happened in the past and how things are happening now. So, in the past, there were only websites and no mobile applications. ( In 1990's )</p>
<p>We know how websites work. It is like when a client opens up a <strong>webpage</strong>, a request is sent to the server so that the server can give a response with the required files (<strong>HTML, CSS, and JavaScript files</strong>) that are needed to display our website. It is happening on the web.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1706591966801/98d759f7-3e8d-40b5-aed2-2895d0e1846a.png" alt class="image--center mx-auto" /></p>
<p>But for mobile apps, the codes are hard coded on the application side.</p>
<p>In the present time, we are using both technologies.</p>
<h2 id="heading-what-is-sdui">What is SDUI ?</h2>
<p><strong>SDUI</strong> (<strong>Server Driven User Interface</strong>) is a method of rendering the <strong>front-end or user interface</strong> of mobile applications from the server without hard coding it on the application side. It is like instructing the application to display certain widgets or elements at certain places by the server.</p>
<p>The server sends the information about the elements (like their width, height, color, position, etc) in simple <strong>JSON</strong> format, and the application converts that data into the respective application stack's code. That means if it is <strong>react-native</strong> then the <strong>JSON</strong> data will be converted into <strong>react-native</strong> code by some pre-written functions or converter.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1706592298703/8c385d9f-3b57-42a0-a031-6229259a52d5.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-what-problem-it-is-solving">What problem it is solving ?</h2>
<p>Well, as I stated above how things happened in the past and how things are happening now. We can see that the main problem at present is that the mobile application code is <strong>hard-coded</strong> on the client side. So if a developer wants to release a new version of the app, they have to push the new app to the <strong>Play Store</strong> or <strong>App Store</strong>. After that, a user will have to go to the <strong>Play Store</strong> or <strong>App Store</strong> to update the app then only they can see the changes in the app. That means in this case, nothing is spontaneous. It is the reason why some use an <strong>old version</strong> of the app, and some use a <strong>new version</strong> of the app. And this is where inconsistency is created.</p>
<p>There are also apps where you have to display the changes spontaneously without the need to update the app on the Play Store or App Store (like <strong>Amazon</strong>, <strong>Flipkart,</strong> etc). We know that <strong>Amazon , Flipkart</strong> frequently changes the UI and banners of the app depending on many factors, and you can see the changes spontaneously without the requirements of updating the app.</p>
<p>And in some other cases, as a developer you have to experiment app's features to a group of user but not all, so that you can figure out is that the feature is worth or not.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1706592743030/b8b38334-dce4-4dad-91fb-244334b7ee55.png" alt class="image--center mx-auto" /></p>
<p><strong>So how does that work?</strong></p>
<p>In this kind of application, the whole app is not hard-coded on the client end. These apps, use the concepts of <strong>SDUI</strong> (<strong>Server Driven User Interface</strong>), which means the server instructs the application on how and where to display the UI components. So it is like our web technology, which takes the files from the server to display to the end-user or client.</p>
<p>That's what <strong>SDUI</strong> is trying to solve. It wants the mobile applications UI to be <strong>server-driven</strong> so that they can be updated frequently.</p>
<h2 id="heading-how-sdui-works">How SDUI works?</h2>
<p>Now the main question is how <strong>SDUI</strong> actually works. To be honest, it is quite simple. If you have knowledge of <strong>web development</strong> and <strong>APIs</strong>, then it would be a very familiar kind of thing for you. But even if you don't know anything then also I will make you understand.</p>
<p>We know that on the web, when a user goes to any website URL, the browser sends a request to the server and the server sends back the <strong>HTML, CSS, and Javascript</strong> files in response. The browser then displays the <strong>webpage</strong> to the user.</p>
<p>So same concept also applies to <strong>SDUI</strong>. We know that <strong>SDUI</strong> is for mobile applications and when a user opens up an application on their mobile phone, a request is sent to the server and the server sends back <strong>JSON data</strong> in response. Which in turn is converted into application code by some converter. Thus, UI is sent in the form of <strong>JSON</strong> from the server and that's it. That's how <strong>SDUI</strong> works. Isn't it easy?</p>
<h2 id="heading-drawbacks">Drawbacks</h2>
<p>There are some drawbacks of <strong>SDUI</strong> and those are listed below :</p>
<ul>
<li><p>For a <strong>SDUI</strong> based application you always gonna need an internet connection.</p>
</li>
<li><p>There are chances of <strong>single point of failure</strong> since the UI is dependent on the server.</p>
</li>
<li><p>It may reduces the <strong>performance</strong> of the application.</p>
</li>
</ul>
<p><strong>Now how to deal with this drawbacks?</strong></p>
<p>Basically, the answer is quite simple. The fact is you wouldn't be using the <strong>SDUI</strong> for your whole application. Using <strong>SDUI</strong> in some parts of the application is helpful where you require constant changes, like the banners for sale in E-commerce apps, the info section of many apps, and more.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Lastly, I would say that <strong>SDUI</strong> is quite a good approach for the apps where continuous changes are required but you should not make full app <strong>SDUI</strong> based because it has many drawbacks. The approach is quite simple but effective.</p>
<p>Thank you reading the blog. 🙌</p>
]]></content:encoded></item><item><title><![CDATA[React : A Powerhouse For Developers]]></title><description><![CDATA[Hey folks 👋, in this blog I am going to deep dive into the react ecosystem i.e what is react, why it is so powerful, components & JSX, app development, and in the whole blog I am going give you my personal experience as a react developer. So let's g...]]></description><link>https://blog.ronakpaul.com/react-a-powerhouse-for-developers</link><guid isPermaLink="true">https://blog.ronakpaul.com/react-a-powerhouse-for-developers</guid><category><![CDATA[React]]></category><category><![CDATA[React Native]]></category><category><![CDATA[components]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[Next.js]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[app development]]></category><dc:creator><![CDATA[Ronak Paul]]></dc:creator><pubDate>Tue, 23 Jan 2024 09:05:32 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1705996974907/e2fbf16a-e4eb-4c67-b672-453cd4158b26.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey folks 👋, in this blog I am going to deep dive into the react ecosystem i.e <strong>what is react</strong>, <strong>why it is so powerful</strong>, <strong>components &amp; JSX</strong>, <strong>app development</strong>, and in the whole blog I am going give you my personal experience as a react developer. So let's get started with no further delay.</p>
<p>There is no such prerequisite for this blog, you just have to know a basic knowledge of functions and that's it.</p>
<h2 id="heading-what-is-reactjs">What is React.js ?</h2>
<p>Well, React.js is a Javascript library developed by <strong>Meta</strong> ( formerly <strong>Facebook Inc.</strong>) and released in <strong>2013</strong>. It provides a component based development i.e. every section like header, footer, cards are different components in React.js. It reduces the lines of code by reusability of codes using components.</p>
<p>In the below sections I will explain different concepts of React.js like components and JSX .</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705995947685/ca4658e4-2ab5-427d-a69f-cf73ec5f51a6.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-what-makes-it-powerful">What makes it powerful ?</h2>
<p>One of the important feature of React which makes the React so powerful and popular is its component based development because it enforces code reusability thus reducing the lines of code for development. And the most important part is that it is not even a new thing, under the hood it is using HTML, CSS and Javascript only. And I will also gonna tell you how react is actually working. So that means you have to know HTML, CSS &amp; Javascript to get started with react. (But just the base level understanding is enough).</p>
<h2 id="heading-components-amp-jsx">Components &amp; JSX</h2>
<p><strong>Components:</strong> Components are the individual parts of a website which on combining makes the whole website. For example suppose you have a header component, hero section component, card component, and a footer component. And if you combine the components then you will get to see the whole webpage consisting of these components.<br />Components enforces code reusability because you can use the same component in many different places or webpages.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705991934969/0c9d4ad5-9c8b-49db-9373-89d056be18d1.png" alt class="image--center mx-auto" /></p>
<p>In the above diagram, we used 4 different components in the page. Each component has its independent code and the card component is used multiple times in the same page. That's how it works. 🤷</p>
<p>React just break the whole website in simple components, which we can use in any of our page.</p>
<p><strong>JSX:</strong> JSX is very important feature by which react was made. JSX means the combination of Javascript and HTML in a single file. That means you can use HTML in Javascript and vice versa. For example:</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// JSX example</span>
<span class="hljs-keyword">const</span> Header = <span class="hljs-function">() =&gt;</span> { <span class="hljs-comment">// javascript code</span>
    <span class="hljs-keyword">return</span> (
        <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span> <span class="hljs-comment">&lt;!-- HTML code --&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>This is a header<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
    );
}
</code></pre>
<h2 id="heading-how-it-works">How it works?</h2>
<p>If you talk about the underlying principle of react then it is like a Javascript function returning some HTML by using JSX. So whenever that particular function calls, it just returns HTML. That's it. And particularly that function is called a functional component.</p>
<p>At first let's create a normal function, which is returning some string.</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// It is the ES6 way of writing fuctions</span>
<span class="hljs-keyword">const</span> sampleFunction = <span class="hljs-function">() =&gt;</span> {
       <span class="hljs-keyword">return</span> <span class="hljs-string">"It is a sample function"</span>;
}

<span class="hljs-built_in">console</span>.log(sampleFuction());

<span class="hljs-comment">// Output : It is a sample function</span>
</code></pre>
<p>So, if you are already familiar with functions then you will know that it is just a simple function which is returning a simple string.</p>
<p>And when we talk about react's functional component then it is also a simple function which is just returning some kind of HTML codes. For example:</p>
<pre><code class="lang-javascript">
<span class="hljs-keyword">const</span> MainSection = <span class="hljs-function">() =&gt;</span> {
    <span class="hljs-keyword">return</span> (
        <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>It is a main section <span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span></span>
    );
}

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> MainSection; <span class="hljs-comment">// exporting the function</span>
</code></pre>
<p>And for calling the above function, we use tags kind of structure and we also have to export it and import it in another file to use. Like below:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">import</span> MainSection <span class="hljs-keyword">from</span> <span class="hljs-string">"./MainSection"</span>; <span class="hljs-comment">// importing it</span>

<span class="hljs-keyword">const</span> App = <span class="hljs-function">() =&gt;</span> {
    <span class="hljs-keyword">return</span> (
        <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">MainSection</span> /&gt;</span>  <span class="hljs-comment">&lt;!-- Calling the function --&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
    );
}
</code></pre>
<p>And it will be treated like below:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">import</span> MainSection <span class="hljs-keyword">from</span> <span class="hljs-string">"./MainSection"</span>;

<span class="hljs-keyword">const</span> App = <span class="hljs-function">() =&gt;</span> {
    <span class="hljs-keyword">return</span> (
        <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
            <span class="hljs-comment">&lt;!-- Below is the returned html code --&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>It is a main section <span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span> 
        <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
    );
}
</code></pre>
<p>Now let's see a diagram of many components and using it in one file.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705994399984/25acd34b-2e3a-4e32-aaea-15086b504a27.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705994758431/1cf5c9ac-08ca-45a7-8822-deb693c98b48.png" alt class="image--center mx-auto" /></p>
<p>In the above diagram, we have 3 components and we have the html returning from those components. So we use the components in single file and it returned the html's from all the components in that single file. and that's how it works. 🤷</p>
<h2 id="heading-app-development">App Development</h2>
<p>Everyone wants to know how to develop <strong>Android</strong> or <strong>IOS</strong> apps 📱. But if I tell you, you can develop both <strong>Android</strong> &amp; <strong>IOS</strong> apps by react and here comes <strong>react-native</strong>, a cross-platform app development tool. It is like flutter with one most powerful advantage and that is you can learn react-native very fastly if you already know react. Basically I learned react-native in just <strong>1 day</strong> since I already knew react.</p>
<p>And another cool thing about react-native is that you don't need a high spec laptop to get started. You can use any mid-range laptop for it. Basically I am personally doing react-native on my very low powered laptop. (Like one of the slowest laptop I ever seen 😂)</p>
<h2 id="heading-my-experiance">My Experiance</h2>
<p>Let's get into my story 🫥. So from the beginning of my development journey I was using <strong>HTML</strong>, <strong>CSS</strong> and <strong>Javascript</strong>. And I became very comfortable with this three things that I made many games, websites, animations with this. But one day I decided to learn <strong>React.js</strong> and I started reading docs about <strong>React.js</strong> and after couple of days I learned the fundamentals of React.js and from that point I just fall in love with it ❤️. And I still remember I once made a movie website which has lots of repetitive codes and after learning react I just laughed at myself saying "why I didn't learn react before". So I highly recommend to have a look on <strong>React.js</strong>.</p>
<p>So lastly I just have to say one thing and that is just learn it. And if you learn <strong>React.js</strong> then you also can start to learn <strong>Next.js</strong> on top of it. And you may know that Next.js is becoming very popular nowadays.</p>
<p>And I will be writing more blogs on React.js in depth in my future blogs. So stay tuned for that and subscribe to my newsletter for more updates.✌️<br />Thank you for reading the blog. Have a great day.🙌</p>
]]></content:encoded></item><item><title><![CDATA[My AWS Adventure: The AWS Community Day, Jaipur Experience]]></title><description><![CDATA[Hey 👋, In this blog I am going to talk about my experiences at the AWS Community Day Jaipur event, what are the things I learned from the event and also the networking part. Btw I am also going to talk about the foods and swags in the event so stay ...]]></description><link>https://blog.ronakpaul.com/my-aws-adventure-the-aws-community-day-jaipur-experience</link><guid isPermaLink="true">https://blog.ronakpaul.com/my-aws-adventure-the-aws-community-day-jaipur-experience</guid><category><![CDATA[AWS]]></category><category><![CDATA[AWS Community Builder]]></category><category><![CDATA[AWS Community Day]]></category><category><![CDATA[tech events]]></category><category><![CDATA[aws user group jaipur]]></category><dc:creator><![CDATA[Ronak Paul]]></dc:creator><pubDate>Mon, 06 Nov 2023 05:11:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1699213122264/c7035f00-ae93-4f9c-b0af-a1f5313de51c.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey 👋, In this blog I am going to talk about my experiences at the <strong>AWS Community Day Jaipur event</strong>, what are the things I learned from the event and also the networking part. Btw I am also going to talk about the <strong>foods and swags</strong> in the event so stay till the end 😁.</p>
<p>Before going to tell about my experiences let's talk about what is <strong>AWS</strong> and an <strong>AWS Community Day</strong>. And if you already know it then you can freely skip this section.</p>
<h3 id="heading-what-is-aws">What is AWS?</h3>
<p><a target="_blank" href="https://docs.aws.amazon.com/"><strong>AWS (Amazon Web Services)</strong></a> is an <strong>IaaS (Infrastructure as a Service)</strong> platform that gives its infrastructure to the user to use on a <strong>pay-as-you-go</strong> plan basis. AWS provides various services to be utilized by many developers, founders and entrepreneurs. Through AWS you don't have to buy a real server, you just have to pay for the amount of resources you use. It the most successful and popular cloud provider around the world for so many decades. 🌎</p>
<h3 id="heading-what-is-aws-community-day">What is AWS Community Day?</h3>
<p><strong>AWS Community Day</strong> is an event organised by AWS community builders around the globe to give knowledge of <strong>AWS</strong>, its various services and certification knowledge. In this event, many tech leaders, industry experts, developers, and students come and join. Through this event, we connect with like-minded people and share knowledge.</p>
<p>This event was also an <strong>AWS Community Day Event organized in Jaipur</strong>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699215970463/a91fd31b-dda1-4540-b8e3-6d5ab880d8aa.png" alt class="image--center mx-auto" /></p>
<p>Now I will talk about my experiences and learning from the event.</p>
<h3 id="heading-my-experience-and-learnings">My Experience and learnings</h3>
<p>As this was the first event ever that I attended the feel and experience were awesome like at the top level. When I entered the event I got relief since I was travelling for <strong>3 hours</strong>. ⏰</p>
<p>After entering through the gate I saw so many students already there waiting for the event to start and then my excitement reached its peak level. 💯</p>
<p>Then after a while community members started to distribute the entry cards and bands.</p>
<p>And then we took our seats and waited for the event to start.</p>
<p>Then finally the event started with lamp lighting by <a target="_blank" href="https://www.linkedin.com/in/bhuvanas/"><strong>Mrs</strong> <strong>Bhuvaneswari Subramani</strong></a> (a true luminary in Tech, AWS Devtools Hero, and Chief Cloud Evangelist, at <strong>Intuitive Cloud</strong>). Honestly, the lamp lighting reminded me of my school days. 🏫</p>
<p>Then the event started with a talk by <a target="_blank" href="https://www.linkedin.com/in/bhuvanas/"><strong>Mrs Bhuvaneswari Subramani</strong></a><strong>.</strong> She talked about her <strong>24 years of experience</strong> in this field. She talked about her journey to become an <strong>AWS Devtools Hero</strong> and more. The talk was very inspirational and motivating.</p>
<p>Then there was a very exciting talk by <a target="_blank" href="https://www.linkedin.com/in/enterprise-cloud-architect/"><strong>Mr Abhishek Gupta</strong></a> on a very interesting and currently booming topic, which is <strong>Generative AI</strong>. Of course, it is one of my favourite things I mean who doesn't like <strong>Gen-AI?</strong> He explains how one can use <strong>AWS Bedrock</strong> to implement <strong>Gen-AI</strong> capabilities into their project with just a few lines of code. Isn't it amazing? He also showed some live demos by generating some texts through <strong>AWS Bedrock</strong> and some by generating images.</p>
<p>After this exciting session, there was a very important talk by <a target="_blank" href="https://www.linkedin.com/in/dishababla/"><strong>Mrs Disha Babla</strong></a> on the topic of various AWS certification exams. She talks about how one can prepare for the certification exam. She also mentioned the <strong>AWS skill builder</strong> website from where one can prepare for the exams. Btw I am already learning from AWS Skill Builder and it is quite good. The things that mam talks about are very informative and crucial for everyone.</p>
<p>Then there was a talk by <a target="_blank" href="https://www.linkedin.com/in/jones-zachariah-noel-n/"><strong>Mr</strong> <strong>Jones Zachariah Noel N</strong></a> on the topic <strong>of serverless with AWS.</strong> He explained all the concepts of serverless with AWS lambda and there was another technology that he talked about, which I forgot 🙁. But the talk was amazing. 🔥</p>
<blockquote>
<p>Then there was a lunch after that we again went to the auditorium and the event resumed after some time.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">Check out the foods and swags section to know what was in the lunch. 🤤 🥗</div>
</div>

</blockquote>
<p>After lunch, there was a talk by <a target="_blank" href="https://www.linkedin.com/in/amitkyvmw/"><strong>Mr Amit Kumar</strong></a> on the topic of <strong>CI/CD (Continuous Integration and Continuous Deployment) at Scale</strong>. I liked the talk of this person. The way he spoke and the personality of him was just incredible. He explained how continuous integration and continuous deployment can help you to better maintain software products. He explained in a great way what <strong>continuous integration and continuous deployment</strong> are. I enjoyed and learned lots of things from this talk.</p>
<p>Then there was a talk by <a target="_blank" href="https://www.linkedin.com/in/dheeraj-choudhary/"><strong>Mr Dheeraj Choudhary</strong></a> on the topic of <strong>AWS CodeWhisperer</strong>. He explains everything about Code Whisperer, which is a code companion to help you write your code in a <strong>57% faster</strong> way and an industry-standard way. He explains how <strong>AWS CodeWhisperer</strong> can help you write your code in an IDE to make your development faster. He also showed a live demo on this very exciting topic and surely I will be adapting this code companion thing in my daily coding life.</p>
<p>After this wonderful talk, there was a talk by <a target="_blank" href="https://www.linkedin.com/in/ashishtiwari93/"><strong>Mr Ashish Tiwari</strong></a> on the topic of <strong>AWS</strong> <strong>Elastic Search.</strong> This talk just reveals how actually search engines understand the meaning of our search even if I type something wrong. He explains how one can integrate this feature with their search engines by using <strong>AWS Elastic Search.</strong> He also showed some demos by comparing a normal search engine and a search engine powered by <strong>Elastic Search</strong>. 🔎</p>
<p>Then finally there was a <strong>Panel Discussion</strong> between the community leaders and other developers, where <a target="_blank" href="https://www.linkedin.com/in/adityasonittyl/"><strong>Aditya Soni</strong></a> was the judge and other panel members were <a target="_blank" href="https://www.linkedin.com/in/seemasaharan/"><strong>Seema Saharan</strong></a><strong>,</strong> <a target="_blank" href="https://www.linkedin.com/in/abhineet05/"><strong>Abhineet Saxena</strong></a><strong>,</strong> <a target="_blank" href="https://www.linkedin.com/in/rksachin5/"><strong>Sachin Sharma</strong></a><strong>,</strong> <a target="_blank" href="https://www.linkedin.com/in/ritu-soni1/"><strong>Ritu Soni</strong></a><strong>,</strong> <a target="_blank" href="https://www.linkedin.com/in/gargee-bhatnagar-6b7223114/"><strong>Gargee Bhatnagar</strong></a><strong>.</strong> The panel discussion was just fun and awesome. Learned a lot of things from there. Everyone answers certain important questions like "Is DSA still needed after getting a job?", "How to became AWS ambassador" etc. Overall I loved the panel discussion and also liked the jokes about "<strong>Bhupendra Jogi</strong>" and "<strong>Bangan</strong>" 🍆 by <strong>Abhineet Saxena</strong> sir. 😂</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699247153897/17d8a0e5-7ee2-4285-9561-7c25ccb6c470.png" alt class="image--center mx-auto" /></p>
<p>Then there was a talk by <strong>Mr Nitin Sharma</strong> on the topic of <strong>Security patterns with AWS IAM</strong>. It was also a great talk. I learned about how one can get into your AWS account without your consent and how to prevent that. 🧑🏽‍💻</p>
<p>And at the last, there were extra <strong>swag giveaways</strong> for <strong>social media contests</strong>, <strong>meme contests</strong> and others. Also the speakers and teach leaders are felicitated in Rajasthani style. Then there was a cutting of the cake. 🥮</p>
<p>And then we took some group photos, which I didn't get till now. 😕</p>
<p>So overall my experience with this event was great. I learned lots of things from this event. The community leaders and speakers are very motivating. I am just waiting for the next event to come so that I can join the event.😁</p>
<h3 id="heading-networking">Networking</h3>
<p>Through the event, I networked with many other folks who are also enthusiastic about the <strong>cloud</strong> and curious about <strong>new software engineering technologies</strong> that are coming up.</p>
<p>Being an introvert I talk less with people but this time I talked a lot. Maybe because I have some like-minded people around me. Whatever the reason I liked it very much. I think through this I can improve my communication skills and connect with more like-minded people.</p>
<h3 id="heading-foods-and-swags">Foods and Swags</h3>
<p><strong>Foods foods foods</strong> !!!!! we all love it. Right? At this event, we got some delicious food. First of all, we got some breakfast with <strong>Poha, Bhujia, Samosa and Coffee</strong>.</p>
<p>For lunch, we got <strong>Salad, Papar, Panner, fried rice, Naan, Roti, Mix Veg, Dal, Gulab Jamun and Ice Cream.</strong> The pictures of the food are here:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699215237709/33d72b66-f2b4-40f8-8ab9-0ed8bf33b4ac.png" alt class="image--center mx-auto" /></p>
<p>Now if you are curious about the swag then it was like I got an <strong>AWS t-shirt</strong> 👕, got two <strong>premium GitHub stickers</strong>, and some other stickers as well.</p>
<p>Here is the snapshot of the swags 👕 that I got:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699215742374/e07e4a71-4f31-4a2b-88fb-f89be1fbc780.png" alt class="image--center mx-auto" /></p>
<p>And lastly, we got a <strong>Red Bull</strong> because we all know that Red Bull gives us wings. 🪽</p>
<h3 id="heading-conclusion">Conclusion</h3>
<p>In a nutshell, the event was super amazing. This was one of my best experiences ever. Thank you <strong>AWS User Group Jaipur</strong> for organizing this amazing event and giving us so much love and knowledge. Looking forward to more exciting events like this.</p>
<p>Thank you for reading the blog. See you next time. Bye 👋</p>
]]></content:encoded></item><item><title><![CDATA[Understanding the Fundamental Divide: Libraries vs. Frameworks]]></title><description><![CDATA[In the vast landscape of software development, two terms that often surface are "libraries" and "frameworks". While both play pivotal roles in simplifying and expediting the development process, they serve distinct purposes and exhibit subtle yet sig...]]></description><link>https://blog.ronakpaul.com/understanding-the-fundamental-divide-libraries-vs-frameworks</link><guid isPermaLink="true">https://blog.ronakpaul.com/understanding-the-fundamental-divide-libraries-vs-frameworks</guid><category><![CDATA[React]]></category><category><![CDATA[framework]]></category><category><![CDATA[library]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[Next.js]]></category><dc:creator><![CDATA[Ronak Paul]]></dc:creator><pubDate>Fri, 27 Oct 2023 06:04:24 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1698386368876/7831b820-d168-40ae-9619-c4bcd7dee730.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the vast landscape of software development, two terms that often surface are <strong>"libraries"</strong> and <strong>"frameworks".</strong> While both play pivotal roles in simplifying and expediting the development process, they serve distinct purposes and exhibit subtle yet significant differences that every developer should grasp.</p>
<p>In this blog, we delve into the fascinating world of libraries and frameworks. We aim to demystify these concepts, explore their unique characteristics, and help you discern when to employ one over the other. Whether you're an experienced coder or a curious beginner, understanding the differences between libraries and frameworks is essential for making informed decisions during the software development journey.</p>
<h2 id="heading-what-are-libraries-and-frameworks"><strong>What Are Libraries and Frameworks?</strong></h2>
<p><strong>Libraries</strong></p>
<p>Libraries are like a collection of pre-written functions and routines that are designed to perform specific tasks or solve particular problems. They provide a set of tools and utilities that can be called upon in your code when needed. Think of libraries as a toolbox where you can pick the right tool for a specific job. For example, in the JavaScript world, <strong>jQuery</strong> is a well-known library that simplifies <strong>DOM</strong> manipulation and event handling. Developers can include <strong>jQuery</strong> in their projects to make these common tasks easier.</p>
<p>You can also make your library very easily just by creating some pre-written functions and using those in your program.</p>
<p>Now let's build a simple library using <strong>JavaScript</strong>. It would be very simple don't need to worry.</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Filename ---&gt; sum.js</span>
<span class="hljs-comment">// A simple arrow function to add two numbers</span>
<span class="hljs-keyword">const</span> sum2 = <span class="hljs-function">(<span class="hljs-params">a , b</span>) =&gt;</span> {
    <span class="hljs-keyword">return</span> (a+b);
}

<span class="hljs-comment">// A simple arrow function to add three numbers</span>
<span class="hljs-keyword">const</span> sum3 = <span class="hljs-function">(<span class="hljs-params">a,b,c</span>) =&gt;</span> {
    <span class="hljs-keyword">return</span> (a+b+c);
}

<span class="hljs-comment">// Exporting two functions</span>
<span class="hljs-keyword">export</span> {sum2,sum3};
</code></pre>
<p>In the above code, we created two functions and exported them so that they can be used by other files. Now in another file, we can import this file which is named <strong>sum.js.</strong> And assume that they are in the same folder.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">import</span> {sum2, sum3} <span class="hljs-keyword">from</span> <span class="hljs-string">"./sum.js"</span>;

<span class="hljs-built_in">console</span>.log(sum2(<span class="hljs-number">1</span>,<span class="hljs-number">2</span>)) <span class="hljs-comment">// Output ---&gt; 3</span>

<span class="hljs-built_in">console</span>.log(sum3(<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>)) <span class="hljs-comment">// Output ---&gt; 6</span>
</code></pre>
<p>That's how a library works. Now let's talk about the <strong>frameworks</strong>.</p>
<p><strong>Frameworks</strong></p>
<p>Frameworks, on the other hand, go a step further. They are more like blueprints for your application. Instead of just offering individual tools, frameworks provide a complete structure for building an application. They dictate the overall <strong>architecture</strong> and flow of your code. In essence, when you use a framework, you are placing your code within a predefined structure or pattern. Frameworks are often opinionated about how you should organize your code and enforce a specific way of doing things. For example, <strong>Next.js</strong> is a framework for <strong>React.js</strong> which is in turn a library. So <strong>Next.js</strong> provides a structure for building <strong>React.js</strong> applications faster.</p>
<p>To understand the framework more in-depth let's get some concepts from the <strong>Next.js</strong> framework.</p>
<p><strong>Next.js</strong> uses a specific file structure for building an application. If you already know <strong>react</strong> then you probably will know that react uses the <strong>react-router-dom</strong> package to make different routes for your application and it is a little bit long process.</p>
<p>But in <strong>next.js</strong> you don't have to install a different package for <strong>routing</strong>. You just have to keep a specific <strong>file structure</strong> to make a route. But you may think how can I make different routes by maintaining a specific file structure? Right?</p>
<p>So to give you the answer see the below diagram to understand how <strong>next.js</strong> knows a particular route by using a file structure.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1698383359628/4db90e97-6333-42c9-b917-1692576ac0cd.png" alt class="image--center mx-auto" /></p>
<p>So in the above diagram, next.js uses a specific folder named <strong>pages</strong> for routing. That means now <strong>categories</strong> and <strong>blogs</strong> are the two routes for the application. Thus it becomes very very simple to make routes in next.js for its file structure. That's what is the advantage of a framework over a simple library.</p>
<h2 id="heading-key-characteristics-of-libraries"><strong>Key Characteristics of Libraries</strong></h2>
<p><strong>Reusability</strong></p>
<p>Libraries excel in reusability. You can use them in multiple projects, saving time and effort. Since libraries offer a wide range of functions, developers can choose the specific functionality they need, reducing code duplication and enhancing efficiency.</p>
<p><strong>Freedom and Flexibility</strong></p>
<p>Libraries offer more freedom and flexibility in terms of how and when you use them. You can include a library in your project and call its functions when you see fit. This flexibility allows developers to have full control over the application's architecture and flow.</p>
<p><strong>Limited Control</strong></p>
<p>When working with libraries, you have the liberty to structure your code as you see fit. Libraries typically don't impose a particular structure or pattern, allowing you to maintain a high level of control over your project's development.</p>
<h2 id="heading-key-characteristics-of-frameworks"><strong>Key Characteristics of Frameworks</strong></h2>
<p><strong>Architectural Guidelines</strong></p>
<p>Frameworks come with architectural guidelines. They prescribe a specific way to structure your application. This is often known as the "Inversion of Control" principle, where control over the flow of a program is shifted from the developer to the framework. Frameworks provide the skeleton, and developers flesh out the details.</p>
<p><strong>Integrated Components</strong></p>
<p>Frameworks include a set of integrated components and tools that are designed to work together seamlessly. This ensures that different parts of your application work harmoniously and reduces the effort required to integrate third-party components.</p>
<p><strong>Less Control, More Conventions</strong></p>
<p>Frameworks require developers to follow conventions and patterns established by the framework. While this might limit flexibility, it can also lead to more efficient development. With conventions in place, developers spend less time making decisions about code organization and can focus on implementing features.</p>
<h2 id="heading-when-to-use-libraries-and-when-to-use-frameworks"><strong>When to Use Libraries and When to Use Frameworks</strong></h2>
<p><strong>Choosing Libraries</strong></p>
<ul>
<li>Libraries are a great choice when you need specific functionality and don't want to be locked into a framework's architectural decisions. For example, if you're working on a simple website and need some enhanced UI components, you might choose a library like Bootstrap for its ready-made UI elements.</li>
</ul>
<p><strong>Choosing Frameworks</strong></p>
<ul>
<li>Frameworks are beneficial when you're building a complex application where consistent structure and established patterns are crucial. They are particularly useful for large-scale web applications or projects that require scalability and maintainability.</li>
</ul>
<p><strong>Hybrid Approaches</strong></p>
<ul>
<li>In some cases, it makes sense to use both libraries and frameworks in a single project. For instance, you might use a framework like Angular for the overall structure of your web application while incorporating libraries like D3.js for data visualization components. This hybrid approach allows you to leverage the strengths of both.</li>
</ul>
<h2 id="heading-examples-from-the-real-world"><strong>Examples from the Real World</strong></h2>
<p>Let's get some knowledge of different libraries and frameworks in the real world.</p>
<h3 id="heading-libraries">Libraries</h3>
<p><strong>JQuery (Library)</strong>: jQuery is a popular JavaScript library that simplifies DOM manipulation and event handling. Developers can choose to include jQuery in their web projects to make these common tasks more straightforward without affecting the overall structure of their application.</p>
<p><strong>NumPy (Library)</strong>: NumPy is a fundamental library for scientific computing in Python. It provides support for arrays and matrices, as well as a wide range of mathematical functions, making it an essential tool for data manipulation and analysis.</p>
<p><strong>Firebase (Library)</strong>: Firebase is a comprehensive set of libraries and tools for building web and mobile applications. It offers real-time database services, authentication, hosting, and more, simplifying the development of full-stack applications.</p>
<p><strong>Pandas (Library)</strong>: Pandas is a library for data manipulation and analysis in Python. It provides data structures and functions for working with structured data, making it an essential tool for data scientists and analysts.</p>
<h3 id="heading-frameworks">Frameworks</h3>
<p><strong>Next.js (Framework)</strong>: Next.js is a framework built on top of React, designed for server-rendered React applications. It provides a structured approach to building React applications with server-side rendering, routing, and many other features. Next.js enforces a clear project structure and development conventions, making it an ideal choice for building SEO-friendly web applications and websites.</p>
<p><strong>Django (Framework)</strong>: Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. It includes features like an ORM (Object-Relational Mapping), authentication, admin interface, and more, making it a comprehensive framework for building web applications. Django's "batteries-included" philosophy ensures a consistent structure for web development.</p>
<p><strong>Angular (Framework)</strong>: Angular is a full-fledged JavaScript framework developed and maintained by Google. It provides a comprehensive set of tools and components for building complex, enterprise-level web applications. Angular enforces a strong structure and uses TypeScript for static typing, making it a robust choice for large-scale projects.</p>
<p><strong>Nuxt.js (Framework)</strong>: Nuxt.js is a framework for building server-rendered Vue.js applications. It extends Vue.js to include features like server-side rendering, routing, and more. Nuxt.js provides a structured approach to Vue application development, helping developers create SEO-friendly web applications with ease.</p>
<h3 id="heading-both">Both</h3>
<p><strong>React (Library and Framework)</strong>: React is a JavaScript library for building user interfaces. It's often considered a library because it primarily focuses on the view layer. However, it's powerful and flexible enough to be the foundation for entire applications, blurring the lines between library and framework. React provides a component-based approach to building UIs and is widely used in single-page applications (SPAs) and large-scale web projects.</p>
<p><strong>Vue.js (Framework and Library)</strong>: Vue.js is a progressive JavaScript framework that can be used as both a library and a full-featured framework. Vue focuses on the view layer but is flexible enough to be used as the core framework for building complete web applications. Vue's simplicity and ease of integration with other projects make it a popular choice for developers.</p>
<p><strong>Express.js (Framework and Library)</strong>: Express.js is a minimal and flexible Node.js web application framework that simplifies building web applications and APIs. While it's often called a framework, it's more akin to a library because it provides foundational tools for web development.</p>
<p>These are some of the real-world examples of different libraries and frameworks.</p>
<h1 id="heading-summarize">Summarize</h1>
<ul>
<li><p>Libraries are like a collection of pre-written functions to solve a particular problem.</p>
</li>
<li><p>Frameworks are the blueprints for an application. It defines a structure for an application.</p>
</li>
<li><p>You can use libraries in multiple projects. It provides freedom and flexibility to structure your code.</p>
</li>
<li><p>Frameworks lead to efficient development since they give a structure.</p>
</li>
<li><p>Libraries are a great choice when you need specific functionality and want flexibility.</p>
</li>
<li><p>Frameworks are beneficial when you're building a complex application where consistent structure is required.</p>
</li>
</ul>
<p>That's it for this blog. I hope you understand the concept of Library and Framework. See you in the next blog.</p>
]]></content:encoded></item><item><title><![CDATA[Mastering Git Commands]]></title><description><![CDATA[In the fast-paced world of software development, version control is the backbone of collaborative coding. It keeps chaos at bay, enables seamless teamwork, and provides the safety net needed to explore and experiment with code. At the heart of versio...]]></description><link>https://blog.ronakpaul.com/mastering-git-commands</link><guid isPermaLink="true">https://blog.ronakpaul.com/mastering-git-commands</guid><category><![CDATA[GitHub]]></category><category><![CDATA[Git]]></category><category><![CDATA[Gitcommands]]></category><category><![CDATA[version control]]></category><dc:creator><![CDATA[Ronak Paul]]></dc:creator><pubDate>Wed, 13 Sep 2023 13:33:24 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1694600867603/e029f1c7-cb39-407e-8d99-1660a9f7ea9b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the fast-paced world of software development, version control is the backbone of collaborative coding. It keeps chaos at bay, enables seamless teamwork, and provides the safety net needed to explore and experiment with code. At the heart of version control systems, Git remains supreme.</p>
<p>But here's the catch: Git, with its incredible power and flexibility, can be a double-edged sword. Without a solid understanding of its basic commands, it's easy to feel lost in a sea of code changes, branches, and repositories. That's why, whether you're a seasoned developer or just starting your coding journey, mastering Git's essential commands is a non-negotiable skill.</p>
<p>In this blog, we're embarking on a journey through the fundamental Git commands that every developer, regardless of experience level, should have in their toolkit. Whether you're collaborating on a large-scale project, managing your codebase, or simply striving for greater coding efficiency, these commands will be your trusted companions.</p>
<p>Get ready to level up your version control game as we explore the basic Git commands that can make a world of difference in your development journey. Let's dive in! 💻🚀</p>
<h1 id="heading-basic-git-concepts">Basic Git concepts</h1>
<p>Before learning the basic git commands, we have to know some of the basic concepts of git to get started. Below is the list of basic git concepts which is required in day to day life of a programmer.</p>
<ul>
<li><p><strong>Repository (Repo):</strong> A repository is a directory where Git stores all the files and history for a project. It can be local (on your computer) or remote (hosted on a server, like <strong>GitHub</strong> )</p>
</li>
<li><p><strong>Commit:</strong> A commit represents a snapshot of the project at a specific point in time. It includes changes to one or more files, along with a unique identifier (<strong>SHA-1 hash</strong>), a commit message explaining the changes, and a reference to the previous commit (parent commit) to create a history.</p>
</li>
<li><p><strong>Branch:</strong> A branch is a parallel line of development within a Git repository. It allows multiple contributors to work on different features or bug fixes simultaneously without interfering with each other. The default branch is usually called <code>master</code> or <code>main</code>. In the recent version of GitHub the default branch is always <code>main</code>, so it is good to make your branch <code>main</code> in your local repository.</p>
  <div data-node-type="callout">
  <div data-node-type="callout-emoji">💡</div>
  <div data-node-type="callout-text">A particular <strong>branch</strong> is related to one <strong>pull request</strong>. So if you want to make another <strong>pull request</strong> for another feature then make another <strong>branch</strong> for that feature.</div>
  </div>
</li>
<li><p><strong>Checkout</strong>: Checking out a branch means switching from one branch to another.</p>
</li>
<li><p><strong>Remote:</strong> A remote is a repository hosted on a different server. You can say that a remote repository is a repository that is not located on your local computer and is stored in GitHub. Developers can clone a remote repository to their local machine, collaborate on it, and push changes back to the remote.</p>
</li>
<li><p><strong>Clone:</strong> Cloning is the process of copying a remote repository to your local machine.</p>
<p>  It creates a local repository with the same commit history and files as the remote.</p>
</li>
<li><p><strong>Pull:</strong> Pulling is used to update your local repository with changes from a remote repository. It combines a <code>fetch</code> operation (retrieving changes from the remote) and a <code>merge</code> operation (combining those changes with your local branch).</p>
</li>
<li><p><strong>Push:</strong> Pushing is used to send your local commits to a <strong>remote repository</strong>.</p>
<p>  It updates the remote repository with your changes.</p>
</li>
<li><p><strong>Merge:</strong> Merging combines two or more branches (usually the current branch and another) into a single branch. It's used to integrate changes from one branch into another.</p>
</li>
<li><p><strong>Conflict</strong>: Conflicts occur when Git cannot automatically merge changes from two different branches or commits. Developers must manually resolve conflicts by choosing which changes to keep.</p>
</li>
<li><p><strong>Pull Request (PR)</strong>: In some Git hosting platforms like <strong>GitHub</strong>, a pull request is a way to propose changes to a repository. Others can review the changes, discuss them, and then merge them into the <strong>main branch</strong>.</p>
</li>
<li><p><strong>Staging Area (Index)</strong>: The staging area is where you prepare changes for a commit. You can selectively add specific changes to the staging area before committing them.</p>
</li>
<li><p><strong>.gitignore</strong>: This is a file that specifies which files or directories should be ignored by <strong>Git</strong> (not tracked). It's useful for excluding temporary files, build artifacts and sensitive information from version control.</p>
</li>
</ul>
<h1 id="heading-git-basic-commands">Git Basic Commands</h1>
<p>Now let's talk about the <strong>basic git commands</strong> and their use cases.</p>
<ol>
<li><pre><code class="lang-bash">  git init
</code></pre>
<p> The above command is used to initialize any local folder to a <strong>git repository</strong> i.e. from now you can see the log history of this folder and the changes that are going to be made in this particular folder.</p>
</li>
<li><pre><code class="lang-bash">  git <span class="hljs-built_in">clone</span> &lt;Repository-URL&gt;
</code></pre>
<p> The above command is used to clone or download any repository files from <strong>GitHub</strong> by using the <strong>repository URL</strong>. In the above command, you have to replace the <code>&lt;Repository-URL&gt;</code> to the URL of the repository which you want to clone.</p>
</li>
<li><pre><code class="lang-bash">  git status
</code></pre>
<p> The above command is used to list the files in the present <strong>git folder</strong>. It will list the untracked files (i.e. newly created files), modified files, deleted files and more. It will only show the changes from the time when the folder is initialized as a git folder by <code>git init</code> command.</p>
</li>
<li><pre><code class="lang-bash">  git add &lt;File-Name&gt; 
  <span class="hljs-comment"># It will add the specified file for commit</span>
  git add .
  <span class="hljs-comment"># It will add all the untracked and modified files for commit</span>
</code></pre>
<p> The above commands are used to add the files which will be committed soon. That means we are just selecting the files for a commit.</p>
<p> The first command is used to add a specific file by the <strong>&lt;File-Name&gt;</strong> and the second command is used to add all the untracked and modified files (which are shown in the <code>git status</code> command ) for commit.</p>
</li>
<li><pre><code class="lang-bash">  git commit -m <span class="hljs-string">"Message for this commit"</span>

  <span class="hljs-comment"># or</span>

  git commit -S -m <span class="hljs-string">"Message for this signed commit"</span>
</code></pre>
<p> The above command is used to commit the added files with a message. The <code>-m</code> flag is used to give a commit message. The <code>-S</code> flag is used to sign a commit.</p>
 <div data-node-type="callout">
 <div data-node-type="callout-emoji">💡</div>
 <div data-node-type="callout-text">If you didn't read my previous blog on Git Security, where I explained all the concepts of signed commits and how to set security keys to sign a commit, then go to the below link and read the full blog: <a target="_blank" href="https://codago.hashnode.dev/enhancing-git-security">https://codago.hashnode.dev/enhancing-git-security</a></div>
 </div>
</li>
<li><pre><code class="lang-bash">  git <span class="hljs-built_in">log</span>
</code></pre>
<p> The above command is used to display all the previous commits of that particular repository with various important information like <strong>commit message</strong>, <strong>commit ID</strong>, and the time when the commit was made. So, it is a very useful command.</p>
</li>
<li><pre><code class="lang-bash">  git stash
</code></pre>
<p> The above command is used to put all the added files in a <strong>stash area</strong>. A stash area is a place where you prepare changes for a commit and can get those stashed files when required.</p>
</li>
<li><pre><code class="lang-bash">  git stash pop
</code></pre>
<p> The above command is used to take out the files added to a stash area.</p>
</li>
<li><pre><code class="lang-bash">  git reset &lt;Commit-ID&gt;
</code></pre>
<p> The above command is used to reset all the commits above the given <strong>commit ID</strong>. You can find the <strong>commit ID</strong> of a commit by using the <code>git log</code> command on your console. This command will undo the commits above the given <strong>commit ID</strong>.</p>
</li>
<li><pre><code class="lang-bash">git restore --staged &lt;DeletedFileName&gt;
</code></pre>
<p>The above command is used to get back a deleted file or restore the state of a file to the previous state.</p>
</li>
<li><pre><code class="lang-bash">git remote add origin &lt;Repository-URL&gt;
</code></pre>
<p>The above command is used to add a <strong>remote URL</strong> named <strong>origin</strong>. This command is very useful because without this command you can't connect your p<strong>roject repository URL</strong> to your <strong>git client</strong>. The repository URL can be found in the <strong>GitHub repository of the project</strong>.</p>
</li>
<li><pre><code class="lang-bash">git push origin &lt;branch-name&gt;

<span class="hljs-comment">#or</span>

git push origin &lt;branch-name&gt; -f
</code></pre>
<p>The above commands are used to push the commits to the <strong>remote URL</strong> (<strong>origin</strong>) from your <strong>git client</strong>. This command will push the new commits to the <strong>GitHub</strong> repository of the project. The <code>-f</code> flag is used to forcefully push the commit history to the <strong>remote URL</strong> (<strong>origin</strong>).</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">It is not recommended to use the <code>-f</code> flag because it can break your commit history. But sometimes it may be necessary to forcefully do certain things.</div>
</div>
</li>
<li><pre><code class="lang-bash">git branch &lt;new-branch-name&gt;
</code></pre>
<p>The above command is used to make a new branch whose name is given in <strong>&lt;new-branch-name&gt;.</strong></p>
</li>
<li><pre><code class="lang-bash">git checkout &lt;branch-name&gt;
</code></pre>
<p>The above command is used to <strong>checkout</strong> from the current branch to the specified branch.</p>
</li>
<li><pre><code class="lang-bash">git pull origin &lt;branch-name&gt;
</code></pre>
<p>The above command is used to update your local repository with changes from a remote repository. In this case, we are pulling from the <strong>origin remote repository</strong> and from the <strong>specified branch</strong>.</p>
</li>
</ol>
<hr />
<p>So this is it for this blog. If you find the blog useful then share it with your friends so that they also can benefit from this blog. And if you have any suggestions for a blog topic then feel free to comment down below.</p>
<p>And if you didn't see my previous blogs on Git then just check those out. Happy Coding ✌</p>
<blockquote>
<p><em>previous blogs:</em></p>
<p>Git and GitHub Introduction: <a target="_blank" href="https://codago.hashnode.dev/git-and-github-introduction">https://codago.hashnode.dev/git-and-github-introduction</a></p>
<p>Enhancing Git Security: <a target="_blank" href="https://codago.hashnode.dev/enhancing-git-security">https://codago.hashnode.dev/enhancing-git-security</a></p>
</blockquote>
]]></content:encoded></item><item><title><![CDATA[Enhancing Git Security]]></title><description><![CDATA[In the world of software development, the Git version control system has become the bedrock of collaboration, enabling teams to work seamlessly on codebases of all sizes. But as we rely on Git to manage our source code, ensuring the security and inte...]]></description><link>https://blog.ronakpaul.com/enhancing-git-security</link><guid isPermaLink="true">https://blog.ronakpaul.com/enhancing-git-security</guid><category><![CDATA[GitHub]]></category><category><![CDATA[Git]]></category><category><![CDATA[git commit]]></category><category><![CDATA[sign commits]]></category><category><![CDATA[git security]]></category><dc:creator><![CDATA[Ronak Paul]]></dc:creator><pubDate>Tue, 12 Sep 2023 14:40:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1694529321275/3753634d-1f1b-4c90-ad83-683129bc31ac.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the world of software development, the <strong>Git version control system</strong> has become the bedrock of collaboration, enabling teams to work seamlessly on codebases of all sizes. But as we rely on Git to manage our source code, ensuring the security and integrity of our commits has never been more critical.</p>
<p><strong>Imagine this scenario</strong>: You're working on a mission-critical project, and the codebase is constantly evolving with contributions from various team members. How can you be sure that the commits in your repository haven't been tampered with? How do you verify that those commits were indeed made by the collaborators they claim to be from? This is where Git commit signing comes into play.</p>
<p>In this comprehensive guide, we will delve into the world of Git commit signing, exploring its significance, how it works, and why it's a best practice that every developer should embrace. Whether you're a seasoned Git user or just getting started, understanding commit signing is a fundamental skill that can bolster the security of your code and the reliability of your development workflow.</p>
<p>Join us on this journey as we uncover the secrets of Git commit signing and empower you to take your Git repositories to the next level of security and trustworthiness. Let's get started!</p>
<h1 id="heading-signing-commits">Signing commits</h1>
<p>Signing Git commits is an important security measure to verify the authenticity and integrity of commits in a Git repository. Suppose you are working on a project and you making some changes in the codebase, how a third person can be sure that the changes are done by you and not by anyone else? That's why we use the signing of commits to be sure that the contributor is authenticated.</p>
<p>When we sign a Git commit, we use our <strong>GPG (GNU Privacy Guard)</strong> key to create a cryptographic signature for the commit. This signature can then be verified by others to ensure that the commit was made by me and hasn't been tampered with.</p>
<h1 id="heading-requirement-and-benefits">Requirement and Benefits</h1>
<ol>
<li><p><strong>Authentication</strong>: Signing commits proves that they were made by you and not by someone else pretending to be you. It adds an extra layer of trust to the commit history.</p>
</li>
<li><p><strong>Integrity</strong>: The cryptographic signature ensures that the commit has not been altered since it was signed. If someone tries to modify a signed commit, the signature verification will fail.</p>
</li>
<li><p><strong>Non-repudiation</strong>: Once a commit is signed, you cannot deny that you made that commit. This is particularly important in open-source projects or collaborative work where accountability matters.</p>
</li>
<li><p><strong>Trust in the commit history</strong>: Trust in the Git commit history is crucial, especially in large and collaborative projects. Signed commits make it more difficult for malicious actors to inject malicious code into the repository unnoticed.</p>
</li>
</ol>
<h1 id="heading-vigilant-mode">Vigilant mode</h1>
<p>When we commit in git we sign the commit so that everyone can trust that commit and be confident about the author of the commit. So by enabling vigilant mode, you mark your git commits with one of three verification statutes i.e. someone made a signed commit then in GitHub, the commit will be shown as verified but if it is not verified then the commit will be shown as unverified. And if the vigilant mode is disabled then we can't see that kind of status in our git commits. So it is preferred to enable vigilant mode.</p>
<h3 id="heading-various-verification-status">Various verification status</h3>
<p>The following are the three verification statuses in GitHub:</p>
<ol>
<li><p><strong>Verified:</strong> The commit is signed, the signature was successfully verified, and the committer is the only author who has enabled vigilant mode.</p>
</li>
<li><p><strong>Partially Verified:</strong> The commit is signed, and the signature was successfully verified, but the commit has an author who: <strong>a)</strong> is not the committer and <strong>b)</strong> has enabled vigilant mode. In this case, the commit signature doesn't guarantee the consent of the author, so the commit is only partially verified.</p>
</li>
<li><p><strong>Unverified:</strong> Any of the following is true:</p>
<ul>
<li><p>The commit is signed but the signature could not be verified.</p>
</li>
<li><p>The commit is not signed and the committer has enabled vigilant mode.</p>
</li>
<li><p>The commit is not signed and the author has enabled vigilant mode.</p>
</li>
</ul>
</li>
</ol>
<h3 id="heading-enable-vigilant-mode">Enable vigilant mode</h3>
<p>The steps to enable vigilant mode are:</p>
<ol>
<li><p>In the upper-right corner of any page, click your profile photo, then click <strong>Settings</strong>.</p>
</li>
<li><p>In the "Access" section of the sidebar, click <strong>SSH and GPG keys</strong>.</p>
</li>
<li><p>Under "Vigilant mode," select <strong>Flag unsigned commits as unverified</strong>.</p>
</li>
</ol>
<h1 id="heading-make-your-commits-signed">Make your commits signed</h1>
<p>To make your commits signed you have to follow the below steps. Basically for signing commits, you require a GPG key or SSH key and a verified email address that is connected to your GitHub account. In this blog, I am only focusing on the GPG key because it is widely used and GitHub itself also recommends it.</p>
<h3 id="heading-verify-your-email-address">Verify your email address</h3>
<p>Verification of email address is very necessary because without verifying an email address you can't do anything in GitHub, to be honest. So the steps to verify your email address in GitHub are as follows:</p>
<ol>
<li><p>Create a <strong>GitHub account</strong>.</p>
</li>
<li><p>In the upper-right corner of any page, click your profile photo, then click <strong>Settings</strong>.</p>
</li>
<li><p>In the "Access" section of the sidebar, click <strong>Emails</strong>.</p>
</li>
<li><p>Under your email address, click <strong>Resend verification email</strong>.</p>
</li>
<li><p>GitHub will send you an email with a link in it. After you click that link, you'll be taken to your GitHub dashboard and see a confirmation banner.</p>
</li>
</ol>
<h3 id="heading-generate-a-gpg-key">Generate a GPG key</h3>
<ol>
<li><p>Download and install <a target="_blank" href="https://www.gnupg.org/download/">the GPG command line tools</a> for your operating system. We generally recommend installing the latest version for your operating system.</p>
</li>
<li><p>Open Git Bash.</p>
</li>
<li><p>Now we have to generate a GPG Key by executing the below command in Git Bash:</p>
<pre><code class="lang-bash"> gpg --full-generate-key
</code></pre>
</li>
<li><p>At the prompt, specify the kind of key you want, or press <code>Enter</code> to accept the default.</p>
</li>
<li><p>At the prompt, specify the key size you want, or press <code>Enter</code> to accept the default.</p>
</li>
<li><p>Enter the length of time the key should be valid. Press <code>Enter</code> to specify the default selection, indicating that the key doesn't expire. Unless you require an expiration date, we recommend accepting this default.</p>
</li>
<li><p>Verify that your selections are correct.</p>
</li>
<li><p>Enter your <strong>user ID</strong> information.</p>
</li>
<li><p>Type a secure <strong>passphrase</strong>.</p>
</li>
<li><p>Use the below command to list the long form of the <strong>GPG keys</strong> for which you have both a public and private key. A private key is required for signing commits or tags.</p>
<pre><code class="lang-bash">gpg --list-secret-keys --keyid-format=long
</code></pre>
</li>
<li><p>From the list of GPG keys, copy the long form of the GPG key ID you'd like to use. In this example, the GPG key ID is <code>4AB5C36371587BD2</code>:</p>
<pre><code class="lang-bash">$ gpg --list-secret-keys --keyid-format=long
/Users/codago/.gnupg/secring.gpg
------------------------------------
sec   4096R/4AB5C36371587BD2 2023-03-10 [expires: 2024-03-10]
uid                          Codago &lt;codago@example.com&gt;
ssb   4096R/5BB6D45482678BE3 2023-03-10
</code></pre>
</li>
<li><p>Paste the text below, substituting the GPG key ID you'd like to use, this will print the GPG key ID, in <strong>ASCII armor format</strong>. In this example, the GPG key ID is <code>4AB5C36371587BD2</code>:</p>
<pre><code class="lang-bash">gpg --armor --<span class="hljs-built_in">export</span> 4AB5C36371587BD2
</code></pre>
</li>
<li><p>Copy your GPG key, which is inside of <code>-----BEGIN PGP PUBLIC KEY BLOCK-----</code> and ending with <code>-----END PGP PUBLIC KEY BLOCK-----</code>.</p>
</li>
<li><p>Now go to the next section of this blog which is <strong>Adding a GPG key to your GitHub account.</strong></p>
</li>
</ol>
<h3 id="heading-adding-a-gpg-key">Adding a GPG key</h3>
<p>You generated your GPG key from the previous steps and now the final step is to add your <strong>GPG key</strong> to your GitHub account. You can add multiple keys to your GitHub account and sign the commits with any keys you want but if you delete a key then the commits you made with that key will be displayed as <strong>unverified</strong>. But if the GPG key expires then your commits still show the verified status stating that your GPG key is expired nothing else.</p>
<p>Now to add the GPG key we have created follow the below steps:</p>
<ol>
<li><p>In the upper-right corner of any page, click your profile photo, then click <strong>Settings</strong>.</p>
</li>
<li><p>In the "Access" section of the sidebar, click <strong>SSH and GPG keys</strong>.</p>
</li>
<li><p>Next to the "GPG keys" header, click <strong>New GPG key</strong>.</p>
</li>
<li><p>In the "Title" field, type a name for your <strong>GPG key</strong>.</p>
</li>
<li><p>In the "Key" field, paste the GPG key we just created in the <strong>Generate a GPG key</strong> section.</p>
</li>
<li><p>Click the <strong>Add GPG key</strong>.</p>
</li>
<li><p>To confirm the action, authenticate to your GitHub account.</p>
</li>
</ol>
<h3 id="heading-sign-commits-from-shell">Sign commits from shell</h3>
<p>You set up all the required steps to sign a commit, now you have to know how to sign a commit. To sign a commit you need the following command:</p>
<pre><code class="lang-bash">git commit -S -m <span class="hljs-string">"Commit message"</span>
</code></pre>
<p>Alternatively, you can set the <strong>default</strong> <strong>config of gpgsign</strong> <strong>to true</strong> so that you don't have to specify the flag <code>-S</code> every time you sign a commit. To set the default config of gpgsign to true execute the following command:</p>
<pre><code class="lang-bash">git config commit.gpgsign <span class="hljs-literal">true</span>
</code></pre>
<hr />
<p>So today you learned about <strong>signing git commits</strong>, <strong>the benefits of git commits</strong>, <strong>how to generate a gpg key and add it to GitHub</strong>, <strong>how to verify your email</strong> and lastly <strong>how to sign git commit in the command line</strong>.</p>
<p>If you liked the blog then give a ❤ and leave a comment below. Happy coding 🤜</p>
]]></content:encoded></item><item><title><![CDATA[Git and GitHub: Introduction]]></title><description><![CDATA[In the world of software development, collaboration is key. Teams of developers work together to create amazing applications, websites, and programs. But how do they keep track of all the changes, updates, and improvements they make to their projects...]]></description><link>https://blog.ronakpaul.com/git-and-github-introduction</link><guid isPermaLink="true">https://blog.ronakpaul.com/git-and-github-introduction</guid><category><![CDATA[Git]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[git-setup]]></category><category><![CDATA[git and github introduction]]></category><category><![CDATA[git install]]></category><dc:creator><![CDATA[Ronak Paul]]></dc:creator><pubDate>Sun, 10 Sep 2023 15:57:55 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1694360667590/aede9d14-2270-4614-8cbf-4bd407557228.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the world of software development, collaboration is key. Teams of developers work together to create amazing applications, websites, and programs. But how do they keep track of all the changes, updates, and improvements they make to their projects? That's where Git comes into play. In this blog post, we'll dive into the world of Git &amp; GitHub, explaining what it is and how it can make version control a breeze.</p>
<h1 id="heading-what-is-git">What is Git?</h1>
<p>Git is a distributed version control system (DVCS) that was created by Linus Torvalds in 2005. It's designed to help developers manage and track changes to their codebase efficiently. With Git, multiple developers can collaborate on a project without the risk of overwriting each other's work or losing track of changes. For example, you wrote a code and after that, you made some changes to the code and you saved your work but the next day you saw that the changes that you made broke the whole application and you need a way to go back to your previous code for those cases Git is very useful because it keeps track of your work and you can go back to your previous work if necessary and you can also see where and in which line you made those changes.</p>
<h1 id="heading-what-is-github">What is GitHub?</h1>
<p>GitHub is a web-based platform and service that provides a wide range of tools and features for software developers and teams to collaborate, manage, and host their code repositories. It is one of the most popular and widely used platforms for version control and collaborative software development.</p>
<p>If you are working on a project and that project is on your local machine but if you want to share all the code history and project files on the internet so that everyone can see your code and also they can collaborate and make changes to your code that would be great right? So to do this GitHub comes into the picture where you can put your project files and the history of the project in GitHub. In summary, GitHub is a platform that combines the power of Git for version control with a suite of collaborative and project management features. It is widely used by individual developers, teams, and open-source communities to host, collaborate on, and manage software projects.</p>
<h1 id="heading-key-concepts-of-git">Key Concepts of Git</h1>
<ul>
<li><p><strong>Repository:</strong> A Git repository, or repo for short, is a directory that contains all the files and folders for a particular project, along with the entire history of changes made to those files.</p>
</li>
<li><p><strong>Commit:</strong> A commit is like a snapshot of your project at a specific point in time. It records the changes you've made to the files in your repo. Each commit has a unique identifier (a long string of letters and numbers) and a commit message that describes the changes made.</p>
</li>
<li><p><strong>Branch:</strong> A branch is a separate line of development within a Git repo. Developers can create branches to work on new features or fix bugs without affecting the main codebase. Once the changes are complete and tested, they can be merged back into the main branch.</p>
</li>
<li><p><strong>Merge:</strong> Merging is the process of combining the changes from one branch into another. This is often used to integrate completed features or bug fixes back into the main branch (usually called "master" or "main").</p>
</li>
</ul>
<h2 id="heading-benefits-of-using-git"><strong>Benefits of Using Git</strong></h2>
<ol>
<li><p><strong>Version Control:</strong> Git allows you to track changes to your code over time, making it easy to roll back to previous versions if needed.</p>
</li>
<li><p><strong>Collaboration</strong>: Multiple developers can work on the same project simultaneously, resolving conflicts efficiently.</p>
</li>
<li><p><strong>Branching</strong>: Creating branches for new features or bug fixes keeps the main codebase stable.</p>
</li>
<li><p><strong>Remote Hosting</strong>: Platforms like GitHub provide remote hosting for your Git repositories, making it easy to share your code and collaborate with others.</p>
</li>
<li><p><strong>Open Source</strong>: Git is open source and widely adopted, with a vast community and plenty of resources for learning and troubleshooting.</p>
</li>
</ol>
<h1 id="heading-installation-of-git-amp-github">Installation of Git &amp; GitHub</h1>
<p>For the installation of <strong>Git,</strong> go to the <strong>official website</strong> of Git which is given below and install the Git on your local machine.</p>
<p><a target="_blank" href="https://git-scm.com/downloads">Install Git Here</a></p>
<p>After installing <strong>Git</strong>, you should <strong>create your GitHub</strong> profile. Go to the GitHub website from below:</p>
<p><a target="_blank" href="https://github.com/login">GitHub</a></p>
<p>After installation of Git and creating your GitHub account you should follow the below steps to <strong>setup your Git on your local machine</strong> :</p>
<ol>
<li><p>The first thing you should do is to set your <strong>username</strong> and <strong>email</strong> which you have given in your <strong>GitHub account</strong> by using the below commands:</p>
<pre><code class="lang-plaintext"> git config --global user.name "YOUR_USER_NAME"
</code></pre>
<pre><code class="lang-plaintext"> git config --global user.email YOUR_EMAIL_ADDRESS
</code></pre>
</li>
<li><p>By default, Git uses the default branch named <strong>master</strong> when you initialize a git repository by using <strong>git init</strong> command but in the latest version of GitHub the default branch is the <strong>main</strong> branch. So we have to set the default branch to the main branch in <strong>Git</strong>. To do so use the below command:</p>
<pre><code class="lang-plaintext"> git config --global init.defaultBranch main
</code></pre>
</li>
<li><p>Now if you want to check your git configuration settings, you can do so by the below command:</p>
<pre><code class="lang-plaintext"> git config --list
</code></pre>
</li>
</ol>
<p>That's it for this blog. In the next blog I will list and explain all the important git commands and their uses. Follow for more blogs like this and subscribe to my newsletter. Happy coding. ✌</p>
]]></content:encoded></item><item><title><![CDATA[Unleashing the Power of Web 3.0]]></title><description><![CDATA[Hey 🖐, this is the blog on Web 3.0. In this blog, I will explain what is Web 3.0, decentralization, dApps and many more. So let's start reading the blog.
Introduction
The internet has evolved significantly since its inception, transforming the way w...]]></description><link>https://blog.ronakpaul.com/unleashing-the-power-of-web-30</link><guid isPermaLink="true">https://blog.ronakpaul.com/unleashing-the-power-of-web-30</guid><category><![CDATA[Blockchain]]></category><category><![CDATA[dapps]]></category><category><![CDATA[decentralization]]></category><dc:creator><![CDATA[Ronak Paul]]></dc:creator><pubDate>Fri, 19 May 2023 15:23:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1684507578341/87801d2d-d7c8-4d42-b474-fd01a09f62a4.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey 🖐, this is the blog on Web 3.0. In this blog, I will explain what is Web 3.0, decentralization, dApps and many more. So let's start reading the blog.</p>
<h2 id="heading-introduction">Introduction</h2>
<p>The internet has evolved significantly since its inception, transforming the way we communicate, conduct business, and access information. With each iteration, the web has become more interactive and interconnected. Now, we stand on the brink of a new era known as Web 3.0, promising to revolutionize the internet landscape once again. In this blog, we will delve into the concept of Web 3.0, exploring its key features, potential applications, and the impact it could have on various industries.</p>
<h2 id="heading-what-is-web-30">What is Web 3.0?</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684508175236/e939f447-ae16-40b1-a0f8-6d3f68aa5d2c.png" alt class="image--center mx-auto" /></p>
<p>Web 3.0, often referred to as the decentralized web or the semantic web, represents a paradigm shift in the way we perceive and interact with the internet. Unlike its predecessor, Web 2.0, which primarily focused on user-generated content and social media, Web 3.0 aims to create a more intelligent, secure, and decentralized web ecosystem. It leverages emerging technologies such as blockchain, artificial intelligence, the Internet of Things (IoT), and decentralized networks to enhance user experiences and empower individuals in unprecedented ways.</p>
<p><strong>Key Features of Web 3.0:</strong></p>
<ol>
<li><p><strong>Decentralization</strong>: One of the defining features of Web 3.0 is decentralization, where power and control are distributed among participants rather than centralized authorities. Blockchain technology plays a crucial role in enabling decentralized applications (dApps), smart contracts, and secure peer-to-peer transactions.</p>
</li>
<li><p><strong>Enhanced Interoperability:</strong> Web 3.0 focuses on enabling seamless interoperability between different platforms, systems, and applications. This allows for the exchange of data and services across various domains, creating a more connected and cohesive digital environment.</p>
</li>
<li><p><strong>Artificial Intelligence and Machine Learning:</strong> Web 3.0 harnesses the power of AI and machine learning algorithms to extract meaning from vast amounts of unstructured data. This enables personalized experiences, predictive analytics, and smarter decision-making.</p>
</li>
<li><p><strong>Semantic Web:</strong> Web 3.0 emphasizes the semantic web, which aims to make data more meaningful and understandable to machines. By assigning metadata and context to information, machines can interpret and process data more efficiently, leading to better search results and automated services.</p>
</li>
</ol>
<p><strong>Potential Applications of Web 3.0:</strong></p>
<ol>
<li><p><strong>Finance and Cryptocurrencies:</strong> Web 3.0 has the potential to disrupt the traditional financial sector by enabling decentralized finance (DeFi) applications, tokenization of assets, and secure peer-to-peer transactions without intermediaries.</p>
</li>
<li><p><strong>Internet of Things (IoT):</strong> Web 3.0 can facilitate a more interconnected IoT ecosystem, where devices communicate directly with each other, autonomously execute tasks, and share data securely.</p>
</li>
<li><p><strong>Healthcare:</strong> Web 3.0 can revolutionize healthcare by enabling secure and interoperable electronic health records, facilitating medical research collaboration, and empowering patients to have more control over their health data.</p>
</li>
<li><p><strong>Supply Chain Management:</strong> By leveraging blockchain technology, Web 3.0 can enhance transparency and traceability in supply chains, reducing fraud, counterfeiting, and inefficiencies.</p>
</li>
<li><p><strong>Content Creation and Intellectual Property:</strong> Web 3.0 can provide content creators with improved copyright protection, direct monetization opportunities, and decentralized platforms that empower artists, writers, and musicians.</p>
</li>
</ol>
<h2 id="heading-decentralization">Decentralization</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684509070614/a602ed02-3c43-4e56-889a-b9bd1b9a87c6.png" alt class="image--center mx-auto" /></p>
<p>Decentralization refers to the distribution of power, authority, and decision-making across a network or system, rather than concentrating it in a central authority or entity. In a decentralized system, multiple participants have control and influence over the network, ensuring that no single entity holds complete control or can manipulate the system for its benefit.</p>
<p>Decentralization is often associated with emerging technologies like blockchain, which allows for the creation of decentralized applications (dApps) and peer-to-peer transactions without the need for intermediaries. Blockchain achieves decentralization by maintaining a distributed ledger that is verified and updated by a network of computers (nodes) instead of a central authority.</p>
<p>The benefits of decentralization are numerous. It fosters transparency, as the shared ledger in a decentralized system is accessible to all participants, reducing the potential for fraud and manipulation. It also enhances security since data is stored across multiple nodes, making it more resistant to hacking or data loss. Decentralization promotes censorship resistance, as it becomes harder for any single entity to control or shut down the system. Furthermore, decentralization empowers individuals by giving them direct control over their data, digital assets, and transactions.</p>
<p>Overall, decentralization represents a shift towards more democratic, transparent, and user-centric systems, offering the potential to disrupt traditional industries and empower individuals in ways not previously possible.</p>
<h2 id="heading-dapps">dApps</h2>
<p>DApps, short for decentralized applications, are software applications that run on a decentralized network rather than a centralized server. They leverage blockchain technology and smart contracts to enable direct peer-to-peer interactions, removing the need for intermediaries and providing a more transparent and trustless environment.</p>
<p>DApps have found applications in various industries, including finance, supply chain management, gaming, social media, and more. They have the potential to disrupt traditional industries, improve efficiency, and empower individuals by giving them more control over their digital lives.</p>
<p>Some examples of dApps with the replacement of various social media apps we use daily:</p>
<ol>
<li><p><strong>Brave Browser:</strong> A privacy-focused web browser that rewards users with cryptocurrency for opting into ads and supports decentralized web applications. It is an alternative to Chrome.</p>
</li>
<li><p><strong>DTube</strong>: It is a decentralized video platform built on the STEEM blockchain and IPFS peer-to-peer network. It is an alternative to YouTube.</p>
</li>
<li><p><strong>Secretum:</strong> It is a decentralized messaging app. It is an alternative to WhatsApp</p>
</li>
<li><p><strong>Audius:</strong> It is a decentralized music platform. It is an alternative to Spotify.</p>
</li>
<li><p><strong>Presearch:</strong> It is a decentralized search engine. It is an alternative to Google, Yahoo etc.</p>
</li>
</ol>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Web 3.0 represents an exciting vision for the future of the internet. By leveraging emerging technologies, decentralization, and enhanced interoperability, it has the potential to unleash a new wave of innovation and transform various aspects of ours.</p>
<hr />
<p>Thank you for reading the blog. More on Web 3.0 will be on my upcoming blogs.</p>
<p>Like, Share and Comment. ♥</p>
]]></content:encoded></item><item><title><![CDATA[Problem Solving: Think, Apply and Build]]></title><description><![CDATA[Hey🖐, this blog is about Problem Solving in programming and it will help you to solve a problem easily. This blog will cover certain things you should follow while solving a problem, so read the blog and start solving your problems easily.

Introduc...]]></description><link>https://blog.ronakpaul.com/problem-solving-think-apply-and-build</link><guid isPermaLink="true">https://blog.ronakpaul.com/problem-solving-think-apply-and-build</guid><category><![CDATA[WeMakeDevs]]></category><category><![CDATA[Problem Solving]]></category><category><![CDATA[Programming Tips]]></category><category><![CDATA[Programming Blogs]]></category><dc:creator><![CDATA[Ronak Paul]]></dc:creator><pubDate>Tue, 21 Feb 2023 16:43:48 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1676917888245/7f9d3a98-cc71-4c6e-9918-3dba71f49471.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey🖐, this blog is about Problem Solving in programming and it will help you to solve a problem easily. This blog will cover certain things you should follow while solving a problem, so read the blog and start solving your problems easily.</p>
<hr />
<h1 id="heading-introduction">Introduction</h1>
<p>We always try to solve a particular problem in one shot, but this is not the right way to tackle a problem. We always have to break the problem into smaller parts and solve those smaller parts to get to the full solution of the problem. So the steps include to solve a problem are as follows:</p>
<ul>
<li><p>Understand the problem</p>
</li>
<li><p>Analyze the problem</p>
</li>
<li><p>Break the problem into small parts</p>
</li>
<li><p>Solve the small parts</p>
</li>
<li><p>Combine the small parts solution to get the full solution</p>
</li>
</ul>
<h1 id="heading-how-to-think-apply-and-build">How to think, apply and build?</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676973802798/041e12dd-6cfd-4ef0-ad87-d7910f289a9e.png" alt class="image--center mx-auto" /></p>
<p>Before starting to solve a problem, you have to read the problem and understand it deeply. And once you understand the problem deeply, you can write down the steps to solve the problem in the paper because it will help you to solve a problem more efficiently. For solving the problem, you can divide it into small parts and solve those small parts because it may be difficult to solve a big problem in one go but it is always easy to solve a small problem since a small problem doesn't need to include all resources. A small problem only solves a particular problem. And after solving small problems, you can combine those solutions to get the full solution of the problem.</p>
<p>As for building an application, different developers work on different parts of the application such as <strong>front-end</strong>, <strong>back-end</strong>, <strong>database</strong> etc. But what happened if only one developer did all jobs? It would be a very difficult task, right? That's why we have to divide a problem into chunks to make the problem-solving task easier.</p>
<h1 id="heading-importance-of-flow-chart">Importance of flow-chart</h1>
<p>The flow chart is also an important concept to solve a particular problem. Flow charts give step-by-step instructions to solve a problem. Certain symbols are used in the flow chart and each symbol has a certain meaning. An example of a flow-chart "To check for odd/even for an input" is:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676971639927/0e2e0b06-ec89-4051-a54b-2ab20d632cb7.png" alt class="image--center mx-auto" /></p>
<p>In this flow chart, the problem is divided into smaller sections. So first of all the program starts, then a variable is declared named 'n' and then input is taken from the user, then a condition is checked and depending on the result of the condition different statements are printed and at the last, the program stops.</p>
<p>So now it would be easier to write code from this flow chart.</p>
<p><strong>Code:</strong></p>
<pre><code class="lang-java"><span class="hljs-keyword">import</span> java.util.Scanner;

<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Example</span></span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span>
    </span>{    
        <span class="hljs-comment">// Program starts</span>

        <span class="hljs-comment">// Creating object of the scanner class to take input</span>
        Scanner o = <span class="hljs-keyword">new</span> Scanner(System.in); 

        <span class="hljs-keyword">int</span> n; <span class="hljs-comment">// Initialization of variable</span>

        <span class="hljs-comment">// Taking the input from the user</span>
        System.out.println(<span class="hljs-string">"Enter a number"</span>);
        n = o.nextInt();

        <span class="hljs-comment">// Now checking whether the number is even or odd</span>
        <span class="hljs-keyword">if</span>(n % <span class="hljs-number">2</span> == <span class="hljs-number">0</span>)
            System.out.println(<span class="hljs-string">"The number is even"</span>);
        <span class="hljs-keyword">else</span>
            System.out.println(<span class="hljs-string">"The number is odd"</span>);

        <span class="hljs-comment">// program stopped</span>
    }
}
</code></pre>
<h1 id="heading-example">Example</h1>
<p>Let's take a programming problem to understand how to solve a problem practically. We will divide the problem into smaller sections and then solve those smaller sections to get to the full solution of the problem.</p>
<h3 id="heading-question">Question</h3>
<p>Write a program to take a number (n) as input from the user and print n lines of this pattern:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676965442777/8ba2bda8-81c6-46f9-8d08-7cd5e2756e23.png" alt class="image--center mx-auto" /></p>
<p><strong>Solution:</strong></p>
<p>Let's first analyze the problem by breaking it into small parts. So the steps to solve this problem are:</p>
<ul>
<li>First of all, we have to take the input <strong>n</strong></li>
</ul>
<ul>
<li><p>The pattern has <strong>n</strong> lines. So to print multiple lines we need one loop.</p>
</li>
<li><p>Again in each line, there is an increasing number of stars i.e. with each line the number of stars is increasing by one. So again we need another loop inside the previous loop. That means there are two loops, one is an <strong>outer loop</strong> and the other one is an <strong>inner loop</strong>.</p>
</li>
<li><p>Now we have to think about the <strong>conditions</strong> of the loops. The <strong>outer loop</strong> is taking care of the number of lines so the <strong>outer loop</strong> will run for <strong>n</strong> number of times since there are <strong>n</strong> lines. And the <strong>inner loop</strong> will run suppose <strong>k</strong> times, where k is the <strong>nth</strong> line because if we observe the pattern we will see the 1st line has one star, 2nd line has two stars, 3rd line has three stars and so on, so it depends on the current position of the line.</p>
</li>
<li><p>Now we use a print statement inside the <strong>inner loop</strong> to print a star.</p>
</li>
<li><p>And use a <strong>line break</strong> inside the <strong>outer loop</strong> and the <strong>inner loop</strong> finishes.</p>
</li>
</ul>
<p>With this small steps you can finally solve the problem easily like the code below.</p>
<pre><code class="lang-java"><span class="hljs-keyword">import</span> java.util.Scanner;

<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Example</span></span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span>
    </span>{    
        <span class="hljs-comment">// Creating object of the scanner class to take input</span>
        Scanner o = <span class="hljs-keyword">new</span> Scanner(System.in); 

        <span class="hljs-keyword">int</span> n; <span class="hljs-comment">// Initialization of variable</span>

        <span class="hljs-comment">// Taking the input from the user</span>
        System.out.println(<span class="hljs-string">"Enter a number"</span>);
        n = o.nextInt();

        <span class="hljs-comment">// Now printing the pattern</span>

        <span class="hljs-comment">//Outer loop</span>
        <span class="hljs-keyword">for</span>(<span class="hljs-keyword">int</span> i=<span class="hljs-number">0</span>;i&lt;n;i++)
        {   
            <span class="hljs-comment">// Inner loop</span>
            <span class="hljs-keyword">for</span>(<span class="hljs-keyword">int</span> j=<span class="hljs-number">0</span>;j&lt;=i;j++)
            {
                System.out.println(<span class="hljs-string">"*"</span>);
            }

            System.out.print(<span class="hljs-string">"\n"</span>);
        }    
    }
}
</code></pre>
<hr />
<p>This is it for this blog. Stay tuned for my next blog.</p>
<p>Like, Share and Comment. ♥</p>
]]></content:encoded></item><item><title><![CDATA[Docker]]></title><description><![CDATA[Hey 🖐, this is the blog on the basics of Docker. In this blog, you will learn about various topics about docker like docker container, docker image, docker hub and many more. So if you want to learn about containerization then this blog is for you. ...]]></description><link>https://blog.ronakpaul.com/docker</link><guid isPermaLink="true">https://blog.ronakpaul.com/docker</guid><category><![CDATA[Docker]]></category><category><![CDATA[containers]]></category><category><![CDATA[Containerization vs. Virtualization]]></category><category><![CDATA[Kubernetes]]></category><category><![CDATA[docker images]]></category><dc:creator><![CDATA[Ronak Paul]]></dc:creator><pubDate>Mon, 20 Feb 2023 15:29:56 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1676617750213/22462193-11f6-4bef-8366-f2233ac5afd4.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey 🖐, this is the blog on the basics of Docker. In this blog, you will learn about various topics about docker like docker container, docker image, docker hub and many more. So if you want to learn about containerization then this blog is for you. Let's start reading the blog.</p>
<hr />
<h1 id="heading-what-is-docker">What is Docker?</h1>
<p>Docker is a platform where you can containerize applications. Containerizing an application means packing up all the resources which are necessary to run the application on any machine.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676626195787/c8966fd0-0ed5-488f-87f8-3a914a300d83.png" alt class="image--center mx-auto" /></p>
<p>As in the above diagram, if an application has to run the application on any machine successfully then it needs suppose 4 resources <strong>front-end</strong>, <strong>back-end</strong>, <strong>database</strong> and <strong>other system requirements</strong>. Then we can put all resources in a <strong>container</strong> to make sure whenever a person uses this application by using this container, the application will run on any machine because it already has the resources in the container to run the application.</p>
<hr />
<h1 id="heading-what-is-the-need">What is the need?</h1>
<p>Before going to the need for docker let's first understand various ways through which we can run our application on a machine. There are three concepts to running an application on a machine and those are the <strong>Traditional concept</strong>, <strong>Virtualization concept</strong>, and <strong>Containerization concept</strong>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676627447757/e8a97703-3367-4afe-b9cc-241ac1b93694.png" alt class="image--center mx-auto" /></p>
<ul>
<li><p><strong>Traditional Concept:</strong> In the traditional concept, the <strong>host OS</strong> run on top of hardware and at the top of the <strong>host OS</strong> all the apps will run. As given in the diagram.</p>
<p>  Let's take an example to understand its disadvantages. Suppose you created an app that needs certain resources and hardware to run the app and you give the app to your friend to run on their computer. But your friend doesn't have access to the resources and hardware required for the app to run on his computer. So basically your friend can't run the app on his machine. This is bad right? So the <strong>traditional concept</strong> is not that good.</p>
</li>
<li><p><strong>Virtualization Concept:</strong> Before starting with the virtualization concept you have to know about certain terms like a <strong>hypervisor</strong>, <strong>virtual machine</strong>, and <strong>guest OS</strong>.</p>
<ul>
<li><p><strong>Hypervisor:</strong> A hypervisor is a software that creates and runs <strong>Virtual Machines</strong>. A hypervisor can run multiple <strong>Virtual Machines</strong> on the <strong>host OS</strong>.</p>
</li>
<li><p><strong>Virtual Machine: Virtual machine</strong> is a digital version of a physical machine or computer. It can do all the things that a physical machine can do but it doesn't have any physical existence.</p>
</li>
<li><p><strong>Guest OS: Guest OS</strong> is the operating system that runs on a particular <strong>Virtual Machine</strong> on top of a <strong>host OS</strong>.</p>
</li>
</ul>
</li>
</ul>
<p>    So in the virtualization concept, the <strong>host OS</strong> run on top of hardware and top of the <strong>host OS</strong> there is a <strong>hypervisor</strong>. And the hypervisor creates and runs different <strong>virtual machines</strong>. And on the top of each <strong>virtual machine</strong>, there is a different <strong>guest OS</strong> to run different applications on each <strong>guest OS</strong>.</p>
<p>    Now let's take the same example to understand its disadvantages compared to the containerization concept. So if you want to give the application to your friend then your friend will create and run a <strong>Virtual Machine</strong> and use a <strong>guest OS</strong> to run the app on his computer system. But creating different Virtual machines and using a <strong>guest OS</strong> in each <strong>Virtual Machine</strong> on top of a <strong>host OS</strong> is overweight. This is the disadvantage of using the <strong>virtualization concept</strong>.</p>
<ul>
<li><p><strong>Containerization Concept:</strong> In the containerization concept, the <strong>host OS</strong> run on top of hardware and top of the <strong>host OS</strong> there is a <strong>container runtime</strong> that creates and runs a <strong>container</strong>. And inside each container, our apps will run.</p>
<p>  Again let's take the same example to understand its benefit. So if you want to give the application to your friend then first pack up all the required resources to run the application in a <strong>container</strong> and give the container to your friend so that your friend can run the application on his computer without any interruption since already all the required resources are in the <strong>container</strong>. That's why it is a lightweight concept since we don't have to use different <strong>guest OS</strong> on our computer system.</p>
</li>
</ul>
<hr />
<h1 id="heading-what-is-container">What is Container?</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676906578780/c0324bb9-9495-4884-a7c0-292c63811c9a.png" alt class="image--center mx-auto" /></p>
<p>A <strong>container</strong> is a place where all the resources to run an application are packed up. You can think of a <strong>container</strong> as a box that contains all the resources to run an application such as front-end, back-end, databases, system resources and everything.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676906611934/edac6fdb-db5a-4490-9e4f-b5f68f4c60a8.png" alt class="image--center mx-auto" /></p>
<p>Let's take a good example to understand this concept. Suppose you prepare a dish in your home and you want to send the dish to your friend so that your friend can also taste the dish and can give you some compliments. But the problem is your friend's home is too far and to go to your friend's home takes 20 hours. If you send the dish to your friend then it will get worse. So now what would you do? The solution is to pack all the required ingredients for the dish and the recipe of the dish in one box and send the box to your friend so that your friend can prepare the food and can enjoy it. So here <strong>container</strong> is the box which contains all the resources for the dish.</p>
<h1 id="heading-what-is-an-image">What is an Image?</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676906620946/c658b3b0-b710-41c9-92cd-f03d727c3534.png" alt class="image--center mx-auto" /></p>
<p>An <strong>image</strong> is a set of instructions to create a <strong>container</strong>. We can create an <strong>image</strong> of any application. So as the name suggests, an <strong>image</strong> is the photo of the application and by seeing that photo <strong>containers</strong> are created by the <strong>container runtime</strong>.</p>
<h1 id="heading-what-is-container-runtime">What is Container Runtime?</h1>
<p><strong>Container runtime</strong>, also called <strong>container engine</strong>, is software that creates and runs containers on the <strong>host OS</strong>. A <strong>container runtime</strong> has several jobs. It loads container images from a repository like <strong>Docker Hub</strong>, gets information about local system resources, isolates system resources for the <strong>container</strong>, and manages the <strong>container lifecycle.</strong></p>
<h1 id="heading-what-is-docker-hub">What is Docker Hub?</h1>
<p><strong>Docker Hub</strong> is an online registry of docker where all the images of a container are stored. And we can pull an <strong>image</strong> from the <strong>docker hub</strong> to create and run a <strong>container</strong> in our machine.</p>
<hr />
<p>Thank you for reading the blog. More on docker will be on my upcoming blogs.</p>
<p>Like, Share and Comment. ♥</p>
]]></content:encoded></item><item><title><![CDATA[Touch Typing : Learn to type faster]]></title><description><![CDATA[Hey 🖐, this blog is about touch typing. For there who don't know what touch typing is, touch typing means typing on a keyboard without looking at the keyboard at a very high speed. So, in this blog, I am going to tell you how I mastered touch typing...]]></description><link>https://blog.ronakpaul.com/touch-typing-learn-to-type-faster</link><guid isPermaLink="true">https://blog.ronakpaul.com/touch-typing-learn-to-type-faster</guid><category><![CDATA[touch typing]]></category><category><![CDATA[Typing test, test, typing, online computer typing test, ]]></category><category><![CDATA[typing]]></category><category><![CDATA[typing test]]></category><category><![CDATA[Programming Blogs]]></category><dc:creator><![CDATA[Ronak Paul]]></dc:creator><pubDate>Fri, 02 Dec 2022 06:21:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1669961804126/0n8bv9whq.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey 🖐, this blog is about touch typing. For there who don't know what touch typing is, touch typing means typing on a keyboard without looking at the keyboard at a very high speed. So, in this blog, I am going to tell you how I mastered touch typing and what resources you can use to learn touch typing.</p>
<p>Well, to be honest, when I first got my laptop, I am very noob at typing but before getting the laptop I learned a lot of programming languages. So you can say before getting a laptop, I already become a quite good coder which I learned through mobile. But when I started coding on the laptop I faced lots of difficulties in writing programs because of my poor typing skills. Then, I decided to learn touch typing as soon as possible.</p>
<h2 id="heading-benefits">Benefits</h2>
<p>It will increase your typing speed but except that it will also save you valuable time. If you are a programmer, who always writes codes and stuff, for them touch typing is a great skill. It will help you every day. For me, touch typing just changed my entire workflow and I am just enjoying it.</p>
<h2 id="heading-how-to-do-touch-typing">How to do touch typing</h2>
<p>In touch typing, we use all ten fingers. And every finger is dedicated to some specific key. The chart of keys for each finger:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1669957913921/yfhkYnJb7.png" alt="Chart of keys for each finger" class="image--center mx-auto" /></p>
<p>While practicing touch typing you should keep in mind some points mentioned below:</p>
<ol>
<li><p>Eyes should be on the screen, not on the keyboard.</p>
</li>
<li><p>The back should be straight.</p>
</li>
<li><p>You need lots of patience.</p>
</li>
<li><p>Don't use the mouse every time.</p>
</li>
</ol>
<p>While practicing touch typing you should put your both hands on the middle row of the alphabet and you will notice in the keys <strong>F</strong> and <strong>J</strong> there is some mark on every keyboard, it is to place your hand correctly on the keyboard without looking at the keyboard. The right way to place your hand on the keyboard is:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1669960581353/HldlNG-ps.png" alt /></p>
<p>In the learning process of touch typing, you will face lots of demotivation while you compare yourself with others who are good at typing but don't do this mistake. You have to understand that they went through the same process, so don't compare. It will take 1-2 months to get a good speed. And you have to do regular practice per day for 1 hour to learn touch typing. So start touch typing practice from today.</p>
<h2 id="heading-resources">Resources</h2>
<p>Before giving you some best resources, I want to say that I am not promoting any websites here, I am just giving you some of my favorite websites to practice touch typing.</p>
<ol>
<li><p><a target="_blank" href="https://www.keybr.com/">www.keybr.com</a></p>
</li>
<li><p><a target="_blank" href="https://www.typingstudy.com/">www.typingstudy.com</a></p>
</li>
<li><p><a target="_blank" href="https://www.typingclub.com/">www.typingclub.com</a></p>
</li>
</ol>
<p>This is it for today's newsletter. If you find this blog helpful then share it. See you in the next blog.👋</p>
]]></content:encoded></item></channel></rss>