<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Olibhia Ghosh</title>
    <description>The latest articles on DEV Community by Olibhia Ghosh (@olibhiaghosh).</description>
    <link>https://dev.to/olibhiaghosh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1324994%2Fea1cb9b7-40a5-470d-8767-3ab3085fee20.png</url>
      <title>DEV Community: Olibhia Ghosh</title>
      <link>https://dev.to/olibhiaghosh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/olibhiaghosh"/>
    <language>en</language>
    <item>
      <title>My First Hacktoberfest Experience</title>
      <dc:creator>Olibhia Ghosh</dc:creator>
      <pubDate>Mon, 04 Nov 2024 06:45:17 +0000</pubDate>
      <link>https://dev.to/olibhiaghosh/my-first-hacktoberfest-experience-2afd</link>
      <guid>https://dev.to/olibhiaghosh/my-first-hacktoberfest-experience-2afd</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest"&gt;2024 Hacktoberfest Writing challenge&lt;/a&gt;: Contributor Experience&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Hello everyone!&lt;/p&gt;

&lt;p&gt;I’m glad to share that this year I participated in Hacktoberfest 2024 and &lt;strong&gt;I completed it successfully&lt;/strong&gt;. Today I will be sharing my Hacktoberfest experience with you all with the hope that you will learn something or get inspired from my experience.&lt;/p&gt;

&lt;p&gt;So let’s start with What Hacktoberfest actually is.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Hacktoberfest?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftc27qpgt6y5i31jdp69o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftc27qpgt6y5i31jdp69o.png" alt="Hacktoberfest" width="567" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hacktoberfest is &lt;strong&gt;a month-long annual celebration of open-source software.&lt;/strong&gt; It takes place in October.&lt;/p&gt;

&lt;p&gt;For more details check the website: &lt;a href="https://hacktoberfest.com/" rel="noopener noreferrer"&gt;https://hacktoberfest.com/&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How did I get to know about it?
&lt;/h3&gt;

&lt;p&gt;As I am active on Twitter and share my learnings there, I got to know about Hacktoberfest from there only.&lt;/p&gt;

&lt;p&gt;You can check my Twitter profile here: &lt;a href="https://x.com/OlibhiaGhosh" rel="noopener noreferrer"&gt;https://x.com/OlibhiaGhosh&lt;/a&gt; .&lt;/p&gt;

&lt;p&gt;One of my Twitter friend shared his registration for Hacktoberfest around 15 days before October and that caught my interest. I explored more about that and found it interesting.&lt;/p&gt;

&lt;p&gt;This buzz around the Hacktoberfest gave me the kick to participate and I registered for it.&lt;/p&gt;

&lt;p&gt;And this was all about how it started.&lt;/p&gt;

&lt;h3&gt;
  
  
  What were my expectations from it?
&lt;/h3&gt;

&lt;p&gt;Frankly speaking, as I was previously well-known to the world of open source and had already contributed, I was confident about making successful contributions.&lt;/p&gt;

&lt;p&gt;But I was also quite nervous about the fact that in this rush of Hacktoberfest month, would I be able to get myself assigned to 4 or more issues or not.&lt;/p&gt;

&lt;p&gt;And I jumped into this with this mixture of confidence and nervousness.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;Now, let’s talk about the main things that are how I managed to find suitable repositories, got assigned to issues, and was also able to successfully get my PR merged.&lt;/p&gt;

&lt;p&gt;At first, I will share how I found repositories to contribute.&lt;/p&gt;

&lt;h3&gt;
  
  
  How I found repositories to contribute?
&lt;/h3&gt;

&lt;p&gt;There are several ways of doing this but I will be sharing the one that worked for me.&lt;/p&gt;

&lt;p&gt;I went to the website of Hacktoberfest and dived into the participation section. There I got the list of repositories participating on GitHub and other platforms.&lt;/p&gt;

&lt;p&gt;From there I selected my preferred coding language and filtered out the repositories so that I could contribute easily.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: One thing that you should keep in mind is that you should select those repositories which has been updated recently or had the last activity recently.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffhifrdih1tcope9oui0m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffhifrdih1tcope9oui0m.png" alt="Finding repositories to contribute" width="800" height="642"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How I found the issues for my contribution?
&lt;/h3&gt;

&lt;p&gt;Now, after selecting the repositories, I opened it, and at first had a look on the Readme. This helps you to understand the projects better.&lt;/p&gt;

&lt;p&gt;Then I dived into the issues section. Then I filtered out the desired issue on two basis:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;First, I filtered out all the issues with the label &lt;code&gt;#hacktoberfest&lt;/code&gt; using GitHub’s advanced search option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa3wb4kbbh0b6lyecxl22.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa3wb4kbbh0b6lyecxl22.png" alt="Filtering issues using labels" width="800" height="443"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Secondly, I filtered it out more by selecting “No assignees” from the assignee’s section under GitHub’s advanced search so that I don’t waste time on exploring the issues that are already assigned.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgkypkia05kaokmek6xtg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgkypkia05kaokmek6xtg.png" alt="Assignees in a issue" width="800" height="392"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  My Contributions
&lt;/h2&gt;

&lt;p&gt;This was all about how I found repositories and issues. After finding the issue that was still not assigned and that I could work on, I made a comment that “I want to work on this issue“ and then got assigned by the maintainer.&lt;/p&gt;

&lt;p&gt;Now let me share how I contributed and what my contributions were.&lt;/p&gt;

&lt;h3&gt;
  
  
  FreeCodeCamp
&lt;/h3&gt;

&lt;p&gt;The first issue I got assigned to was of &lt;a href="https://www.freecodecamp.org/" rel="noopener noreferrer"&gt;FreeCodeCamp&lt;/a&gt;. The issue was to create a quiz on functional programming in a specified format. I created the quiz and sent the pull request.&lt;/p&gt;

&lt;p&gt;I was asked for some modifications from the maintainers. After all the modifications my PR got merged. This happiness of getting your PR merged hits differently.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftpd5py8iboahtt0qda0b.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftpd5py8iboahtt0qda0b.gif" alt="Very Happy GIFs | Tenor" width="220" height="172"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Contributing to FreeCodeCamp was really a big thing for me.&lt;/p&gt;

&lt;p&gt;Here is my PR: &lt;a href="https://github.com/freeCodeCamp/freeCodeCamp/pull/56497" rel="noopener noreferrer"&gt;https://github.com/freeCodeCamp/freeCodeCamp/pull/56497&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The most important thing I learned from here was that before contributing to any project make sure that you have read the contributing guidelines. Also, be patient as this thing takes time.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  ToolJet
&lt;/h3&gt;

&lt;p&gt;The second was an issue in &lt;a href="https://www.tooljet.com/" rel="noopener noreferrer"&gt;ToolJet&lt;/a&gt; which was a documentation fix. As soon as I was assigned I did the changes and made a PR. The maintainers suggested some changes. I made the changes and finally, my PR got approved and merged.&lt;/p&gt;

&lt;p&gt;Here is my PR: &lt;a href="https://github.com/ToolJet/ToolJet/pull/10943" rel="noopener noreferrer"&gt;https://github.com/ToolJet/ToolJet/pull/10943&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Completing 2 of them gave me the boost to complete Hacktoberfest 2024.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkaf65p8n27fy26e68fox.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkaf65p8n27fy26e68fox.gif" alt="Download Funny Excited Gif" width="350" height="219"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then I proceeded to find the third issue.&lt;/p&gt;

&lt;h3&gt;
  
  
  Makaut Buddy
&lt;/h3&gt;

&lt;p&gt;I found the 3rd issue here where I needed to align the profile icon on the home page. It was a UI fix. I made the changes and my PR got approved.&lt;/p&gt;

&lt;p&gt;Here is my PR: &lt;a href="https://github.com/Arindam200/makaut_buddy/pull/166" rel="noopener noreferrer"&gt;https://github.com/Arindam200/makaut_buddy/pull/166&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And now comes the last one.&lt;/p&gt;

&lt;p&gt;My 4th PR didn’t follow this standard process of getting assigned and then contributing. In this case, while I was exploring the project Makaut Buddy, I found some inconsistencies in the UI.&lt;/p&gt;

&lt;p&gt;I thought of opening an issue as this project was actively participating in Hacktoberfest 2024. I opened the issue and also got assigned to it for work along with the &lt;code&gt;#hacktoberfest&lt;/code&gt; label on the issue.&lt;/p&gt;

&lt;p&gt;That gave me the final relief. I made all the changes and my PR got merged.&lt;/p&gt;

&lt;p&gt;Here is my PR: &lt;a href="https://github.com/Arindam200/makaut_buddy/pull/174" rel="noopener noreferrer"&gt;https://github.com/Arindam200/makaut_buddy/pull/174&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All my PRs were reviewed by the Hacktoberfest organization and were finally accepted.&lt;/p&gt;

&lt;p&gt;In this way, I completed my &lt;strong&gt;Hacktoberfest 2024&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpbs.twimg.com%2Fmedia%2FGbM3C40agAAwxOo%3Fformat%3Djpg%26name%3D900x900" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpbs.twimg.com%2Fmedia%2FGbM3C40agAAwxOo%3Fformat%3Djpg%26name%3D900x900" alt="hacktoberfest" width="746" height="614"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons I learnt
&lt;/h2&gt;

&lt;p&gt;Now here’s the summary of the lessons I learnt from my whole Hacktoberfest experience.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Before contributing to any project make sure that you have read the contributing guidelines.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make sure you start working on the issue after getting assigned.(This is followed in most of the repositories).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Be patient while working on any issue and be collaborative.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;This was all about my Hacktoberfest experience and learnings.&lt;/p&gt;

&lt;p&gt;If you found this blog useful and insightful, share it and comment down your views on it.&lt;/p&gt;

&lt;p&gt;Do follow me for more such content.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__1324994"&gt;
    &lt;a href="/olibhiaghosh" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1324994%2Fea1cb9b7-40a5-470d-8767-3ab3085fee20.png" alt="olibhiaghosh image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/olibhiaghosh"&gt;Olibhia Ghosh&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/olibhiaghosh"&gt;An open-source enthusiast.
Currently learning web development and DSA in JAVA
Have knowledge about Python and MySQL&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Here's how you can connect with me.&lt;/p&gt;

&lt;p&gt;Email - &lt;a href="http://olibhiag@gmail.com" rel="noopener noreferrer"&gt;olibhia0712@gmail.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Socials: &lt;a href="https://twitter.com/OlibhiaGhosh" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; , &lt;a href="https://www.linkedin.com/in/olibhiaghosh/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; and &lt;a href="https://github.com/OlibhiaGhosh" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for giving it a read !!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4c7swvcuca3i9km67dz4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4c7swvcuca3i9km67dz4.png" alt="Thank you" width="708" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hacktoberfest</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Create a Slack Bot with NodeJS and Slack Bolt API</title>
      <dc:creator>Olibhia Ghosh</dc:creator>
      <pubDate>Wed, 16 Oct 2024 10:45:57 +0000</pubDate>
      <link>https://dev.to/olibhiaghosh/create-a-slack-bot-with-nodejs-and-slack-bolt-api-13hm</link>
      <guid>https://dev.to/olibhiaghosh/create-a-slack-bot-with-nodejs-and-slack-bolt-api-13hm</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;For developers, creating something using API that will automate our boring tasks is always a matter of excitement. And using Slack Bolt API we can make a bot for such boring tasks in Slack.&lt;/p&gt;

&lt;p&gt;In this article, we will make a Slack Bot using Slack Bolt API and NodeJS and will also add some functionalities.&lt;/p&gt;

&lt;p&gt;Excited right?&lt;/p&gt;

&lt;p&gt;Me too :)&lt;/p&gt;

&lt;p&gt;So let’s dive into it!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2qw62s2zmsuna4xzu1i.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2qw62s2zmsuna4xzu1i.gif" alt="Keep It Going Lets Go GIF by The Tonight Show Starring Jimmy Fallon" width="480" height="343"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Slack?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9jp20gesz6fn6w3zld19.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9jp20gesz6fn6w3zld19.png" alt="slack" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Slack is a popular communication platform used by many organizations, businesses, and development teams.&lt;/p&gt;

&lt;p&gt;If you explore Slack, you will see that it has Slack Bot which helps to streamline workflows and enhance team collaboration through automated processes.&lt;/p&gt;

&lt;p&gt;Now let’s answer the most common question: &lt;strong&gt;What are the prerequisites for making a Slack Bot?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;NodeJS and NPM installed on your machine.&lt;/p&gt;

&lt;p&gt;For reference, you can check my blog: &lt;a href="https://olibhia.hashnode.dev/all-about-npm-node-package-manager" rel="noopener noreferrer"&gt;All About NPM&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A basic understanding of JavaScript and NodeJS.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With these, you are all set to go for this project!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwaszwrvzey2ucamei99h.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwaszwrvzey2ucamei99h.gif" alt="thumbs up GIFs | Tenor" width="220" height="165"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Setup
&lt;/h2&gt;

&lt;p&gt;Here we will be discussing the steps to install a bot app in a Slack workspace.&lt;/p&gt;

&lt;p&gt;At first, we will create a new workspace and then we will create a new Slack app for this workspace.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Create a new Slack workspace&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;We will go through the following steps to create a new Slack workspace&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Visit the &lt;a href="https://slack.com/intl/en-in/" rel="noopener noreferrer"&gt;Slack website&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on &lt;strong&gt;Create a new workspace.&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now enter your email address.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Follow all the instructions and steps to create a workspace.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can now create channels, and invite team members in your newly created workspace. You can also send direct messages.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I have created this workspace named &lt;code&gt;Personal_Server&lt;/code&gt; for which I will create the Slack bot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1vvne5r5ev6uwc0n42w2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1vvne5r5ev6uwc0n42w2.png" alt="Personal_Server" width="800" height="85"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Note: You can also go with any existing workspace without creating a new workspace&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Create a new Slack app&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;We will be following the following steps to create a new Slack app i.e. our Slack bot&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Go to the &lt;a href="https://api.slack.com/" rel="noopener noreferrer"&gt;Slack API website&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now, click on &lt;strong&gt;Your Apps.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh5n2m3ucbe590tzg7a0r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh5n2m3ucbe590tzg7a0r.png" alt="Slack API Website" width="800" height="266"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Next click on Create New App.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3u44jh0qlf3kheukk7y7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3u44jh0qlf3kheukk7y7.png" alt="Create New App" width="800" height="204"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on From Scratch.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now give the app name, pick up the workspace you recently created, and then click on Create App.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Note: You can also select any existing workspace without creating a new workspace&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx1mypuvqnlsvvd5eerks.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx1mypuvqnlsvvd5eerks.png" alt="Create workspace" width="637" height="607"&gt;&lt;/a&gt;&lt;br&gt;
Now you will be redirected to the App credentials page.&lt;/p&gt;

&lt;p&gt;You need to set permissions before your app starts communicating with your Slack. For this, go to the OAuth and Permissions page and scroll down to the scopes part.&lt;/p&gt;

&lt;p&gt;Now, add the following scopes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F12ns6ub7e84b9cnscvex.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F12ns6ub7e84b9cnscvex.png" alt="Scopes" width="800" height="721"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Okay! Want to avoid a future bug? Then also enable the &lt;code&gt;chat:write&lt;/code&gt; scope.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Femarklcn3smqzbgs5ja4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Femarklcn3smqzbgs5ja4.png" alt="scope" width="762" height="82"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the left sidebar, Go to &lt;strong&gt;Settings → Install apps → Install to workspace&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You will get the Bot User OAuth Token!&lt;/p&gt;

&lt;p&gt;For now, let’s leave this Slack API page and now let’s do our server setup with NodeJS.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Slackbot Server Setup&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;We need to configure a server for Slackbot that can handle requests sent to Slackbot. So now it’s coding time!&lt;/p&gt;

&lt;p&gt;Create a directory with the name &lt;code&gt;SLACK-BOT&lt;/code&gt; and initiate the npm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;SLACK-BOT 
&lt;span class="nb"&gt;cd &lt;/span&gt;SLACK-BOT
npm init &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: -y answers all the questions of setting up by itself.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now we need to install the following packages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;slack/bolt -&lt;/strong&gt; Used to connect Slack to the Server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;dotenv -&lt;/strong&gt; Used to store API Keys and Database Passwords.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;nodemon - It is used to run the server.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To install these packages run the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i @slack/bolt dotenv nodemon
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, nodemon helps you prevent restarting the server whenever you make any changes. It restarts the server automatically on changes.&lt;/p&gt;

&lt;p&gt;Write the following command for nodemon setup in your &lt;code&gt;package.json&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Focfx33yxexhl74lmq0mz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Focfx33yxexhl74lmq0mz.png" alt="nodemon setup" width="552" height="102"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create an &lt;code&gt;app.js&lt;/code&gt; file under the root directory which will serve as the main starting point of our project.&lt;/p&gt;

&lt;h3&gt;
  
  
  Authentication of the Bot with Tokens
&lt;/h3&gt;

&lt;p&gt;Now comes the Authentication part. Before communicating with the bot, Slack first needs to verify your bot with &lt;code&gt;SIGNING_SECRET&lt;/code&gt; and a &lt;code&gt;BOT_TOKEN&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Both are stored in &lt;code&gt;.env&lt;/code&gt; file so that they are not exposed on GitHub.&lt;/p&gt;

&lt;p&gt;Now how to get the &lt;code&gt;SIGNING_SECRET&lt;/code&gt; and a &lt;code&gt;BOT_TOKEN&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SIGNING_SECRET&lt;/strong&gt; → Go to the basic information page and there you will get the signing secret.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ywxbygw73auhef8qayi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ywxbygw73auhef8qayi.png" alt="Singing Secret" width="800" height="155"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BOT_TOKEN&lt;/strong&gt; → Go to the OAuth and Permissions page and there you will get the OAuth token.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F19xm5j3by7fjxi8xspwk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F19xm5j3by7fjxi8xspwk.png" alt="OAuth Token" width="800" height="261"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, create a &lt;code&gt;.env&lt;/code&gt; file under the root directory where you will store the Signing secret and OAuth token which will not be published on GitHub.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;SIGNING_SECRET&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"YOUR SIGNING SECRET"&lt;/span&gt;
&lt;span class="nv"&gt;BOT_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"YOUR BOT TOKEN"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Server Setup&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Now, write the following code in &lt;code&gt;app.js&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@slack/bolt&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dotenv&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="c1"&gt;//Initializing the app with tokens&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;App&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;token&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;BOT_TOKEN&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;signingSecret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SIGNING_SECRET&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Bolt app started!!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;})();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, run the command &lt;code&gt;npm run dev&lt;/code&gt; and you will get the following message in the terminal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpj5b5oyecg108kx1zagh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpj5b5oyecg108kx1zagh.png" alt="Terminal output" width="173" height="25"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This indicates everything is on point till now!&lt;/p&gt;

&lt;p&gt;Now, the biggest question is &lt;strong&gt;How will the server and Slackbot communicate?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s dive into that.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;How will the server and Slackbot communicate?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Slack has a feature called socket mode that allows Slack to use the WebSockets to connect to your application server.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Go to Settings → Basic Info → App Level Tokens.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click the &lt;strong&gt;Generate Tokens and Scopes&lt;/strong&gt; button.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Give your token a name and allot your app two available scopes:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;connections:write&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;authorizations:read&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsvohvsyintas5c4fd4bh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsvohvsyintas5c4fd4bh.png" alt="Generating app level token" width="621" height="721"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click the &lt;strong&gt;Generate&lt;/strong&gt; button. Then copy the &lt;code&gt;APP_TOKEN&lt;/code&gt; from the next page and put it in &lt;code&gt;.env&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Now, the &lt;code&gt;.env&lt;/code&gt; file looks like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;SIGNING_SECRET&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"YOUR SIGNING SECRET"&lt;/span&gt;
&lt;span class="nv"&gt;BOT_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"YOUR BOT TOKEN"&lt;/span&gt;
&lt;span class="nv"&gt;APP_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"YOUR APP TOKEN"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next Go to &lt;strong&gt;Settings&lt;/strong&gt; → &lt;strong&gt;Socket&lt;/strong&gt; &lt;strong&gt;Mode&lt;/strong&gt; and enable the &lt;strong&gt;“Enable&lt;/strong&gt; &lt;strong&gt;Socket Mode”&lt;/strong&gt; switch.&lt;/p&gt;

&lt;p&gt;After that update the app configuration in the app.js file with &lt;code&gt;socketMode:true&lt;/code&gt; and your &lt;code&gt;appToken&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The app.js file will now look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@slack/bolt&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dotenv&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;App&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;token&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;BOT_TOKEN&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;signingSecret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SIGNING_SECRET&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;socketMode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;appToken&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;APP_TOKEN&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Bolt app started!!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;})();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On running the file, you will see something like this on your terminal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvucxxohibwv4ztisdlie.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvucxxohibwv4ztisdlie.png" alt="Terminal message" width="800" height="69"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Adding Functionality&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The setup is more or less done. Now it’s the time to add the functionality and make our Slackbot work in real.&lt;/p&gt;

&lt;p&gt;Excited?&lt;/p&gt;

&lt;p&gt;So let’s do it together!&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Replying to a Message:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In Slack, you can send messages to the bot by mentioning the bot using @Bot_name (for me it’s &lt;code&gt;Personal_Bot&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;In Slack, app mentions are an &lt;a href="https://api.slack.com/apis/connections/events-api" rel="noopener noreferrer"&gt;event&lt;/a&gt;. You can also listen to other events like when a new user joins a channel, a new channel is created, etc. To allow your bot to listen to events, you need to set up an event subscription.&lt;/p&gt;

&lt;p&gt;Click the &lt;strong&gt;subscribe to bot events&lt;/strong&gt; dropdown &lt;strong&gt;menu&lt;/strong&gt; and add the following &lt;strong&gt;events.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdlyve60flhsakyrf339t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdlyve60flhsakyrf339t.png" alt="Events" width="761" height="738"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And then click on &lt;strong&gt;Save Changes&lt;/strong&gt; located at the end of the page.&lt;/p&gt;

&lt;p&gt;If it asks to reinstall the app, then do reinstall it.&lt;/p&gt;

&lt;p&gt;Now we will write code to see if the app responds correctly to a message that it receives.&lt;/p&gt;

&lt;p&gt;Add the following code to the &lt;code&gt;app.js&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;message&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;say&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nf"&gt;say&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Hello &amp;lt;@&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;gt;!`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;err&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;According to the above code, &lt;code&gt;app.message&lt;/code&gt; is used to define that the app will respond with a “Hello @ username “ to a “hello“ message if sent.&lt;/p&gt;

&lt;p&gt;But there’s still a problem. You will see the message like “You can’t send message to this app” when you click on the bot in the Apps tab of Slack. To resolve this, turn the feature on!&lt;/p&gt;

&lt;p&gt;Now go back to the &lt;strong&gt;App settings&lt;/strong&gt; page.&lt;/p&gt;

&lt;p&gt;Then go to App Home under features. Now scroll down to Show Tabs section. Scroll down and check the box with &lt;strong&gt;allow users to send slash commands and messages from the Messages tab&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flm2tm73ifkgb1i2fyuph.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flm2tm73ifkgb1i2fyuph.png" alt="Show Tabs" width="762" height="602"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, reload Slack using the &lt;code&gt;ctrl + r&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;Try sending a message like &lt;code&gt;@ Personal_Bot hello&lt;/code&gt; and you will see it will respond with &lt;code&gt;Hello @Olibhia Ghosh&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ffro9nrg3wkqahbehwc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ffro9nrg3wkqahbehwc.png" alt="message" width="492" height="172"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Taking a real situation the message cannot be exactly the same as we provide. For that, Slack allows us to use regex expressions where the bot can respond to a message that contains a keyword or some part of it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;message&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/hi/&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;say&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nf"&gt;say&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Hello &amp;lt;@&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;gt;!`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;err&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you send any message like &lt;code&gt;hi personal bot&lt;/code&gt;, the bot will respond as it contains the word &lt;code&gt;hi&lt;/code&gt; in it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpj535986eoxecu70991g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpj535986eoxecu70991g.png" alt="Bot message" width="403" height="148"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This was all about how I built my Slack Bot. You can add more features by referring to the &lt;a href="https://tools.slack.dev/bolt-js/" rel="noopener noreferrer"&gt;Slack Bolt API Documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here’s the link to the source code of the Slack Bot I made : &lt;a href="https://github.com/OlibhiaGhosh/Slack-bot" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I hope you’ve built your first Slack Bot by following this step-by-step guide. Now keep on exploring the API and adding more functionalities to your chatbot to enhance its functionalities.&lt;/p&gt;

&lt;p&gt;I hope I made it simple for all.&lt;/p&gt;

&lt;p&gt;If you found this blog useful and insightful, share it and comment down your views on it.&lt;/p&gt;

&lt;p&gt;Do follow for more such content.&lt;/p&gt;

&lt;p&gt;Here's how you can connect with me.&lt;/p&gt;

&lt;p&gt;Email - &lt;a href="http://olibhiag@gmail.com" rel="noopener noreferrer"&gt;olibhia0712@gmail.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Socials: &lt;a href="https://twitter.com/OlibhiaGhosh" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; , &lt;a href="https://www.linkedin.com/in/olibhiaghosh/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; and &lt;a href="https://github.com/OlibhiaGhosh" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for giving it a read !!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4c7swvcuca3i9km67dz4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4c7swvcuca3i9km67dz4.png" alt="Thank you" width="708" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>node</category>
    </item>
    <item>
      <title>Improving Developer Productivity With Pieces</title>
      <dc:creator>Olibhia Ghosh</dc:creator>
      <pubDate>Sun, 09 Jun 2024 17:32:56 +0000</pubDate>
      <link>https://dev.to/olibhiaghosh/improving-developer-productivity-with-pieces-if3</link>
      <guid>https://dev.to/olibhiaghosh/improving-developer-productivity-with-pieces-if3</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Hello everyone! Recently, I got introduced to a developer tool from a Twitter space where I got to know about its superb features and thus decided to use it. Today I'll be sharing that and yeah, you guessed it right it's &lt;strong&gt;Pieces for Developers.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I was working on a project named Makaut Buddy and that's where I tried Pieces that gave my productivity a 10x boost. It saved my time and gave me a smooth workflow. Also, Keeping track of my work became very easy with Pieces.&lt;/p&gt;

&lt;p&gt;In this blog, I will be sharing how it helped me and how it can help you and increase your productivity.&lt;/p&gt;

&lt;p&gt;Now the obvious questions that might come to your mind are What is Pieces? Why Pieces? How has it helped me? and How can it help you too?&lt;/p&gt;

&lt;p&gt;So, let's answer it in the following section.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Pieces &lt;strong&gt;for Developers&lt;/strong&gt;?
&lt;/h2&gt;

&lt;p&gt;Pieces is an AI-enabled productivity tool that helps to boost a developer's productivity. It's your AI companion.&lt;/p&gt;

&lt;p&gt;To have a better idea about What Pieces do, check out this video.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://www.youtube.com/watch?si=xBIwvzfuiOU-qfZL&amp;amp;v=aP8u95RTCGE&amp;amp;feature=youtu.be" rel="noopener noreferrer"&gt;
      youtube.com
    &lt;/a&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Why Pieces?
&lt;/h2&gt;

&lt;p&gt;Now let's jump to the next question, "Why Pieces?" and also the obvious one "Why am I even suggesting this?".&lt;/p&gt;

&lt;p&gt;Previously while working on projects I used ChatGPT or Gemini as an AI tool. But the problems I faced with that were the continuous switching between the tabs, not able to manage the code snippets in one place, and the copy-pasting code from IDE like VS code to the ChatGPT. It was really a headache for me.&lt;/p&gt;

&lt;p&gt;That's when I decided to try out Pieces and after using it for a few weeks I realized how it increased my productivity, solved all my above problems, and provided me with a smooth workflow.&lt;/p&gt;

&lt;p&gt;Thus I thought of sharing it with you all.&lt;/p&gt;

&lt;h2&gt;
  
  
  How can it help you?
&lt;/h2&gt;

&lt;p&gt;Now let me give you an overview of my experience on how Pieces can help you along with the Use cases and pros/Cons with detailed notes on how it helped me in further sections of this blog.&lt;/p&gt;

&lt;p&gt;Let's start with some of its &lt;strong&gt;Use cases&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It helps in generating code from simple language instructions, searching for any code with context, generating code from screenshots, and many more.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It can access your entire PC, including recent web searches, files, folders, and open tabs for a broader understanding of your work.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Managing code snippet: Organizing, Saving, Editing, and sharing code snippets in a much easier way.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can use live context to read the contents in an open tab when a huge number of tabs are open and thus you need not look for the tab among those huge number of tabs. (It works only when the live context is on and also the workstream pattern engine is enabled).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Live context also keeps a track of everything that you’ve focused on while WPE is running. And the amazing part is even if you close it you will still be able to access the information via Live Context.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also, here are some of the pros/cons I discovered while using Pieces.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It can access your entire PC, including recent web searches, files, folders, and open tabs for a broader understanding of your work.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It helps you to manage code snippets in an easier way.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tailors suggestions to your project's codebase and language.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Can be run offline.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It picks up the context from where you left off, thus potentially saving your time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It provides the workflow activity.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It enhances privacy and security by saving all the stuff in your local system.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It also improves the code quality by providing additional links and information.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can also use Local LLMs through Pieces.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Functionality is a bit slow in case of taking context from any files or folders.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It would be better if we also have a cloud version with a request limit so that everyone need not to have Pieces OS on their system.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sometimes it throws an error while generating a response.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This was all about my discoveries on how Pieces can help you. Now let me share where Pieces actually helped me and how I used it.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Pieces helped me?
&lt;/h2&gt;

&lt;p&gt;I generally use Pieces while working on my projects and writing blogs.&lt;/p&gt;

&lt;p&gt;In the following section, I'll be sharing how I used different features of Pieces and how they helped me&lt;/p&gt;

&lt;p&gt;Let's start with my favourite one, the VS Code Extension&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Visual Studio Code Plugin&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When I was working on my project on VS code I had a problem in understanding a part of the code. Thus I decided to use the Pieces VS code extension.&lt;/p&gt;

&lt;p&gt;I selected the code and asked to explain it to me. It explained the whole code and thus saved my time and solved my problem.&lt;/p&gt;

&lt;p&gt;Here's the screenshot of what I did.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXcbqsdWtDmwavl_L9AA_fnQo7NEU1IGHLs1xFei6siTewov0d5a1dqsJDIXGIgRE1cGSRXVMn57jrNEh9PGVblIytIBf9y0rolQv_0TV-0giUGVbOf7kPuBSZ6oiY3a4JgC4ZGgOLSeUj6ncJMuHdMRo5g%3Fkey%3DBFxtEmorTDxoW3DbynKCVA" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXcbqsdWtDmwavl_L9AA_fnQo7NEU1IGHLs1xFei6siTewov0d5a1dqsJDIXGIgRE1cGSRXVMn57jrNEh9PGVblIytIBf9y0rolQv_0TV-0giUGVbOf7kPuBSZ6oiY3a4JgC4ZGgOLSeUj6ncJMuHdMRo5g%3Fkey%3DBFxtEmorTDxoW3DbynKCVA" alt="Explanation of code using VS Code plugin"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The best part about the VS code extension is that it has access to the VS Code workspace, thus you can ask any question related to any file or folder provided as context by giving the file name or its relative path and it also saves code snippets with a title as well as a description.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXetDSLdqewejTg6Q_4NFnb_yk9gxBP3Wl-Ii0bmk98LZvxiWa8tog7dd_oDmzJ9_3W5iFgwMEJ8fNOXlg2iAxV5bDrMu40dFJ2rjiNmyt7SqJrRUEzWahcRuxA8kET3Zd85cLDVXh0HYIhxLNVZu1Htdeyb%3Fkey%3DBFxtEmorTDxoW3DbynKCVA" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXetDSLdqewejTg6Q_4NFnb_yk9gxBP3Wl-Ii0bmk98LZvxiWa8tog7dd_oDmzJ9_3W5iFgwMEJ8fNOXlg2iAxV5bDrMu40dFJ2rjiNmyt7SqJrRUEzWahcRuxA8kET3Zd85cLDVXh0HYIhxLNVZu1Htdeyb%3Fkey%3DBFxtEmorTDxoW3DbynKCVA" alt="Saved snippets in VS Code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But one thing that I didn't like was while I accessed the saved snippets from any particular project folder in VS code it showed me all the saved snippets from various folders. It would be better if it can show that for that particular folder only.&lt;/p&gt;

&lt;p&gt;That was all about my thoughts while exploring this feature.&lt;/p&gt;

&lt;p&gt;Now, let's jump into that feature which I found the most helpful, the Desktop app.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Desktop App&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;My college gave me a screenshot of a code that I need to run on my machine. Thus instead of writing the code manually, I decided to use Pieces.&lt;/p&gt;

&lt;p&gt;I used the screenshot to code generator feature in Pieces copilot that extracted the code from the screenshot thus simplifying my work. I just copied the code and ran it on my machine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXd4ODcWFe0iUnHvfPs_eVyNo6m0rVQgLYKMTSCIjoJ4s8NnEclBKNG25jQ7Vnni5AkLAEVi2xw_1lz0P-XCaY1YyU14i9dEFp9cg0TVCZZwO7ae6lAtUqv30Y308S1ZjtADUbePWA_lFP5WZkFzr4RpC00%3Fkey%3DBFxtEmorTDxoW3DbynKCVA" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXd4ODcWFe0iUnHvfPs_eVyNo6m0rVQgLYKMTSCIjoJ4s8NnEclBKNG25jQ7Vnni5AkLAEVi2xw_1lz0P-XCaY1YyU14i9dEFp9cg0TVCZZwO7ae6lAtUqv30Y308S1ZjtADUbePWA_lFP5WZkFzr4RpC00%3Fkey%3DBFxtEmorTDxoW3DbynKCVA" alt="Screenshot to Code generator"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I explored the desktop app more as it caught my attention. I found several use cases that are super helpful which are listed below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXfmS9k3qgQFWhHBk9ukp6X43enz2mlOzXfDLt5dWKnCqmjDSj7C65sPdWDUki3MXp2Oa2mqm7Rm-XWrcFRG-WHKjeRI921i9btuOQLLTWLIS53pGRaW5XQnCZ3FpwSh0mdynZRIszzHrMMe3hmXxFrSacZ3%3Fkey%3DBFxtEmorTDxoW3DbynKCVA" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXfmS9k3qgQFWhHBk9ukp6X43enz2mlOzXfDLt5dWKnCqmjDSj7C65sPdWDUki3MXp2Oa2mqm7Rm-XWrcFRG-WHKjeRI921i9btuOQLLTWLIS53pGRaW5XQnCZ3FpwSh0mdynZRIszzHrMMe3hmXxFrSacZ3%3Fkey%3DBFxtEmorTDxoW3DbynKCVA" alt="Pieces desktop window"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You can use files and folders as context for asking any question about a code. Thus you don’t have to copy-paste the huge lines of codes and ask for any answer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can also save code snippets that you can further refer to in a single place i.e. from the Desktop App.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The best feature I liked is the Screenshot to code converter as I mentioned earlier.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can use GPT4o and that’s really awesome. You can also switch between various LLMs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXeMTQwXxEvemf9N-up7bjRsLoyHn0o_Q7kHNzcjezHlfWyDcwnP2uDrMC4gvGCLnB7hB21s51aYaB-XJh5bYeOn3YUlOTxNzOW2sGt9JiSzvQ5EV2q7NHpMasrsJJWGO1nsEdaBMrxpbwiYRgzoJKYFIBWB%3Fkey%3DBFxtEmorTDxoW3DbynKCVA" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXeMTQwXxEvemf9N-up7bjRsLoyHn0o_Q7kHNzcjezHlfWyDcwnP2uDrMC4gvGCLnB7hB21s51aYaB-XJh5bYeOn3YUlOTxNzOW2sGt9JiSzvQ5EV2q7NHpMasrsJJWGO1nsEdaBMrxpbwiYRgzoJKYFIBWB%3Fkey%3DBFxtEmorTDxoW3DbynKCVA" alt="Choosing LLM locally"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Pieces Desktop App&lt;/strong&gt; can access your entire PC, including recent web searches, files, folders, and open tabs for a broader understanding of your work.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It also picks up context from where you left off, potentially saving time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pieces helps you to share code snippets using shareable links attached with context, important info as well as links.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXd5p7h4vcvHxzy2HEPZ5KnK34Dz8SBa9jieRL3XClhhPUX7AJSgBnmhfJLDCcULgmQs80HV8hDnf8DRBXjCLGND0UOBK_qnoGy-uP-k6CwW-uO5CwpDCNGnilHKBAr1BHPkWbMSs5anWK8Ug2ACBC5Cbf8%3Fkey%3DBFxtEmorTDxoW3DbynKCVA" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXd5p7h4vcvHxzy2HEPZ5KnK34Dz8SBa9jieRL3XClhhPUX7AJSgBnmhfJLDCcULgmQs80HV8hDnf8DRBXjCLGND0UOBK_qnoGy-uP-k6CwW-uO5CwpDCNGnilHKBAr1BHPkWbMSs5anWK8Ug2ACBC5Cbf8%3Fkey%3DBFxtEmorTDxoW3DbynKCVA" alt="generating personal link"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And these were the awesome features the desktop app provides.&lt;/p&gt;

&lt;p&gt;Here I didn’t find any such type of cons except the late response by the Live context feature. It takes a lot of time to grab the context and then provide the answer.&lt;/p&gt;

&lt;p&gt;And this was all about it. Now let's look into the most fascinating feature I found, the Live Context.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Live Context&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I was looking for my tweet where I celebrated my followers and thus instead of searching the Twitter tab where the post was open among the huge number of tabs previously opened by me, I decided to use Live context (My live context was already on and the workstream pattern engine was also enabled).&lt;/p&gt;

&lt;p&gt;It read me the post with the keyword followers which helped me to avoid the manual search and this was really fascinating.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXcE2SmGJbOMEDT4AIC-I47suepgoDp4oL-qFJRdms3KayQNNIs0avwHlH3fh6asuJrCggihgcbWG8wCgdSExRJkB2tvnh_Q9uYLP5mxyYcTlH90Gq4MxaxHrN3ZtHwwVlq_1iGFLSUMV6Oao10LFeSVp7Q%3Fkey%3DBFxtEmorTDxoW3DbynKCVA" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXcE2SmGJbOMEDT4AIC-I47suepgoDp4oL-qFJRdms3KayQNNIs0avwHlH3fh6asuJrCggihgcbWG8wCgdSExRJkB2tvnh_Q9uYLP5mxyYcTlH90Gq4MxaxHrN3ZtHwwVlq_1iGFLSUMV6Oao10LFeSVp7Q%3Fkey%3DBFxtEmorTDxoW3DbynKCVA" alt="Live context feature"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It help you to deal with switching between tabs frequently. Using it you can get information of any tab that is open without scrolling and finding the tabs among the numerous opened tabs.&lt;/p&gt;

&lt;p&gt;Moreover, when I was working on one of the projects on VS code and couldn’t understand it, I thought of referring to the Live context. (Of course my live context and WPE was enabled).&lt;/p&gt;

&lt;p&gt;I asked it to explain me the code opened on my VS code and it did that for me. This saved me from copying the code and then asking the copilot. Isn’t it amazing?&lt;/p&gt;

&lt;p&gt;Here’s a screenshot of what I did.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXedRKgmA0cQ6EDYhZ1paxW5LoMCQG5Mj7ps-jhsRdau53YEiyrXxIn5m1-M7exypBi5EQuWZT2ALWupyQPMrtSGhdXlQUzMdaxTT83NFi3HU3HVDWYbZxrk33uK1bSMuHBoXiskShCJi7nfCzElQV6uIj01%3Fkey%3DsgzGL6p41xY9VurEZJuxYg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXedRKgmA0cQ6EDYhZ1paxW5LoMCQG5Mj7ps-jhsRdau53YEiyrXxIn5m1-M7exypBi5EQuWZT2ALWupyQPMrtSGhdXlQUzMdaxTT83NFi3HU3HVDWYbZxrk33uK1bSMuHBoXiskShCJi7nfCzElQV6uIj01%3Fkey%3DsgzGL6p41xY9VurEZJuxYg" alt="using live extension for understanding the code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And you know what, the best part is it stores all the contexts and data on your device locally thus making it more secure for you.&lt;/p&gt;

&lt;p&gt;But Sometimes it does not give the desired result. It is taking some extra time to capture the context thus getting the response late or getting the earlier response.&lt;/p&gt;

&lt;p&gt;That was all about Live context.&lt;/p&gt;

&lt;p&gt;And while I was exploring all this I got to know about the web extension and now let me share that with you too.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Web Extension&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;While browsing I come across a lot of code on various websites and thus while working with these codes I need to switch between my tabs very often which was really a headache for me.&lt;/p&gt;

&lt;p&gt;The Pieces web extension gave me an option to save all the snippets in a place so that I could refer to them from a single place. This helped me as I need not switch between the tabs frequently anymore. It saved all the snippets in Pieces desktop app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXdPn3DnVColhfhy5Vwe1gNBAAJ8WeBsh9JO_p9qZyFkTov6yNqBEIPF08cXQqa9KxPtZO67dbmsB7gbDK58uOkXw2T5b8hJyVA3RnR71cdyjCzWmFxuYXOqSYWpWInhUpoQS8x3qm8I4rqpLFIOgcSc8v0%3Fkey%3DBFxtEmorTDxoW3DbynKCVA" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXdPn3DnVColhfhy5Vwe1gNBAAJ8WeBsh9JO_p9qZyFkTov6yNqBEIPF08cXQqa9KxPtZO67dbmsB7gbDK58uOkXw2T5b8hJyVA3RnR71cdyjCzWmFxuYXOqSYWpWInhUpoQS8x3qm8I4rqpLFIOgcSc8v0%3Fkey%3DBFxtEmorTDxoW3DbynKCVA" alt="Saving code snippets"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It also discovers all the possible snippets and suggests to save if required. This reduces your load as it already discovered all the code snippets from the website.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXfLJSLUh0HhrWTZ1h2XQ73MkDoIsiRrS1QYilXPqfKhk7IV_iYN9hY2IEGgWl_1bAIPDDqWEiLn1e71d6YRVdIBlMiJotrpK52VWLBx6iExz28AiJmlGVsvJof8h5dmWwmqHMVt1dipXUok53Io9mR0fYfC%3Fkey%3DBFxtEmorTDxoW3DbynKCVA" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXfLJSLUh0HhrWTZ1h2XQ73MkDoIsiRrS1QYilXPqfKhk7IV_iYN9hY2IEGgWl_1bAIPDDqWEiLn1e71d6YRVdIBlMiJotrpK52VWLBx6iExz28AiJmlGVsvJof8h5dmWwmqHMVt1dipXUok53Io9mR0fYfC%3Fkey%3DBFxtEmorTDxoW3DbynKCVA" alt="Code snippet suggestion"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It also gives you access to the copilot chat with the help of which you can ask questions without leaving the browser.&lt;/p&gt;

&lt;p&gt;And that was all about all the features and how these helped me.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up
&lt;/h2&gt;

&lt;p&gt;After knowing all the amazing features it provides all that remains to know is how to set it up and use it. For more information on how to set up on your local system check the link below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.pieces.app/installation-getting-started/what-am-i-installing" rel="noopener noreferrer"&gt;Check out this link for Set Up&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In my opinion, Pieces Suite is a pack of powerful tools that adds to developers' productivity, enriched learning, Code snippet management, and various others. Its Web extension, VS code extension, and live context make it superbly easy to keep track of work and maintain a consistent workflow.&lt;/p&gt;

&lt;p&gt;In a nutshell, it’s a great developer tool that can increase one's productivity by 10x times.&lt;/p&gt;

&lt;p&gt;If you found this blog useful and insightful, share it and comment down your views on it. Do follow for more such content. Also, connect with me on :&lt;/p&gt;

&lt;p&gt;Email: &lt;a href="http://olibhiag@gmail.com" rel="noopener noreferrer"&gt;olibhia0712@gmail.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Socials: &lt;a href="https://twitter.com/OlibhiaGhosh" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/olibhiaghosh/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; and &lt;a href="https://github.com/OlibhiaGhosh" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for giving it a read !!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1717621232671%2F86743e53-fb1e-44f5-b3a9-7c439c2bbd73.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1717621232671%2F86743e53-fb1e-44f5-b3a9-7c439c2bbd73.png" alt="Thank you"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>ai</category>
      <category>productivity</category>
      <category>development</category>
    </item>
    <item>
      <title>All About NPM (Node Package Manager)</title>
      <dc:creator>Olibhia Ghosh</dc:creator>
      <pubDate>Sat, 25 May 2024 06:11:57 +0000</pubDate>
      <link>https://dev.to/olibhiaghosh/all-about-npm-node-package-manager-hk2</link>
      <guid>https://dev.to/olibhiaghosh/all-about-npm-node-package-manager-hk2</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;NPM is an essential tool for JavaScript developers for managing versatile packages in the node.js ecosystem.&lt;/p&gt;

&lt;p&gt;While I was learning Tailwind CSS and Node.js, I came across this term "NPM" and this made me pretty curious.&lt;/p&gt;

&lt;p&gt;So I decided to dive deep into the concept usage and working of NPM&lt;/p&gt;

&lt;p&gt;In this article, we will explore the basic concept of NPM&lt;/p&gt;

&lt;p&gt;So, let's dive into it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1461749280684-dccba630e2f6%3Fq%3D80%26w%3D1000%26auto%3Dformat%26fit%3Dcrop%26ixlib%3Drb-4.0.3%26ixid%3DM3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%253D%253D%2520align%3D" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1461749280684-dccba630e2f6%3Fq%3D80%26w%3D1000%26auto%3Dformat%26fit%3Dcrop%26ixlib%3Drb-4.0.3%26ixid%3DM3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%253D%253D%2520align%3D" alt="monitor showing Java programming"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is NPM?
&lt;/h2&gt;

&lt;p&gt;So before we move further let's understand What is NPM.&lt;/p&gt;

&lt;p&gt;NPM stands for Node Package Manager. It is the main and default package manager for the JavaScript runtime environment Node.js&lt;/p&gt;

&lt;p&gt;Not clear enough?&lt;/p&gt;

&lt;p&gt;Let's break it into much simpler words&lt;/p&gt;

&lt;p&gt;It is a huge repository containing numerous open-source software that can be used by anyone for free.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do we need NPM?
&lt;/h2&gt;

&lt;p&gt;Now the question that arises in our mind is &lt;strong&gt;why do we actually need npm?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's understand this using an example. Assume that we are building a laptop. Is it possible to build all its components from scratch and then assemble all the components to build a laptop?&lt;/p&gt;

&lt;p&gt;No right?&lt;/p&gt;

&lt;p&gt;As it will take a lot of time and is also not worth it. Instead, we just take the pre-built components and assemble them to make a laptop which makes the process much easier and faster&lt;/p&gt;

&lt;p&gt;NPM helps us in a similar way. It makes writing code easier as we can use pre-built code written by other authors&lt;/p&gt;

&lt;p&gt;Other authors write their code for their package and publish it on the NPM registry. We can then use the code by installing it on our machine using NPM CLI(Command Line Interface). All kinds of packages are present in NPM from single-purpose ones to large libraries.&lt;/p&gt;

&lt;p&gt;Now to use NPM we need to know how to install NPM on our machines.&lt;/p&gt;

&lt;p&gt;Let's look into that&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Node.js
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Go to the website &lt;a href="https://nodejs.org/en/download" rel="noopener noreferrer"&gt;https://nodejs.org/en/download&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Select the required version, the OS, and click on download.&lt;/p&gt;

&lt;p&gt;Now download it and complete the setup.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tip: Avoid choosing the latest version as it might contain bugs&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx46s8wzydilne3w3o23u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx46s8wzydilne3w3o23u.png" alt="Screenshot of the Node.js download page. The page offers options to download the current version (v21.7.3) for Windows, running on x64 architecture. There are links to read the changelog, blog post, verify SHASUMS, and view other download options."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 2: Run the following commands on your terminal and check if Node.js was installed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F435g6600mqlzr49mywig.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F435g6600mqlzr49mywig.png" alt="Command prompt showing Node.js version 21.5.0 and npm version 10.2.4."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The command &lt;code&gt;node -v&lt;/code&gt; and &lt;code&gt;npm -v&lt;/code&gt; will return its latest versions.&lt;/p&gt;

&lt;p&gt;If it's not working then try restarting your system and it will work.&lt;/p&gt;

&lt;p&gt;Now let's look into the process of installing npm packages&lt;/p&gt;
&lt;h2&gt;
  
  
  Installing NPM Packages
&lt;/h2&gt;

&lt;p&gt;In this step, we will install the required NPM package.&lt;/p&gt;

&lt;p&gt;For that first clone any repository and open it in your code editor&lt;/p&gt;

&lt;p&gt;Now open the terminal and run the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm init &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: Here -y is used to automatically answer "yes" to all prompts. Thus preventing us from doing it manually.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You will see a &lt;strong&gt;&lt;em&gt;package.json&lt;/em&gt;&lt;/strong&gt; file was created.&lt;/p&gt;

&lt;p&gt;We will be looking into the usage and details of this file further&lt;/p&gt;

&lt;p&gt;In a nutshell, &lt;code&gt;package.json&lt;/code&gt; file contains the details about the dependencies and packages to be installed on running the required npm command&lt;/p&gt;

&lt;p&gt;On running the command &lt;code&gt;npm install&lt;/code&gt; it will create a node_modules folder and install the required packages and dependencies as mentioned in the package.json file inside the node_modules folder&lt;/p&gt;

&lt;p&gt;It will also create a &lt;strong&gt;&lt;em&gt;package-lock.json&lt;/em&gt;&lt;/strong&gt; file. In the further sections, we will be looking into the details of the &lt;strong&gt;&lt;em&gt;package-lock.json&lt;/em&gt;&lt;/strong&gt; file.&lt;/p&gt;

&lt;p&gt;We can also use the following command to only install the specified and required packages and their dependencies in the node_modules&lt;/p&gt;

&lt;p&gt;After installation, it will automatically get pushed into the &lt;strong&gt;&lt;em&gt;package.json&lt;/em&gt;&lt;/strong&gt; file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &amp;lt;package name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What we have been doing till now is installing local packages but there is also something termed global packages that can be installed and used&lt;/p&gt;

&lt;p&gt;Now we will see the difference between local packages and global packages&lt;/p&gt;

&lt;h3&gt;
  
  
  Local Package v/s Global Package
&lt;/h3&gt;

&lt;p&gt;Let's understand the difference between the local package and the global package.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Local packages:&lt;/strong&gt; These packages are installed in the directory where we run the &lt;code&gt;npm install &amp;lt;package name&amp;gt;&lt;/code&gt; command. These packages are not available for other projects or other directories.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Global packages:&lt;/strong&gt; These are installed in our system in a specified location and can be used in any directory or any project present in the System.&lt;/p&gt;

&lt;p&gt;We can install these global packages using the command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; &amp;lt;package-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And, we are ready to use the installed packages and work with them.&lt;/p&gt;

&lt;p&gt;Now, we will be looking into the use and details of the &lt;strong&gt;&lt;em&gt;"package.json"&lt;/em&gt;&lt;/strong&gt; file and &lt;strong&gt;&lt;em&gt;"package-lock.json"&lt;/em&gt;&lt;/strong&gt; file.&lt;/p&gt;

&lt;h2&gt;
  
  
  About Package.json File
&lt;/h2&gt;

&lt;p&gt;It is important to know the uses and details of these files. So, let's learn about the &lt;code&gt;package.json&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Package.json file stores all the data about the project.&lt;/p&gt;

&lt;p&gt;It contains :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;name&lt;/code&gt; -&amp;gt; name of the project&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;version&lt;/code&gt; -&amp;gt; The current version of the project&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;description&lt;/code&gt; -&amp;gt; The description of the project&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;main&lt;/code&gt; -&amp;gt; Specifies the file that is the main entry point of your project&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;scripts&lt;/code&gt; -&amp;gt; This includes the command associated with your project like the command for building, running, or testing the project&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;dependencies&lt;/code&gt; -&amp;gt; This is where all the required packages are listed that are required to run the project. These are installed in your system using npm install&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;devDependencies&lt;/code&gt; -&amp;gt; This contains the modules that are required only during the development not in the production&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;repository&lt;/code&gt; -&amp;gt; Specifies the type of version control we are using and the url of the repository&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;keywords&lt;/code&gt; -&amp;gt; These are the array of strings that contain the keywords of the projects that help people discover the project&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;author&lt;/code&gt; -&amp;gt; The name of the author of the project&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;license&lt;/code&gt; -&amp;gt; the license type of the project&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A sample &lt;code&gt;package.json&lt;/code&gt; looks like this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbjer9xqufse7o4bv07e5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbjer9xqufse7o4bv07e5.png" alt="Sample package.json file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  About Package-lock.json File
&lt;/h2&gt;

&lt;p&gt;Now when you are installing the packages you may have noticed that it also creates a &lt;code&gt;package-lock.json&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;This file contains the records of actual specific versions of each package and dependencies installed on your local system&lt;/p&gt;

&lt;p&gt;This file helps us to install the exact version of the packages and dependencies despite any update in version in between the phase when the file was created and when it was installed locally.&lt;/p&gt;

&lt;p&gt;This is the main function that this file performs&lt;/p&gt;

&lt;p&gt;Apart from this, &lt;strong&gt;It speeds up the installation process&lt;/strong&gt; -&amp;gt; without the &lt;code&gt;package-lock.json&lt;/code&gt; file before installing npm has to request the registry for each package to see if there are new versions available.&lt;/p&gt;

&lt;p&gt;With &lt;code&gt;package-lock.json&lt;/code&gt; npm knows the exact version to install and thus it speeds up the installation process&lt;/p&gt;

&lt;p&gt;These were the basic usage of the &lt;code&gt;package.json&lt;/code&gt; file and the &lt;code&gt;package-lock.json&lt;/code&gt; file&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This was all we needed to know about NPM Packages to have a basic clear understanding.&lt;/p&gt;

&lt;p&gt;I hope I made it simple for all.&lt;/p&gt;

&lt;p&gt;If you found this blog useful and insightful, share it and comment down your views on it.&lt;/p&gt;

&lt;p&gt;Do follow for more such content.&lt;/p&gt;

&lt;p&gt;Here's how you can connect with me.&lt;/p&gt;

&lt;p&gt;Email - &lt;a href="http://olibhiag@gmail.com" rel="noopener noreferrer"&gt;olibhia0712@gmail.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Socials: &lt;a href="https://twitter.com/OlibhiaGhosh" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; , &lt;a href="https://www.linkedin.com/in/olibhiaghosh/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; and &lt;a href="https://github.com/OlibhiaGhosh" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for giving it a read !!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4c7swvcuca3i9km67dz4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4c7swvcuca3i9km67dz4.png" alt="Thank you"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>node</category>
    </item>
    <item>
      <title>How To Make A Background Color Switcher Project Using JavaScript?</title>
      <dc:creator>Olibhia Ghosh</dc:creator>
      <pubDate>Sun, 28 Apr 2024 11:09:44 +0000</pubDate>
      <link>https://dev.to/olibhiaghosh/how-to-make-a-background-color-switcher-project-using-javascript-c7j</link>
      <guid>https://dev.to/olibhiaghosh/how-to-make-a-background-color-switcher-project-using-javascript-c7j</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;For the last few months, I have been learning HTML, Tailwind CSS, and JavaScript.&lt;/p&gt;

&lt;p&gt;So, I thought of building a project with these to improve my DOM manipulation concepts&lt;/p&gt;

&lt;p&gt;In this article, I will be sharing how I made a Background Color Switcher Project&lt;/p&gt;

&lt;p&gt;Let's dive into it !!&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;The Tech Stack I used for building this project is :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;HTML&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tailwind CSS&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JavaScript (Specifically DOM Manipulation)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Project Overview
&lt;/h2&gt;

&lt;p&gt;So, Let's see what is this project all about.&lt;/p&gt;

&lt;p&gt;A Background Color Switcher&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx14gbcgcpven2oiwt0h1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx14gbcgcpven2oiwt0h1.png" alt="Bg color switcher" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This project is a background color switcher in which there are multiple color options available (refer to the above image). Here if u click on any of the colors it will get applied to the background.&lt;/p&gt;

&lt;p&gt;I did this using the basic concepts of DOM Manipulation in JavaScript.&lt;/p&gt;

&lt;p&gt;Now let's start building the project together.&lt;/p&gt;

&lt;p&gt;The project will be done in 3 steps :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Setting up HTML Structure&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Styling it with Tailwind CSS&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Adding functionalities using JavaScript&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now let's understand each of the steps in details.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up the HTML Structure
&lt;/h2&gt;

&lt;p&gt;At first, we will be setting up the HTML Structure, and for that, we will be creating two &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;s, One containing the text "&lt;strong&gt;Select The Color You Want To Apply To The Background&lt;/strong&gt;" and the other containing multiple color boxes.&lt;/p&gt;

&lt;p&gt;In the second &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; we will create four other &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;s that are the color boxes with the respective color class as their ids.&lt;/p&gt;

&lt;p&gt;Here's have a look at it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;Select The Color You Want To Apply To The Background&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt; 
        &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt; &lt;span class="c"&gt;&amp;lt;!-- Extra div --&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You must be wondering why we have added the extra &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; under the second main &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; (check the above code)&lt;/p&gt;

&lt;p&gt;We will be looking into this in the following sections.&lt;/p&gt;

&lt;p&gt;So, that was all about creating the HTML structure.&lt;/p&gt;

&lt;p&gt;Now let's add styles to this HTML Page using Tailwind CSS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Styling with Tailwind CSS
&lt;/h2&gt;

&lt;p&gt;Now we will add basic styling to our HTML Page&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We will start with adding font style, font weight, and basic padding to the heading.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"font-bold text-2xl text-center pt-20 pb-8 sm:pt-28 sm:text-3xl xl:text-4xl xl:pt-48"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
Select The Color You Want To Apply To The Background&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Then we will add the required border, background color, width, and height to the color containers.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We will also add an &lt;code&gt;id&lt;/code&gt; to all the color containers and in this example we have kept it the same as its color class&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt; &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"flex flex-col space-y-5 justify-center items-center pb-10 md:flex-row md:space-x-8 xl:space-x-12"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt; &lt;span class="c"&gt;&amp;lt;!-- Extra div --&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"border-black border-2 w-48 h-48 bg-red-600 button"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"bg-red-600"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"border-black border-2 w-48 h-48 bg-blue-700 button"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"bg-blue-700"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"border-black border-2 w-48 h-48 bg-yellow-500 button"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"bg-yellow-500"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"border-black border-2 w-48 h-48 bg-white button"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"bg-white"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's get into the use of the extra &lt;code&gt;div&lt;/code&gt; (Check the above code)&lt;/p&gt;

&lt;p&gt;We have used the extra div to align the color containers at the same level so that the &lt;code&gt;space-y-5&lt;/code&gt; or &lt;code&gt;space-x-8&lt;/code&gt; property works properly as this property is applied only in between the elements not at the starting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding Functionality with JavaScript
&lt;/h2&gt;

&lt;p&gt;We all know that functionality can be added to the project using a &lt;code&gt;script&lt;/code&gt; tag (which contains the JS code) within the &lt;code&gt;body&lt;/code&gt; tag.&lt;/p&gt;

&lt;p&gt;Now let's add the required functionality step by step.&lt;/p&gt;

&lt;p&gt;Firstly we will select the color containers using their &lt;code&gt;class="button"&lt;/code&gt; and the body element on which the color is going to be added using query selectors.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="nx"&gt;buttons&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.button&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
 &lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;body&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We need to run a loop on the &lt;code&gt;buttons&lt;/code&gt; thus fetching one color container at a time.&lt;/p&gt;

&lt;p&gt;Now we will add an event listener on the selected color container that will specify its work upon clicking on it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;buttons&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="c1"&gt;//Code to be executed on clicking&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's define the &lt;code&gt;function(e)&lt;/code&gt; which contains the main code to be executed on clicking on the color container.&lt;/p&gt;

&lt;p&gt;Inside the function, at first, we call a function named &lt;code&gt;removebg&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It will take the body element as the argument and will remove any existing &lt;code&gt;bg-color&lt;/code&gt; class from the class list of the body element&lt;/p&gt;

&lt;p&gt;We did it so that on clicking on a new color container new class can be added to the class list thus giving the body a new background color every time&lt;/p&gt;

&lt;p&gt;We will be defining this &lt;code&gt;removebg&lt;/code&gt; function &lt;strong&gt;further.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After calling the &lt;code&gt;removebg&lt;/code&gt; function any existing &lt;code&gt;bg-color&lt;/code&gt; class will get removed from the class list.&lt;/p&gt;

&lt;p&gt;Then we will add the required color class (which is present in each element's id) in the body element's class list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;buttons&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="c1"&gt;//console.log(button);&lt;/span&gt;
        &lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
            &lt;span class="nf"&gt;removebg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// remove bg color from target element&lt;/span&gt;
            &lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;   &lt;span class="c1"&gt;//Add the required bg colour&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the last part that remains is to define the &lt;code&gt;removebg&lt;/code&gt; function.&lt;/p&gt;

&lt;p&gt;This function will accept the body element as a parameter which is stored in the variable &lt;code&gt;sourceElement&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Next, we will define a variable &lt;code&gt;sourceClasses&lt;/code&gt; that makes an array out of the classes present in the &lt;code&gt;sourceElement&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After that, we will run a loop on the array &lt;code&gt;sourceClasses&lt;/code&gt; selecting each class, checking whether the class name starts with "bg-" and if that matches then we will remove it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;removebg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sourceElement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sourceClasses&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sourceElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="nx"&gt;sourceClasses&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;bg-&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// check if class has any background color class&lt;/span&gt;
                  &lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// remove bg color from target element&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
       &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And with that, we have successfully built a background color switcher.&lt;/p&gt;

&lt;p&gt;The link to the GitHub repository containing the whole code and the project website link is attached at the end for your reference.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing the Project
&lt;/h2&gt;

&lt;p&gt;After the code completion, I ran it locally using the npm package and then also deployed the project using Vercel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Here's a preview of my project:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://olibhia-bg-color-switcher.vercel.app/"&gt;https://olibhia-bg-color-switcher.vercel.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Here's the GitHub Repository containing the whole code:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;[&lt;a href="https://github.com/OlibhiaGhosh/Web_Dev_Project1.0"&gt;https://github.com/OlibhiaGhosh/Web_Dev_Project1.0&lt;/a&gt;] &lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;That was all about the code of this project.&lt;/p&gt;

&lt;p&gt;I hope I made it simple for all.&lt;/p&gt;

&lt;p&gt;If you found this blog useful and insightful, share it and comment down your views on it.&lt;/p&gt;

&lt;p&gt;Do follow for more such content.&lt;/p&gt;

&lt;p&gt;Here's how you can connect with me.&lt;/p&gt;

&lt;p&gt;Email - &lt;a href="http://olibhiag@gmail.com"&gt;olibhia0712@gmail.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Socials: &lt;a href="https://twitter.com/OlibhiaGhosh"&gt;&amp;lt;Twitter&amp;gt;&lt;/a&gt; &lt;br&gt;
 &lt;a href="https://www.linkedin.com/in/olibhiaghosh/"&gt;&amp;lt;LinkedIn&amp;gt;&lt;/a&gt; &lt;br&gt;
 &lt;a href="https://github.com/OlibhiaGhosh"&gt;&amp;lt;GitHub&amp;gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for giving it a read !!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzhals03gm3kd89wdjir9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzhals03gm3kd89wdjir9.png" alt="Thank You" width="707" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>All about JavaScript Execution Context</title>
      <dc:creator>Olibhia Ghosh</dc:creator>
      <pubDate>Tue, 12 Mar 2024 09:22:27 +0000</pubDate>
      <link>https://dev.to/olibhiaghosh/all-about-javascript-execution-context-1nc6</link>
      <guid>https://dev.to/olibhiaghosh/all-about-javascript-execution-context-1nc6</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;JavaScript is a single-threaded, popular, and commonly used programming language. So, besides coding in JavaScript, we should know how the code runs internally. In this article, we will be looking through the steps and understand the internal code execution in JavaScript.&lt;/p&gt;

&lt;p&gt;So, let's dive into it!!&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Execution Context?
&lt;/h2&gt;

&lt;p&gt;Execution context is a fundamental topic in JavaScript which refers to the scope or environment in which the JavaScript code is evaluated and executed.&lt;/p&gt;

&lt;p&gt;Whenever any code runs in JavaScript it runs inside the execution context.&lt;/p&gt;

&lt;h2&gt;
  
  
  Its Importance
&lt;/h2&gt;

&lt;p&gt;Understanding the execution context is important as it helps us to understand the variable accessibility(i.e. the scope of the variables in the code), the value of &lt;strong&gt;&lt;em&gt;'this'&lt;/em&gt;&lt;/strong&gt; keyword which is often misunderstood, and the concept of Hoisting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of execution context
&lt;/h2&gt;

&lt;p&gt;There are three types of execution context&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Global Execution Context&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Function Execution Context&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Eval Function Execution Context&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let's dive into the main content and look into the creation of execution context.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creation of Execution Context
&lt;/h2&gt;

&lt;p&gt;When a code is run in JavaScript, at first a global execution context is created. The global execution context is allocated to 'this' variable.&lt;/p&gt;

&lt;p&gt;After that, the creation of the execution context consists of two phases: &lt;strong&gt;The Creation phase&lt;/strong&gt; and the &lt;strong&gt;Code Execution Phase.&lt;/strong&gt; The JS code runs in two phases&lt;/p&gt;

&lt;p&gt;Not clear enough?&lt;/p&gt;

&lt;p&gt;Let's understand these phases and the whole process of code execution through an example and diagrams.&lt;/p&gt;

&lt;p&gt;Let's have a look at a simple code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;num1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;num2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;product&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;val1&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;val2&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;ans&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;val1&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nx"&gt;val2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;product&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num1&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;num2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While running the code, at first a global execution context is created which is referred to &lt;code&gt;this&lt;/code&gt; variable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In the browser, the value of this is the "window" object.&lt;/strong&gt; All the further execution contexts are created inside this Global execution context.&lt;/p&gt;

&lt;p&gt;As JavaScript is a &lt;strong&gt;single-threaded language&lt;/strong&gt;, everything inside it works in a definite process.&lt;/p&gt;

&lt;p&gt;Now after the creation of the Global execution context, the code execution takes place.&lt;/p&gt;

&lt;p&gt;In JS, the code execution takes place in two steps, the first is the memory creation phase in which the variables are declared and allocated memory. The second one is the code execution phase in which the variables are assigned their value and the code is run line by line.&lt;/p&gt;

&lt;h3&gt;
  
  
  Memory Creation Phase
&lt;/h3&gt;

&lt;p&gt;In this phase, declaration and memory allocation of variables take place within the execution context but are not initialized or assigned any value.&lt;/p&gt;

&lt;p&gt;In the above example, in the memory creation phase at first variables &lt;code&gt;num1&lt;/code&gt; and then &lt;code&gt;num2&lt;/code&gt; are declared which is initialized with the value &lt;code&gt;undefined&lt;/code&gt;. After that, the function &lt;code&gt;product&lt;/code&gt; is declared which contains the function definition, and lastly, the variable &lt;code&gt;result&lt;/code&gt; is declared which contains the value &lt;code&gt;undefined&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here comes the concept of &lt;strong&gt;"Hoisting"&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Hoisting is a JS mechanism where variables and function declarations are moved to the top of their containing scope in the compilation phase even before the execution of the code. Thus these variables are hoisted to the top of their scopes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffpv8lndxptk09btj4gqc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffpv8lndxptk09btj4gqc.png" alt="Image description Memory execution phase" width="800" height="692"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's look into the next phase i.e. the Execution phase.&lt;/p&gt;

&lt;h3&gt;
  
  
  Execution Phase
&lt;/h3&gt;

&lt;p&gt;After the variables are declared, the first half of execution is completed. Now here starts the code execution phase. In the execution phase all the declared variables are initialized with the values and the code is executed line by line.&lt;/p&gt;

&lt;p&gt;In the above example, during the execution phase at first &lt;code&gt;num1&lt;/code&gt; is initialized with the value i.e. &lt;code&gt;50&lt;/code&gt;, and similarly, &lt;code&gt;num2&lt;/code&gt; is initialized with &lt;code&gt;100&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Following that the function &lt;code&gt;product&lt;/code&gt; is called and for that function, a new function execution context is created consisting of a new variable environment and execution thread&lt;/p&gt;

&lt;p&gt;(Refer to the following image for better understanding).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftywics83bjc7j6vu7oj5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftywics83bjc7j6vu7oj5.png" alt="Image description Execution phase" width="786" height="525"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The function is also executed similarly in two phases inside the function execution context until it returns the value to the Global execution context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Function Execution Context&lt;/em&gt;&lt;/strong&gt;: In the memory creation phase &lt;code&gt;val1&lt;/code&gt;, &lt;code&gt;val2&lt;/code&gt;and &lt;code&gt;ans&lt;/code&gt; are declared consecutively and are initialized with &lt;code&gt;undefined&lt;/code&gt;. After that in the execution phase &lt;code&gt;val1&lt;/code&gt; is initialized with the value &lt;code&gt;50&lt;/code&gt; as &lt;code&gt;val1= num1&lt;/code&gt;. Similarly &lt;code&gt;val2= 100&lt;/code&gt; as &lt;code&gt;val2=num2&lt;/code&gt;. In the next step, ans is evaluated as &lt;code&gt;ans= val1*val2&lt;/code&gt; and assigned with the value &lt;code&gt;5000&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After it returns the value to the global execution context, the function execution context is deleted.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhmoq57odwqi9bv6rtja5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhmoq57odwqi9bv6rtja5.png" alt="Image description Function execution context" width="761" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next step the returned value by the function is assigned to the &lt;code&gt;result&lt;/code&gt; variable and the output is given. Now the execution of the code is completed. After completion, the whole execution context is destroyed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc0pv93xxf988vbh8x9pw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc0pv93xxf988vbh8x9pw.png" alt="Image description final execution context" width="758" height="536"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is also a concept called &lt;strong&gt;Call Stack.&lt;/strong&gt; It is a mechanism that keeps track of the functions being called, which are being executed, and which are in queue to be executed one after another.&lt;/p&gt;

&lt;p&gt;It follows the LIFO principle (i.e. Last In First Out principle). The function called at the last is added to the top of the list and after its execution, it is popped out.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;That was all about how code is executed in JavaScript.&lt;/p&gt;

&lt;p&gt;I hope I was able to clear the process of code execution more simply.&lt;/p&gt;

&lt;p&gt;If you found this blog useful and insightful, share it and comment down your views on it. Do follow for more such content.&lt;/p&gt;

&lt;p&gt;Here's how you can connect with me.&lt;/p&gt;

&lt;p&gt;Email - &lt;a href="http://olibhiag@gmail.com"&gt;olibhiag@gmail.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Socials: &lt;a href="https://twitter.com/OlibhiaGhosh"&gt;&amp;lt;Twitter&amp;gt;&lt;/a&gt;&lt;a href="https://www.linkedin.com/in/olibhiaghosh/"&gt;&amp;lt;LinkedIn&amp;gt;&lt;/a&gt;&lt;a href="https://github.com/OlibhiaGhosh"&gt;&amp;lt;GitHub&amp;gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for giving it a read !!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwaly29s4arp8rjmmnecb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwaly29s4arp8rjmmnecb.png" alt="Image description Thank You" width="707" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>frontend</category>
    </item>
    <item>
      <title>The Importance Of Documentation</title>
      <dc:creator>Olibhia Ghosh</dc:creator>
      <pubDate>Wed, 06 Mar 2024 20:46:15 +0000</pubDate>
      <link>https://dev.to/olibhiaghosh/the-importance-of-documentation-527m</link>
      <guid>https://dev.to/olibhiaghosh/the-importance-of-documentation-527m</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;These days nobody prefers any project or code that is not well-documented. In a project, documentation increases readability, guides the user to get a clear idea about the project, and also helps a developer to understand it well and work on it. So, here I am with the key points and tips for writing documentation.&lt;/p&gt;

&lt;p&gt;Let's dive into it !!&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens when you come across a project without proper documentation?
&lt;/h2&gt;

&lt;p&gt;Suppose, You're a new developer on a large project, and you dived into it with full enthusiasm and excitement to find yourself surrounded by complex functions, and big lines of code that you need to analyze as a whole to understand and work on.&lt;/p&gt;

&lt;p&gt;This is the problem that we, developers face when we get a project without proper documentation. And that's where &lt;strong&gt;documentation&lt;/strong&gt; plays a crucial role in making it more accessible to the users.&lt;/p&gt;

&lt;p&gt;In the next section let's explore how documentation helps us.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1555066931-4365d14bab8c%3Fq%3D80%26w%3D1000%26auto%3Dformat%26fit%3Dcrop%26ixlib%3Drb-4.0.3%26ixid%3DM3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%253D%253D%2520align%3D" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1555066931-4365d14bab8c%3Fq%3D80%26w%3D1000%26auto%3Dformat%26fit%3Dcrop%26ixlib%3Drb-4.0.3%26ixid%3DM3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%253D%253D%2520align%3D" alt="turned-on MacBook Pro wit programming codes display"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why Documentation is Your Coding BFF?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Here are some points on how documentation helps us.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Increased productivity:&lt;/strong&gt; Clear Documentation helps to understand a project easily. Thus investing minimal time in understanding and analyzing it saves time and energy&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Improved collaboration:&lt;/strong&gt; Proper documentation helps in better communication within your team. It keeps everyone on the same page making the project workflow smoother.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Easier maintenance and updates:&lt;/strong&gt; When we understand the code, fixing bugs and adding features becomes easy. Documentation acts as a roadmap, guiding us through every part of the project. And thus it makes it easy for the maintainer to maintain the code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reusable code:&lt;/strong&gt; Well-documented code is easier to reuse, which saves our time and effort.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now you have an idea of why documentation is crucial for any project. But here comes the real question, how do you make your documentation more interactive, user-friendly, and useful?&lt;/p&gt;

&lt;p&gt;Let's look at some of the tips for making documentation.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Tips for Top-Notch Documentation&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Here are some of the tips for writing interactive and useful documentation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Start early and stay consistent:&lt;/strong&gt; Don't wait until the code's finished to document it. Document the code throughout the whole process of writing the code and be consistent in that.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Write for your audience:&lt;/strong&gt; Consider who will be reading the documentation. Are they coders or newbies? Modify your language and explanations accordingly. Your documentation should be user-oriented.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Structuring the documentation:&lt;/strong&gt; Use headings, subheadings, and bullet points to break down information into digestible chunks. Nobody likes a wall of text, not even programmers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Adding all actions:&lt;/strong&gt; Add all the commands your product uses in your documentation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Adding some important elements:&lt;/strong&gt; It always serves as +1 if you add a table of contents, terminologies associated with your project, installation process, and tutorials.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Adding a search button&lt;/strong&gt; makes it more customizable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Adding Examples:&lt;/strong&gt; Illustrate your explanations with code snippets and diagrams. A picture (or code) is truly worth a thousand words. This also makes your documentation interactive.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Keep it concise and clear:&lt;/strong&gt; Avoid overly technical terms. It should be easy enough to understand by users, developers, or programmers.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here have a look at one of my tweets on documentation:&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1744577238945890304-229" src="https://platform.twitter.com/embed/Tweet.html?id=1744577238945890304"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1744577238945890304-229');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1744577238945890304&amp;amp;theme=dark"
  }



. &lt;/p&gt;

&lt;p&gt;Now here after following the tips we are ready with presentable documentation. Finally to give an ultra edge to the documentation here are some of the key points.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Points to Keep in Mind:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Focus on the "why" as much as the "what." Explain the purpose and reasoning behind your code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There are plenty of documentation tools available, from simple Markdown editors to API generators. Find one that fits your workflow and use it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Be clear about the user goals and learning objectives (intellectual goals). To achieve user goals you must take care of some learning objectives.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Write your docs as code as editing code is easier.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Most importantly, &lt;strong&gt;have fun!&lt;/strong&gt; Inject your personality and passion into your words, and you might create documentation that people enjoy reading.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Remember,&lt;/strong&gt; to keep your documentation updated because that is the entry point of your project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Also&lt;/strong&gt; don't forget to add pictures, GIFs, or even fun facts to your documentation. A little visual flair can go a long way in keeping your readers engaged.&lt;/p&gt;

&lt;p&gt;If you found this blog useful and insightful, do consider sharing this blog and comment down your views on it. Do follow for more such content.&lt;/p&gt;

&lt;p&gt;Here's how you can connect with me.&lt;/p&gt;

&lt;p&gt;Email - &lt;a href="http://olibhiag@gmail.com" rel="noopener noreferrer"&gt;olibhiag@gmail.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Socials: &lt;a href="https://twitter.com/OlibhiaGhosh" rel="noopener noreferrer"&gt;&amp;lt;Twitter&amp;gt;&lt;/a&gt;&lt;a href="https://www.linkedin.com/in/olibhiaghosh/" rel="noopener noreferrer"&gt;&amp;lt;LinkedIn&amp;gt;&lt;/a&gt;&lt;a href="https://github.com/OlibhiaGhosh" rel="noopener noreferrer"&gt;&amp;lt;GitHub&amp;gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for giving it a read !!&lt;/p&gt;

&lt;p&gt;Wish you a happy journey for your coding and documenting.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1549032305-e816fabf0dd2%3Fq%3D80%26w%3D1000%26auto%3Dformat%26fit%3Dcrop%26ixlib%3Drb-4.0.3%26ixid%3DM3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%253D%253D%2520align%3D" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1549032305-e816fabf0dd2%3Fq%3D80%26w%3D1000%26auto%3Dformat%26fit%3Dcrop%26ixlib%3Drb-4.0.3%26ixid%3DM3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%253D%253D%2520align%3D" alt="thanks! paper and black pen on wood surface"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>My First 3 Months In Tech</title>
      <dc:creator>Olibhia Ghosh</dc:creator>
      <pubDate>Mon, 04 Mar 2024 16:27:58 +0000</pubDate>
      <link>https://dev.to/olibhiaghosh/my-first-3-months-in-tech-5fbb</link>
      <guid>https://dev.to/olibhiaghosh/my-first-3-months-in-tech-5fbb</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Just a few months ago i.e. in the mid of September, I got into the University to pursue my BTech degree in Computer Science and Engineering. Soon I got introduced to the Tech world and started my Tech journey in October. Previously I had basic knowledge of Python and a proper knowledge of MySQL.&lt;/p&gt;

&lt;p&gt;So here I am to share my journey and experience with you all with the hope that it might help others too. So let's dive into it !!&lt;/p&gt;

&lt;h2&gt;
  
  
  The Tech Journey
&lt;/h2&gt;

&lt;h2&gt;
  
  
  October, 2023
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Week 1
&lt;/h3&gt;

&lt;p&gt;Seniors in our college started taking tech sessions to help us grow and with their help, I started learning GitHub. Also started with C language. Grateful to our seniors(&lt;a class="mentioned-user" href="https://dev.to/arindam_1729"&gt;@arindam_1729&lt;/a&gt; ) and (&lt;a class="mentioned-user" href="https://dev.to/swapnoneel123"&gt;@swapnoneel123&lt;/a&gt; ) for giving the much-needed guidance and that ultra edge in this tech world through their sessions.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Week 2&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Continued exploring Github. Also started with web development following the Sigma Web Development Course, a free course on YouTube by Code with Harry. I learned many things in this course like Basic HTML tags, inline and block elements, and HTML lists.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1714698623307706458-696" src="https://platform.twitter.com/embed/Tweet.html?id=1714698623307706458"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1714698623307706458-696');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1714698623307706458&amp;amp;theme=dark"
  }



. &lt;/p&gt;

&lt;h3&gt;
  
  
  Week 3
&lt;/h3&gt;

&lt;p&gt;Learned more topics in HTML like HTML tables, HTML Forms, HTML elements, and HTML Media. And yeah also contributed to a repository named Makaut Buddy on Git Hub.&lt;/p&gt;

&lt;h3&gt;
  
  
  Week 4
&lt;/h3&gt;

&lt;p&gt;Finally, I completed the whole HTML part (covered miscellaneous tags in HTML) as it was easy to learn. And then proceeded to learn CSS. Nothing much was done as I needed to focus on academics for my CA exams.&lt;/p&gt;

&lt;h2&gt;
  
  
  November,2023
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Week 1
&lt;/h3&gt;

&lt;p&gt;Continued contributing to the repository on GitHub. Also got introduced to LeetCode in the sessions by our seniors. Also kept on learning CSS.&lt;/p&gt;

&lt;p&gt;GitHub repository link: &lt;a href="https://github.com/Arindam200/makaut_buddy"&gt;https://github.com/Arindam200/makaut_buddy&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Week 2
&lt;/h3&gt;

&lt;p&gt;This week I took the most crucial decision of leaving C language and shifted to JAVA. Yeah, I made the mistake of starting with C and soon after taking some advice I realized that it is far better to go with JAVA for DSA and I shifted to JAVA and started learning it. The resource I followed for learning JAVA is mentioned in the following tweet.&lt;/p&gt;

&lt;p&gt;I got to learn many things in this JAVA course like Variables and Datatypes, Conditional, loops and Switch Statements, Functions(Methods), Scope, and Shadowing. Also solved 1 LeetCode problem in JAVA.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1724303423103975748-317" src="https://platform.twitter.com/embed/Tweet.html?id=1724303423103975748"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1724303423103975748-317');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1724303423103975748&amp;amp;theme=dark"
  }



. &lt;/p&gt;

&lt;h3&gt;
  
  
  Week 3
&lt;/h3&gt;

&lt;p&gt;Continued learning JAVA. Also made contributions to the GitHub repository makaut_buddy. This week I started a new project in collaboration with college batchmates.&lt;/p&gt;

&lt;p&gt;Got to know about more topics in JAVA like Arrays and Array lists which include 1D arrays, multidimensional arrays, dynamic arrays, etc.&lt;/p&gt;

&lt;p&gt;Yaa also solved 5 LeetCode problems in JAVA.&lt;/p&gt;

&lt;h3&gt;
  
  
  Week 4
&lt;/h3&gt;

&lt;p&gt;Attended a JCON event. A huge thanks to my seniors who arranged the tickets for us. Continued learning in JAVA (learned binary search, solved leet code problems on arrays and linear search). Also learned CSS( Selectors, different properties, and elements).&lt;/p&gt;

&lt;p&gt;Most importantly made my first Open Source Contribution(non-technical) under Keploy.&lt;/p&gt;

&lt;h2&gt;
  
  
  December,2023
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Week 1
&lt;/h3&gt;

&lt;p&gt;Started this month by practicing DSA on LeetCode on binary search. Got to learn about CSS box models. For the first time, I created a login page using HTML and the basics of CSS. Also learned how to deploy the projects.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1731691261336138205-840" src="https://platform.twitter.com/embed/Tweet.html?id=1731691261336138205"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1731691261336138205-840');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1731691261336138205&amp;amp;theme=dark"
  }



. &lt;/p&gt;

&lt;h3&gt;
  
  
  Week 2
&lt;/h3&gt;

&lt;p&gt;This week I continued learning Bubble sort, selection sort, and insertion sort in JAVA. Practiced questions on Binary search. Learned CSS(Fonts and colors, specificity and cascade, sizing units, Shadows and outlines, styling lists, overflow property, CSS positions). Had to focus on academics due to college CA exams.&lt;/p&gt;

&lt;h3&gt;
  
  
  Week 3
&lt;/h3&gt;

&lt;p&gt;Continued learning CSS (Variables, media queries, float, clear, flexbox, Grid, Transform, Transition, Animation, Object fit and object cover, CSS filters ) and in DSA learned binary search in 2D Arrays.&lt;/p&gt;

&lt;h3&gt;
  
  
  Week 4
&lt;/h3&gt;

&lt;p&gt;This week I learned the basics of Figma and how to use it. Also revised HTML and CSS through practical application. Also, made a sign-in and sign-up page, a part of a project in collaboration with college friends. Also worked on other small parts.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1739919189744488784-535" src="https://platform.twitter.com/embed/Tweet.html?id=1739919189744488784"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1739919189744488784-535');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1739919189744488784&amp;amp;theme=dark"
  }



. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnjpobu7fg7w4f4c72gc5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnjpobu7fg7w4f4c72gc5.png" alt="Image description Sign in and Sign up page" width="632" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This was all about my journey till now. From being unaware of this technical world to being a part of it was a wonderful experience. But to be very honest my journey could have been more better if I hadn't invested so much time in HTML and learned the technologies at a greater pace. Concluding on an optimistic note, in the upcoming days, I plan to complete DSA in JAVA, learn full-stack web development, make more open-source contributions, explore various domains, and take forward the legacy started by our seniors of creating a technical community, and make our contributions towards this tech community.&lt;/p&gt;

&lt;p&gt;If you found this blog useful and insightful, do consider sharing this blog and comment down your views on it. Do follow for more such content.&lt;/p&gt;

&lt;p&gt;Here's how you can connect with me.&lt;/p&gt;

&lt;p&gt;Email - &lt;a href="http://olibhiag@gmail.com/"&gt;&lt;strong&gt;olibhiag@gmail.com&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Socials: &lt;a href="https://twitter.com/OlibhiaGhosh"&gt;&lt;strong&gt;&amp;lt;Twitter&amp;gt;&lt;/strong&gt;&lt;/a&gt;&lt;a href="https://www.linkedin.com/in/olibhiaghosh/"&gt;&lt;strong&gt;&amp;lt;LinkedIn&amp;gt;&lt;/strong&gt;&lt;/a&gt;&lt;a href="https://github.com/OlibhiaGhosh"&gt;&lt;strong&gt;&amp;lt;GitHub&amp;gt;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for giving it a read !!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdeml177nlmv0dwk5k222.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdeml177nlmv0dwk5k222.png" alt="Image description Thank You" width="707" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>productivity</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
