<?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: Jeeva Ramanathan</title>
    <description>The latest articles on DEV Community by Jeeva Ramanathan (@jeevaramanathan).</description>
    <link>https://dev.to/jeevaramanathan</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%2F823761%2Ffac97f9f-b0b2-4c4e-9c29-b33870c9d845.jpeg</url>
      <title>DEV Community: Jeeva Ramanathan</title>
      <link>https://dev.to/jeevaramanathan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jeevaramanathan"/>
    <language>en</language>
    <item>
      <title>Effortless Full Stack Development: Set Up Django-React Application with One Command Using Daytona</title>
      <dc:creator>Jeeva Ramanathan</dc:creator>
      <pubDate>Fri, 10 Jan 2025 11:48:36 +0000</pubDate>
      <link>https://dev.to/jeevaramanathan/effortless-development-with-daytona-setting-up-django-react-full-stack-application-in-a-single-1f06</link>
      <guid>https://dev.to/jeevaramanathan/effortless-development-with-daytona-setting-up-django-react-full-stack-application-in-a-single-1f06</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Don't be stuck at dev environment setup&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Setting up both the frontend and backend for a Django-React full stack project can be a daunting and time-consuming task.  You'll need to install the frontend dependencies, set up the backend separately, and manage migrations. But what if you could configure everything with just one command?&lt;/p&gt;

&lt;p&gt;This is where &lt;a href="https://www.daytona.io/" rel="noopener noreferrer"&gt;Daytona&lt;/a&gt; comes into play. Daytona simplifies the development environment setup, allowing you to focus on building your application rather than wrestling with configurations.&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%2Fnkxpgrdffqff2qee2r35.jpg" 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%2Fnkxpgrdffqff2qee2r35.jpg" alt="Image description" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this blog, we’ll take a step-by-step approach:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Setting up a Django - React with Vite full stack project

&lt;ul&gt;
&lt;li&gt;Use a sample Django-React full stack repository to get started.&lt;/li&gt;
&lt;li&gt;Create a &lt;code&gt;devcontainer.json&lt;/code&gt; and test it locally&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;What is Daytona, and why to use it?

&lt;ul&gt;
&lt;li&gt;Explore Daytona’s purpose and key benefits.&lt;/li&gt;
&lt;li&gt;Learn how to setup and integrate Daytona into your project.&lt;/li&gt;
&lt;li&gt;Managing environment variables&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Setting Up a Django - React with Vite Full Stack Project
&lt;/h1&gt;

&lt;p&gt;We’ll use the Django-React Full Stack App from &lt;a href="https://github.com/techwithtim/Django-React-Full-Stack-App" rel="noopener noreferrer"&gt;this repository&lt;/a&gt; as an example.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;li&gt;VS Code (or any IDE based on your project tech stack)&lt;/li&gt;
&lt;li&gt;Git&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;1️⃣ Clone the Sample Repository&lt;br&gt;
Fork the &lt;a href="https://github.com/techwithtim/Django-React-Full-Stack-App" rel="noopener noreferrer"&gt;repository&lt;/a&gt; and run the following commands to clone the repository in your system and navigate into the project folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/&amp;lt;user_name&amp;gt;/Django-React-Full-Stack-App.git
cd Django-React-Full-Stack-App
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the project folder structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;root/
│
├── frontend/
│   └── (Your React + Vite frontend code)
│
├── backend/
│   └── (Your Django backend code)
│
└── .devcontainer/
    └── devcontainer.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2️⃣ Creating devcontainer&lt;br&gt;
Create a &lt;code&gt;.devcontainer&lt;/code&gt; folder in the project root and add the &lt;code&gt;devcontainer.json&lt;/code&gt;. &lt;code&gt;(.devcontainer/devcontainer.json)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;A &lt;code&gt;devcontainer.json&lt;/code&gt; file is essential for defining the environment in your VS Code Remote Development setup, specifying everything from the required programming languages to runtime tools and dependencies.&lt;/p&gt;

&lt;p&gt;Using a &lt;code&gt;devcontainer.json&lt;/code&gt; ensures a uniform development environment across all systems, streamlining the processes of development, testing, and debugging.&lt;/p&gt;

&lt;p&gt;With Daytona's built-in support for Dev Containers, setting up a complete development environment with all the tools and libraries you need becomes quick and effortless.&lt;/p&gt;

&lt;p&gt;Let's add &lt;code&gt;devcontainer.json&lt;/code&gt; for our project as below. You can also use &lt;a href="//devcontainer.ai"&gt;devcontainer.ai&lt;/a&gt; to quickly generate this file by providing the repository URL, with the help of AI. This will automatically create a &lt;code&gt;devcontainer.json&lt;/code&gt; tailored to your project needs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Django-React Full Stack App"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; 
  &lt;/span&gt;&lt;span class="nl"&gt;"image"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"mcr.microsoft.com/devcontainers/python:3.12-bookworm"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"forwardPorts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;8000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5173&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"features"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ghcr.io/devcontainers/features/node:1"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"18"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"postCreateCommand"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npm install --prefix frontend &amp;amp;&amp;amp; pip install -r backend/requirements.txt &amp;amp;&amp;amp; python backend/manage.py makemigrations &amp;amp;&amp;amp; python backend/manage.py migrate"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"remoteUser"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"vscode"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's break down the &lt;code&gt;devcontainer.json&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;name:&lt;/strong&gt; Specifies the name of the dev container. You can set it to any value that describes the project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;image:&lt;/strong&gt; Defines the Docker image to be used for the container. In this case, it's &lt;code&gt;mcr.microsoft.com/devcontainers/python:3.12-bookworm&lt;/code&gt;, which includes Python 3.12 and is based on the Debian Bookworm distribution for the backend part of the project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;forwardPorts:&lt;/strong&gt; Forwards the specified ports (8000 for Django and 5173 for React with Vite) from the container to your local machine, allowing you to access the app in your browser.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;features&lt;/strong&gt;: Installs additional features. Here, it's setting up Node.js version 18 for the frontend part of the project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;postCreateCommand:&lt;/strong&gt; Runs commands automatically after the container is created. It installs dependencies for both the frontend (React) and backend (Django), followed by applying Django migrations to set up the database.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;remoteUser:&lt;/strong&gt; Defines the user inside the container. In this case, it's set to &lt;code&gt;vscode&lt;/code&gt;, which is typically used for Visual Studio Code's remote development environments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;customizations:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"customizations": {
    "vscode": {
      "settings": {
        "python.defaultInterpreterPath": "/usr/local/bin/python",
        "python.linting.enabled": true,
        "python.linting.pylintEnabled": true
   }
 }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also configure tool-specific properties and add any additional settings specific to your development environment.&lt;br&gt;
More details can be found at &lt;a href="https://www.daytona.io/dotfiles/guide-create-devcontainer-json-file" rel="noopener noreferrer"&gt;Dev Containers&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3️⃣ Testing it locally&lt;br&gt;
Install the Dev Containers extension in VS Code, then rebuild the container:&lt;br&gt;
(If you have the Dev Containers extension installed, VS Code will prompt you to reopen the folder in the container. Accept the prompt)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ctrl+Shift+P &amp;gt; Dev Containers: Rebuild Container and Reopen in Container
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2F14eawsvn5dg5770oyzrj.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%2F14eawsvn5dg5770oyzrj.png" alt="Image description" width="720" height="56"&gt;&lt;/a&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvy2ttjdeqc0x5i7rkj42.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%2Fvy2ttjdeqc0x5i7rkj42.png" alt="Image description" width="720" height="91"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the container rebuilds without errors, you’re ready to proceed😎.&lt;/p&gt;

&lt;p&gt;4️⃣ Pushing to GitHub&lt;br&gt;
Once everything is configured and tested locally, add the changes, commit and push your code to GitHub.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push origin main  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  What is Daytona, and Why to Use It?
&lt;/h1&gt;

&lt;p&gt;Daytona is a self-hosted, secure open source development environment manager. Daytona's support for Dev Containers standard enables developers to tailor their environments to exact specifications and share configurations for efficient collaboration. It also supports multiple tech stacks and environments.&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%2Foxqd5mq84ntankx1cmfn.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%2Foxqd5mq84ntankx1cmfn.png" alt="Image description" width="800" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scalable:&lt;/strong&gt; Create multiple environments(workspaces) simultaneously, ideal for collaboration or switching between projects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexible:&lt;/strong&gt; Customize environments with  dev container files, and automation for tailored setups.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration with Popular Tools:&lt;/strong&gt; Seamlessly integrates with IDEs like VS Code, JetBrains and more for a smooth workflow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Eliminates Setup Hassles:&lt;/strong&gt; Automatically creates clean, isolated environments, removing the need to manually install dependencies or manage permissions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Anywhere Accessibility:&lt;/strong&gt; Operate from localhost or cloud providers like AWS, Azure, GCP, and Digital Ocean.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compatibility with Any Git Platform:&lt;/strong&gt; Daytona works with all major Git platforms, including GitHub, GitLab, and Bitbucket, ensuring a versatile development experience.&lt;/li&gt;
&lt;/ul&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%2F19d53upnoe768tz3gbbm.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%2F19d53upnoe768tz3gbbm.png" alt="Image description" width="800" height="179"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;In short, Daytona streamlines your development setup, making it scalable, secure, and hassle-free, so you can focus on coding with just one step to start.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;First, let's install Daytona on your local machine. Follow the instructions based on your operating system: &lt;a href="https://www.daytona.io/docs/installation/installation/" rel="noopener noreferrer"&gt;Daytona Installation Documentation&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Platform&lt;/th&gt;
&lt;th&gt;Installation Command&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Windows&lt;/td&gt;
&lt;td&gt;&lt;code&gt;$architecture = if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64") { "amd64" } else { "arm64" } md -Force "$Env:APPDATA\bin\daytona";[System.Net.ServicePointManager]::SecurityProtocol =[System.Net.SecurityProtocolType]'Tls,Tls11,Tls12'; Invoke-WebRequest -URI "https://download.daytona.io/daytona/v0.50/daytona windows-$architecture.exe" -OutFile "$Env:APPDATA\bin\daytona\daytona.exe"; $env:Path += ";" + $Env:APPDATA + "\bin\daytona"; [Environment]::SetEnvironmentVariable("Path", $env:Path,[System.EnvironmentVariableTarget]::User); daytona serve;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Linux&lt;/td&gt;
&lt;td&gt;&lt;code&gt;(curl -sf -L https://download.daytona.io/daytona/install.sh) &amp;amp;&amp;amp; daytona server -y &amp;amp;&amp;amp; daytona&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;macOS&lt;/td&gt;
&lt;td&gt;&lt;code&gt;(curl -sf -L https://download.daytona.io/daytona/install.sh) &amp;amp;&amp;amp; daytona server -y &amp;amp;&amp;amp; daytona&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Homebrew&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;brew tap daytonaio/tap&lt;/code&gt;and &lt;code&gt;brew install daytona&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nix&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nix-shell -p daytona-bin&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://github.com/daytonaio/daytona/" class="ltag_cta ltag_cta--branded" rel="noopener noreferrer"&gt;View Daytona on GitHub&lt;/a&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Configure Daytona for Your Project
&lt;/h1&gt;

&lt;p&gt;Now, let's configure Daytona for your Django-React project. This setup is a one-time effort (from 1-4) but super crucial for seamless integration.&lt;/p&gt;

&lt;p&gt;Once you've installed Daytona, run &lt;code&gt;daytona serve&lt;/code&gt;, which will start the Daytona server.&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%2F0p994wilulgpgsjddhka.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%2F0p994wilulgpgsjddhka.png" alt="Image description" width="800" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;1️⃣ Connect Your Git Provider&lt;br&gt;
You’ll want Daytona to communicate with your Git repositories (like GitHub, GitLab, BitBucket and others.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;daytona git-providers add
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Follow the prompts to authenticate with your Git provider. This will let Daytona access your repositories without needing to reauthenticate every time. 🎉&lt;/p&gt;

&lt;p&gt;2️⃣ Install a Cloud Provider &amp;amp; Set a Target Environment (Optional)&lt;/p&gt;

&lt;p&gt;Next, you’ll need a cloud provider if you're planning to deploy your application on platforms like AWS, Azure, or GCP. Run the following command to install your cloud provider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;daytona provider install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, set where you want your environment to run (e.g., Docker, AWS, GCP, Azure):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;daytona target set
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Daytona will remember your choice for next time.&lt;/p&gt;

&lt;p&gt;3️⃣ Choose Your IDE&lt;br&gt;
Finally, Daytona integrates with popular IDEs like VS Code, IntelliJ, and more. To set your default IDE:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;daytona ide
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will configure your IDE to work seamlessly with Daytona, giving you all the comfort and tools you’re used to while working in a containerized environment. Additionally, running &lt;code&gt;daytona code&lt;/code&gt; will open the code in the selected IDE.🎨&lt;/p&gt;

&lt;p&gt;4️⃣ Create Your Workspace 🛠️&lt;/p&gt;

&lt;p&gt;Your environment is all set up! Now it’s time to create the project workspace. Run the following command to create the workspace for Django-React app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;daytona create &amp;lt;REPO_URL&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case it's &lt;code&gt;https://github.com/&amp;lt;user_name&amp;gt;/Django-React-Full-Stack-App&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once you run that single command, it will create a workspace and install all the dependencies for both frontend and backend. 🚀 &lt;/p&gt;

&lt;p&gt;You’ll now have a fully configured development environment that’s ready to go. To run your project locally, run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd frontend &amp;amp;&amp;amp; npm run dev&lt;/code&gt; and cd backend &lt;code&gt;cd backend &amp;amp;&amp;amp; python manage.py runserver&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will spin up your React frontend and Django backend for local development. 💻&lt;/p&gt;

&lt;p&gt;Ready to Code! 🎉&lt;/p&gt;

&lt;p&gt;With your Git provider, cloud platform, target, and IDE set up, you’re ready to start developing! Daytona simplifies container management, version control, and cloud deployments, allowing you to focus on what matters most—coding your Django-React app. 😎&lt;/p&gt;

&lt;p&gt;No more repetitive configurations—just get in and start building. 🚀&lt;/p&gt;

&lt;h1&gt;
  
  
  Resume Work on Your Project
&lt;/h1&gt;

&lt;p&gt;If you want to work on your project again, simply run the following commands to start where you left off:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;daytona&lt;/span&gt; &lt;span class="n"&gt;serve&lt;/span&gt; &lt;span class="c1"&gt;#starts your daytona server
&lt;/span&gt;&lt;span class="n"&gt;daytona&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;your_workspace_name&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="n"&gt;daytona&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="c1"&gt;#Select the project, and Daytona will open it for you to continue coding. 
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Managing environment variables
&lt;/h1&gt;

&lt;p&gt;There are multiple ways to manage the env variables and few are below.&lt;/p&gt;

&lt;p&gt;1️⃣ Create a &lt;code&gt;.env&lt;/code&gt; File&lt;br&gt;
A simple and clean approach is to create a &lt;code&gt;.env&lt;/code&gt; file manually in your project root directory and add your environment variables to it. This ensures that the variables are loaded whenever your project runs. Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VITE_API_URL=http://localhost:8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This method is straightforward and helps you keep control over your environment variables, especially for existing workspaces.&lt;/p&gt;

&lt;p&gt;2️⃣ Set Environment Variables Using Daytona&lt;br&gt;
You can also set environment variables directly through Daytona before creating a workspace by using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;daytona set env KEY=VALUE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: It’s not recommended to use this method as you lose control over the process. The environment variables set this way will only be applied to new workspaces. Existing workspaces will not receive these variables while they are running, which could lead to inconsistency across your environment.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;3️⃣ Automatically Create &lt;code&gt;.env&lt;/code&gt; Inside the frontend Folder (Using Post-Create Command)&lt;/p&gt;

&lt;p&gt;To ensure the &lt;code&gt;.env&lt;/code&gt; file is created automatically in the frontend folder, you can add the following postCreateCommand to your configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"postCreateCommand": "bash -c 'test -f frontend/.env || touch frontend/.env'"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command checks if the &lt;code&gt;.env&lt;/code&gt; file exists in the frontend folder, and if not, it creates it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;With Daytona, you can forget about the manual setup of development environments across various tech stacks and start coding immediately. The &lt;code&gt;daytona create&lt;/code&gt; command ensures your environment is set up in no time, saving you effort and eliminating manual configurations. Daytona’s flexibility and scalability make it an invaluable tool for efficient, hassle-free development workflows, regardless of the tech stack.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Thank you for reading! Feel free to share your thoughts and opinions in the comments 😊. I hope you found this helpful! You can connect with me on &lt;a href="https://www.linkedin.com/in/jeevaramanathan/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;, &lt;a href="https://x.com/jeevaramanathan" rel="noopener noreferrer"&gt;X&lt;/a&gt;, &lt;a href="https://github.com/jeevaramanathan" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. &lt;br&gt;
Republished at &lt;a href="https://medium.com/@jeevaramanathan/effortless-development-with-daytona-setting-up-django-react-full-stack-in-a-single-command-88eff80e65eb" rel="noopener noreferrer"&gt;https://medium.com&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Few other posts to check here&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/jeevaramanathan/ai-powered-github-pull-request-tracker-for-your-hacktoberfest-and-more-fm7"&gt;AI-Powered GitHub Pull Request Tracker for Your Hacktoberfest (and More!)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/jeevaramanathan/decoding-why-06-03-08999999999999999-in-js-and-how-to-solve-640/"&gt;Decoding Why 0.6 + 0.3 = 0.8999999999999999 in JS and How to Solve?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/jeevaramanathan/hide-the-source-code-in-react-from-dev-tools-3-different-ways-5467"&gt;How to Hide the Source Code in React from Dev Tools [3 different ways]&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@jeevaramanathan/how-to-set-up-a-react-project-with-create-react-app-in-windows-4f30895daefa?source=post_page-----976a0fa01640--------------------------------" rel="noopener noreferrer"&gt;How To Create and Set Up a React Project with Create React App in Windows?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>daytona</category>
      <category>webdev</category>
      <category>django</category>
      <category>opensource</category>
    </item>
    <item>
      <title>AI-Powered GitHub Pull Request Tracker for Your Hacktoberfest (and More!)</title>
      <dc:creator>Jeeva Ramanathan</dc:creator>
      <pubDate>Wed, 09 Oct 2024 03:44:52 +0000</pubDate>
      <link>https://dev.to/jeevaramanathan/ai-powered-github-pull-request-tracker-for-your-hacktoberfest-and-more-fm7</link>
      <guid>https://dev.to/jeevaramanathan/ai-powered-github-pull-request-tracker-for-your-hacktoberfest-and-more-fm7</guid>
      <description>&lt;p&gt;&lt;em&gt;Track the status of your GitHub Pull Requests for &lt;a href="https://hacktoberfest.com/" rel="noopener noreferrer"&gt;Hacktoberfest&lt;/a&gt;, &lt;a href="https://devfest.ai/" rel="noopener noreferrer"&gt;Devfest.ai&lt;/a&gt;, &lt;a href="https://github.com/Avaiga/taipy" rel="noopener noreferrer"&gt;Taipy Hacktoberfest&lt;/a&gt; and various Open Source Contributions with AI Assistance&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This App?
&lt;/h2&gt;

&lt;p&gt;As a contributor to open source, I recently came across &lt;a href="https://github.com/copilotkit/copilotkit" rel="noopener noreferrer"&gt;CopilotKit&lt;/a&gt;. Being involved in React development for a while, I found CopilotKit &lt;em&gt;(the simplest way to integrate production-ready Copilots into any product)&lt;/em&gt; interesting.&lt;/p&gt;

&lt;p&gt;There are several open-source events happening during Hacktoberfest, including &lt;a href="https://hacktoberfest.com/" rel="noopener noreferrer"&gt;Hacktoberfest&lt;/a&gt;, &lt;a href="https://devfest.ai/" rel="noopener noreferrer"&gt;Devfest.ai&lt;/a&gt;, &lt;a href="https://github.com/Avaiga/taipy" rel="noopener noreferrer"&gt;Taipy Hacktoberfest&lt;/a&gt; and &lt;a href="https://dev.to/arindam_1729/7-open-source-events-you-can-participate-in-this-hacktoberfest-win-cool-swags-573"&gt;more&lt;/a&gt;, each with different rules. It became quite challenging to keep track of pull request statuses and identify which contribution repositories were associated with each event.  This challenge inspired me to leverage CopilotKit to create a solution that simplifies tracking and managing contributions across these events.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github-ai-pr-tracker.vercel.app/" rel="noopener noreferrer"&gt;Try the PR Tracker app here&lt;/a&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq9eqiz63ob9o5fafk7es.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%2Fq9eqiz63ob9o5fafk7es.gif" alt="Application Demo" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;user prompt&lt;/strong&gt;: Hi, I want to see the pull requests created by  jeevaramanathan for the Hacktoberfest 2024 event.&lt;br&gt;
&lt;strong&gt;assistant&lt;/strong&gt;: I've fetched the pull requests created by jeevaramanathan for the Hacktoberfest 2024 event. Is there anything else you need help with?&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It retrieves all the pull requests that come under hacktoberfest 2024 and displays on the table using copilotkit action.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;AI-Powered Assistance:&lt;/strong&gt; Get help from AI to easily track the status of pull requests for different open-source events.&lt;br&gt;
&lt;strong&gt;Event-Specific Filtering:&lt;/strong&gt; Filter pull requests by open-source events like Hacktoberfest, Devfest.&lt;br&gt;
&lt;strong&gt;Customizable Date Range:&lt;/strong&gt; Allows you to set specific date ranges to focus on contributions made during certain periods regardless of any event.&lt;br&gt;
&lt;strong&gt;Responsive Design:&lt;/strong&gt; Built with Tailwind CSS and shadcn-ui for a seamless user experience across all devices.&lt;br&gt;
&lt;strong&gt;Theme and Color Change:&lt;/strong&gt; Switch between different themes and customize colors for a personalized user experience.&lt;br&gt;
&lt;strong&gt;Sharable Links:&lt;/strong&gt; Easily generate links to highlight your pull requests or share your progress with others, making collaboration seamless.&lt;/p&gt;
&lt;h2&gt;
  
  
  Tech Stacks
&lt;/h2&gt;

&lt;p&gt;Built with Next.js (React), Tailwind CSS, ShadCN UI, Apollo Client, and CopilotKit for AI functionalities.&lt;/p&gt;
&lt;h2&gt;
  
  
  How It's Built
&lt;/h2&gt;

&lt;p&gt;I leveraged the GitHub API to retrieve details and analyzed REST endpoints and GraphQL. In this case, GraphQL was more efficient, as it allowed me to retrieve data in the structure I wanted instead of its default format.&lt;/p&gt;

&lt;p&gt;To integrate with Next.js, I used Apollo Client with the &lt;code&gt;useLazyQuery&lt;/code&gt;.  A lazy query allows you to execute a query only when needed, helping to optimize performance.&lt;/p&gt;

&lt;p&gt;After fetching the data, I filtered it based on event-specific rules. For Devfest, I parsed the &lt;a href="https://devfest.ai/repositories" rel="noopener noreferrer"&gt;devfest&lt;/a&gt; to get whitelisted repositories dynamically.&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%2Fpudj9vb7jzy1ssabne2q.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%2Fpudj9vb7jzy1ssabne2q.png" alt="Event Info" width="683" height="522"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Next comes CopilotKit
&lt;/h3&gt;

&lt;p&gt;CopilotKit provides an easy way to integrate AI capabilities into your web application. I utilized the free version of &lt;code&gt;Groq&lt;/code&gt; model, alongside the back-end component CopilotKit runtime.&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%2Fg6glwji0sx5b4r51kucq.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%2Fg6glwji0sx5b4r51kucq.png" alt="Workflow" width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's a glimpse of some of the prompts I used:&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="nf"&gt;useCopilotAction&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;setUsername&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Sets the username of the GitHub user.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;parameters&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="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;username&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;GitHub username to search for&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;required&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="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;username&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="nf"&gt;setUserName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;username&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="nf"&gt;useCopilotAction&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;setEvent&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Set the selected event to hacktoberfest, devfest, taipy event or none based on user's input&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;parameters&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="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;event&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Event name to switch to (hacktoberfest, devfest, taipy, none)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;enum&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hacktoberfest&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;devfest&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;taipy&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;none&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="na"&gt;required&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="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="na"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;event&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="nf"&gt;setSelectedEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&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;In the frontend, I utilized the &lt;code&gt;CopilotPopup&lt;/code&gt; component, providing a popup interface for interacting with the copilot by setting the initial instructions to guide copilot in retrieving details of GitHub pull requests for various events.&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="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;CopilotPopup&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@copilotkit/react-ui&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;CopilotKit&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@copilotkit/react-core&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CopilotKit&lt;/span&gt; &lt;span class="nx"&gt;runtimeUrl&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;runtimeUrl&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CopilotPopup&lt;/span&gt;
    &lt;span class="nx"&gt;instructions&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Help the user to fetch the details of github pull requests for various&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
      &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;events like hacktoberfest, devfest.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/CopilotKit&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sample prompt&lt;br&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%2Fdxsk9gika6q57ozscent.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%2Fdxsk9gika6q57ozscent.png" alt="Sample Prompt" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;If this application helps you track your pull requests, there are plans to refine it further by adding additional functionalities.&lt;/p&gt;

&lt;p&gt;If you like this project, don't forget to check out the app and the &lt;a href="https://github.com/JeevaRamanathan/github-ai-pr-tracker/" rel="noopener noreferrer"&gt;repository&lt;/a&gt;, and leave a star⭐. Contributions and feedback are always welcome if you're interested in enhancing the app! This is my first Next.js application, so it might be a bit clumsy.&lt;/p&gt;

&lt;p&gt;Feel free to try it out and share your feedback!&lt;/p&gt;

&lt;p&gt;App Link: &lt;a href="https://github-ai-pr-tracker.vercel.app/" rel="noopener noreferrer"&gt;https://github-ai-pr-tracker.vercel.app/&lt;/a&gt;&lt;br&gt;
Repository Link: &lt;a href="https://github.com/JeevaRamanathan/github-ai-pr-tracker/" rel="noopener noreferrer"&gt;https://github.com/JeevaRamanathan/github-ai-pr-tracker/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Please note that the copilot uses the free version of the model, which may occasionally lead to unexpected behaviors or slower responses. Copilot actions are being improved.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Happy Contributing 🎉&lt;/p&gt;




&lt;p&gt;&lt;em&gt;While engaging in open-source events like Hacktoberfest, exploring projects on &lt;a href="https://github.com/avaiga/taipy" rel="noopener noreferrer"&gt;Taipy&lt;/a&gt; and AI-based projects on &lt;a href="https://devfest.ai/repositories" rel="noopener noreferrer"&gt;Devfest.ai&lt;/a&gt;, and contributing to them and giving them a star could lead to valuable learning experiences and opportunities to win swags!&lt;/em&gt;&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;Thank you for reading! Feel free to share your thoughts and opinions in the comments 😊. I hope you found this helpful! You can connect with me on &lt;a href="https://www.linkedin.com/in/jeevaramanathan/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;, &lt;a href="https://x.com/jeevaramanathan" rel="noopener noreferrer"&gt;X&lt;/a&gt;, &lt;a href="https://github.com/jeevaramanathan" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. Few other posts to check here.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/jeevaramanathan/decoding-why-06-03-08999999999999999-in-js-and-how-to-solve-640/"&gt;Decoding Why 0.6 + 0.3 = 0.8999999999999999 in JS and How to Solve?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/jeevaramanathan/hide-the-source-code-in-react-from-dev-tools-3-different-ways-5467"&gt;How to Hide the Source Code in React from Dev Tools [3 different ways]&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@jeevaramanathan/how-to-set-up-a-react-project-with-create-react-app-in-windows-4f30895daefa?source=post_page-----976a0fa01640--------------------------------" rel="noopener noreferrer"&gt;How To Create and Set Up a React Project with Create React App in Windows?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>hacktoberfest</category>
      <category>webdev</category>
      <category>opensource</category>
      <category>copilotkit</category>
    </item>
    <item>
      <title>Social Resizer: Generate Perfectly-Sized Images for Every Social Platform</title>
      <dc:creator>Jeeva Ramanathan</dc:creator>
      <pubDate>Sun, 12 May 2024 18:23:52 +0000</pubDate>
      <link>https://dev.to/jeevaramanathan/social-sizer-perfectly-sized-images-for-every-social-platform-1kh3</link>
      <guid>https://dev.to/jeevaramanathan/social-sizer-perfectly-sized-images-for-every-social-platform-1kh3</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/netlify"&gt;Netlify Dynamic Site Challenge&lt;/a&gt;: Visual Feast.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Application Link: &lt;a href="https://social-resizer.netlify.app/" rel="noopener noreferrer"&gt;https://social-resizer.netlify.app/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I built a dynamic image resizer that caters to every major social media platform. The application allows users to upload images, apply custom resizing, and even adjust image colors. The highlight of this application is its ability to automatically resize images to fit the ideal dimensions for various social media platforms using netlify image CDN, ensuring your posts always look their best.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Experience the &lt;a href="https://social-resizer.netlify.app/" rel="noopener noreferrer"&gt;Social Resizer&lt;/a&gt; application here and begin resizing your images effortlessly.&lt;/p&gt;

&lt;h4&gt;
  
  
  Explore the Features:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;u&gt;Upload Your Images&lt;/u&gt;
: Start by effortlessly dragging or uploading your images to our platform.
&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%2Ftts5b6pjnoywz0qglky5.png" alt="Image description" width="800" height="418"&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;u&gt;Customize Resizing Options &amp;amp; Color Tone&lt;/u&gt;: Adjust your image dimensions with precision to meet your specific needs.  Enhance your images with a variety of color filters to match your brand or mood. Color filters are done using CSS (ImageCDN doesn't support color filters by now).&lt;/li&gt;
&lt;/ul&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%2Fom6rwtrzxtaru6pmgpl0.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%2Fom6rwtrzxtaru6pmgpl0.png" alt="Image description" width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;u&gt;Optimized for All Platforms&lt;/u&gt;: Choose the social media platform that meets your requirements, edit and enhance your image by resizing and applying color tones, then effortlessly download the optimized image for easy sharing.
&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%2F7xrkpgs7trmnquq92pxz.png" alt="Image description" width="800" height="380"&gt;
Enhance your image and download it. 🎨✨ You're all set for your post!
&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%2Fyk5wwsskon5kgxwauqjs.png" alt="Image description" width="731" height="897"&gt;
Enhanced cover photo
&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%2Fl27u61zkg5v524ts917j.png" alt="Image description" width="795" height="576"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Platform Primitives
&lt;/h2&gt;

&lt;p&gt;This application leverages the power of Netlify's &lt;code&gt;Image CDN&lt;/code&gt;. When a user uploads an image, it is stored in imagekit and processed using Image CDN. Users can then select their preferred social media platform and post type, prompting the application to generate a URL with the necessary parameters for the Netlify Image CDN to resize the image. This process happens dynamically, ensuring that the image is always perfectly sized for the chosen platform and post type. By utilizing Netlify's Image CDN, the application ensures optimal performance and efficient delivery of images, tailored to various platform sizes.&lt;/p&gt;

&lt;p&gt;Code snippet that generates url leveraging Netlify &lt;code&gt;Image CDN&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;generateImageUrl&lt;/span&gt; &lt;span class="o"&gt;=&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;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`/.netlify/images?url=&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;imageUrl&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s2"&gt;`&amp;amp;fit=&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s2"&gt;`&amp;amp;w=&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;imageSize&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s2"&gt;`&amp;amp;h=&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;imageSize&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s2"&gt;`&amp;amp;q=&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;quality&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s2"&gt;`&amp;amp;position=&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;position&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s2"&gt;`&amp;amp;fm=&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;format&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

 &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;url&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;h3&gt;
  
  
  Challenges faced
&lt;/h3&gt;

&lt;p&gt;During the initial development of the application, handling images directly and converting them to base64 format resulted in inefficiencies due to the large size of high-resolution images. This approach led to performance issues and slow load times.&lt;br&gt;
I planned to use ImageKit for storing and managing the images uploaded by users. However, I encountered several issues with this approach, particularly with server-side operations.&lt;/p&gt;

&lt;p&gt;To overcome these challenges, I switched to using &lt;code&gt;Netlify Functions&lt;/code&gt; for handling image uploads and storage. This significantly improved the application's performance, resulting in faster load times and a smoother user experience. The switch also simplified server-side operations, making the development process more efficient and allowing a focus on improving the application's core functionality.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Reference for Social Media Sizes - &lt;a href="https://blog.hootsuite.com/social-media-image-sizes-guide/" rel="noopener noreferrer"&gt;https://blog.hootsuite.com/social-media-image-sizes-guide/&lt;/a&gt; &lt;/p&gt;





&lt;p&gt;Thanks for reading. Feel free to comment your opinion😊. You can hit me up on &lt;a href="https://www.linkedin.com/in/jeevaramanathan" rel="noopener noreferrer"&gt;&lt;strong&gt;Linked In&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://github.com/jeevaramanathan/" rel="noopener noreferrer"&gt;&lt;strong&gt;Github&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://twitter.com/jeevaramanathan" rel="noopener noreferrer"&gt;&lt;strong&gt;Twitter&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;
Few other posts to check here.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/jeevaramanathan/decoding-why-06-03-08999999999999999-in-js-and-how-to-solve-640"&gt;Decoding Why 0.6 + 0.3 = 0.8999999999999999 in JS and How to Solve?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/jeevaramanathan/hide-the-source-code-in-react-from-dev-tools-3-different-ways-5467"&gt;How to Hide the Source Code in React from Dev Tools [3 different ways]&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>netlifychallenge</category>
      <category>devchallenge</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Decoding Why 0.6 + 0.3 = 0.8999999999999999 in JS and How to Solve?</title>
      <dc:creator>Jeeva Ramanathan</dc:creator>
      <pubDate>Thu, 16 Nov 2023 19:05:08 +0000</pubDate>
      <link>https://dev.to/jeevaramanathan/decoding-why-06-03-08999999999999999-in-js-and-how-to-solve-640</link>
      <guid>https://dev.to/jeevaramanathan/decoding-why-06-03-08999999999999999-in-js-and-how-to-solve-640</guid>
      <description>&lt;h4&gt;
  
  
  Understanding IEEE 754 Floating-Point Numbers and also exploring how 0.1+0.2 is &lt;strong&gt;0.30000000000000004 step-by-step&lt;/strong&gt;
&lt;/h4&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%2Ft9t2vzxc0rv4jkjy3jbl.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%2Ft9t2vzxc0rv4jkjy3jbl.png" width="800" height="253"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While working on an open-source calculator repository during &lt;a href="https://dev.to/jeevaramanathan/first-attempt-at-open-source-contribution-hacktoberfest23i-1dkh"&gt;Hacktoberfest&lt;/a&gt;, I noticed that certain decimal calculations were not producing the expected results, like &lt;em&gt;0.6+0.3 will not result in 0.9&lt;/em&gt; and was wondering if there was an issue with the code. However, upon further analysis discovered that it was the actual behavior of JavaScript. And delved deep into that to understand its internal workings.&lt;/p&gt;

&lt;p&gt;In this blog post, I will share my insights and discuss a few approaches to solve this.&lt;/p&gt;

&lt;p&gt;In everyday math, we know adding &lt;code&gt;0.6 + 0.3&lt;/code&gt; equals &lt;code&gt;0.9&lt;/code&gt;, right? But when we turn to computers it results in &lt;code&gt;0.8999999999999999&lt;/code&gt;. Surprisingly, this doesn’t just happen only in JavaScript; &lt;strong&gt;it’s the same in many&lt;/strong&gt; &lt;a href="https://0.30000000000000004.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;programming languages&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;like Python, Java, C too.&lt;/strong&gt; Also, it’s not just about this specific calculation. &lt;strong&gt;There are many more decimal calculations showing similar not-quite-right answers.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Why does this happen?
&lt;/h3&gt;

&lt;p&gt;It’s all about how computers handle floating-point numbers. Decimal numbers are stored in the computer’s memory using a format called IEEE 754 standard. IEEE Standard 754 floating point is the most common representation today for real numbers on computers. This standard includes different types of representation, mainly &lt;em&gt;Single precision(32 bits)&lt;/em&gt; and &lt;em&gt;Double precision(64 bits)&lt;/em&gt;. JavaScript follows IEEE 754 Double Precision Floating Point Standard.&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%2Fcdn-images-1.medium.com%2Fmax%2F594%2F0%2AQStVzygLfA9pM3KO" 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%2Fcdn-images-1.medium.com%2Fmax%2F594%2F0%2AQStVzygLfA9pM3KO" width="594" height="96"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;IEEE 754 Double Precision Floating Point Format&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Double precision is composed of 64bits including &lt;strong&gt;1 sign bit, 11 exponent bits&lt;/strong&gt; , and &lt;strong&gt;52 mantissa (fractional part) bits&lt;/strong&gt;.&lt;br&gt;
Any decimal number given is stored in this double precision IEEE 754 binary floating point format only. Finite 64-bit representations in computer systems can’t accurately express all decimal values, especially those with infinite decimal expansions, leading to minor discrepancies in results when working with certain numbers in binary.&lt;/p&gt;
&lt;h3&gt;
  
  
  Let’s understand with an example how decimal numbers are stored and unveil why 0.6+0.3 equals 0.8999999999999999
&lt;/h3&gt;

&lt;p&gt;Represent &lt;code&gt;0.6&lt;/code&gt; in IEEE 754 Double Precision Floating Point Format.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;# Step 1&lt;/strong&gt; : Converting the decimal &lt;strong&gt;(0.6)₁₀&lt;/strong&gt; to its binary representation &lt;code&gt;base 2&lt;/code&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkmx41ejfe1m6fdvy75a2.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%2Fkmx41ejfe1m6fdvy75a2.png" width="125" height="78"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Integer Part:&lt;/em&gt; &lt;code&gt;0/2 = 0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Fractional Part:&lt;/em&gt;&lt;br&gt;&lt;br&gt;
Repeatedly multiply by 2, noting each integer part of the results, until the fractional part reaches zero.&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%2Fjfkwzvgpu5dv3dez85x0.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%2Fjfkwzvgpu5dv3dez85x0.png" width="291" height="385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;0.1 cannot be exactly represented as a binary fraction. The highlighted part recurs endlessly, forming an infinite sequence. Also, we didn’t get any fractional part that is zero.&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%2Fqfx5zvqbrml1126adb4s.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%2Fqfx5zvqbrml1126adb4s.png" width="800" height="34"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;# Step 2:&lt;/strong&gt; Normalization&lt;br&gt;
A number x, written in scientific notation is normalized if it has a single non-zero digit to the left of the decimal point. i.e. Force the integer part of its mantissa to be exactly 1.&lt;br&gt;&lt;br&gt;
we adjust our sequence based on the IEEE standard requirements, including a finite number of 52-bit mantissa and rounding. That’s why round-off error occurs.&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%2F896c3tq75rnhqegpd3hn.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%2F896c3tq75rnhqegpd3hn.png" width="800" height="53"&gt;&lt;/a&gt;&lt;em&gt;mantissa of 0.6&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;#Step 3:&lt;/strong&gt; Adjust the Exponent:&lt;br&gt;
For double-precision, exponents in the range -1022 to +1023 are biased by adding 1023 to get a value.&lt;br&gt;&lt;br&gt;
 &lt;code&gt;exponent =&amp;gt; -1 + 1023 =&amp;gt; 1022&lt;/code&gt; Represent the value in 11 bit binary.&lt;/p&gt;

&lt;p&gt;(1022)&lt;strong&gt;₁₀ =&amp;gt; (010111111110)₂&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Sign bit is &lt;code&gt;0&lt;/code&gt; as &lt;code&gt;0.6&lt;/code&gt; is a positive number. &lt;code&gt;(-1)⁰=&amp;gt; 1&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Now we have all the values to represent in IEEE 754 Floating point format.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In the process of normalizing the mantissa, the leading (the leftmost) bit 1 is removed it’s always 1 and adjust its length to 52 bits, only if necessary (not the case here).&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%2Fgouts9kycqvlp8ndc60u.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%2Fgouts9kycqvlp8ndc60u.png" width="800" height="55"&gt;&lt;/a&gt;&lt;em&gt;Representing 0.6 in 64bit IEEE format.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Similarly, using the same process, 0.3 is represented as:&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%2Ffubjfgy9sl031jnv7pdy.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%2Ffubjfgy9sl031jnv7pdy.png" width="800" height="49"&gt;&lt;/a&gt;&lt;em&gt;0.3 in 64bit IEEE format&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;# Adding the two values&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;1. &lt;em&gt;Equalizing the exponent&lt;/em&gt;&lt;/strong&gt; &lt;br&gt;
As we have the value of &lt;code&gt;0.6&lt;/code&gt; and &lt;code&gt;0.3&lt;/code&gt; we have to add them. But before doing, ensure that the exponents are same. In this case, they are not equal. Therefore, we need to adjust them by matching the smaller exponent with the larger value.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Exponent of 0.6=&amp;gt; -1&lt;/code&gt; &lt;code&gt;Exponent of 0.3 =&amp;gt; -2&lt;/code&gt; , we have to match the &lt;code&gt;0.3&lt;/code&gt; with &lt;code&gt;0.6&lt;/code&gt; as exponent of 0.6 is greater than 0.3 .&lt;/p&gt;

&lt;p&gt;Here the difference is 1, so the &lt;strong&gt;mantissa of 0.3 needs to be shifted to the right by 1 bit,&lt;/strong&gt; and &lt;strong&gt;the exponent code is increased by 1 to match 0.6&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Shifting the mantissa by 1 bit will cause the least significant bit to be lost to maintain the 64-bit standard, which may introduce precision errors.&lt;/em&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpfdm7kcbgfnhake4iycb.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%2Fpfdm7kcbgfnhake4iycb.png" width="800" height="81"&gt;&lt;/a&gt;&lt;em&gt;Value of 0.3 after equalizing the exponent&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. &lt;em&gt;Add the mantissa&lt;/em&gt;&lt;/strong&gt; &lt;br&gt;
As the exponents are equal now, we need to perform binary addition on the mantissas.&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%2Fxgug9g8rhcc3ve9beyul.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%2Fxgug9g8rhcc3ve9beyul.png" width="800" height="85"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now the value will be, &lt;code&gt;0; 01111111110; 1.1100110011001100110011001100110011001100110011001100&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. &lt;em&gt;Normalizing the resulting mantissa and rounding&lt;/em&gt;&lt;/strong&gt; &lt;br&gt;
In this case, the mantissa it already normalized [has 1 as leading bit], so this step is skipped.&lt;/p&gt;

&lt;p&gt;And finally, the result of &lt;code&gt;0.6+0.3&lt;/code&gt; is represented as&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%2Fxlsyevi9v3ror7hzsaq3.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%2Fxlsyevi9v3ror7hzsaq3.png" width="800" height="52"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Sum of 0.6+0.3 in 64bit IEEE Floating Point Representation&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So, now we have the result of &lt;code&gt;0.6 + 0.3&lt;/code&gt; which is represented in 64bit IEEE format, and is machine-readable. We have to convert this back to decimal for human readability.&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;strong&gt;#Converting IEEE 754 Floating Point Representation to its Decimal Equivalent&lt;/strong&gt;
&lt;/h4&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%2Fuwjqo5zzn5fldcd8buce.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%2Fuwjqo5zzn5fldcd8buce.png" width="294" height="59"&gt;&lt;/a&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxlsyevi9v3ror7hzsaq3.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%2Fxlsyevi9v3ror7hzsaq3.png" width="800" height="52"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Determining Sign Bit:&lt;/strong&gt; &lt;code&gt;0 =&amp;gt; (-1)⁰ =&amp;gt; +1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Calculate unbiased exponent:&lt;/strong&gt;&lt;br&gt;
 &lt;code&gt;(01111111110)₂ =&amp;gt; (1022)₁₀&lt;/code&gt;&lt;br&gt;
 &lt;code&gt;2^(e-1023) =&amp;gt; 2^(1022-1023) =&amp;gt; 2^-1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fraction Part:&lt;/strong&gt;&lt;br&gt;
Summation the values of each bit position, starting from the leftmost bit of mantissa, and multiplying them by powers of 2. &lt;code&gt;1×2^-1 + 1×2⁻^-2 + 0×2^-3 + ....... + 0×2^-52&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;By substituting the values, and solving the equation we get the result as &lt;strong&gt;0.8999999999999999,&lt;/strong&gt; which is displayed on the console. &lt;em&gt;[&lt;/em&gt;&lt;a href="https://floating-point-gui.de/errors/rounding/" rel="noopener noreferrer"&gt;&lt;em&gt;Rounding&lt;/em&gt;&lt;/a&gt;&lt;em&gt;]&lt;/em&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="err"&gt;×&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;^-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="err"&gt;×&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="err"&gt;⁻&lt;/span&gt;&lt;span class="o"&gt;^-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="err"&gt;×&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;^-&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;.......&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="err"&gt;×&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;^-&lt;/span&gt;&lt;span class="mi"&gt;52&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;^-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.79999999999999982236431605997495353221893310546875&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;^-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mf"&gt;0.899999999999999911182158029987476766109466552734375&lt;/span&gt;      
&lt;span class="err"&gt;≈&lt;/span&gt; &lt;span class="mf"&gt;0.8999999999999999&lt;/span&gt; &lt;span class="c1"&gt;//numbers are rounded&lt;/span&gt;

&lt;span class="c1"&gt;//Because floating-point numbers have a limited number of digits,&lt;/span&gt;
&lt;span class="c1"&gt;//they cannot represent all real numbers accurately: when there &lt;/span&gt;
&lt;span class="c1"&gt;//are more digits, the leftover ones are omitted,i.e. the number is rounded&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s explore one more example to gain a deeper understanding of the well-known expression &lt;strong&gt;0.1 + 0.2 = 0.30000000000000004.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcevg662cpyuzicoxqe7y.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%2Fcevg662cpyuzicoxqe7y.png" width="800" height="946"&gt;&lt;/a&gt;&lt;em&gt;Adding the 64bit IEEE 754 binary floating point value of 0.1 &amp;amp; 0.2&lt;/em&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwotk4jtge4olakfdjlbn.jpeg" 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%2Fwotk4jtge4olakfdjlbn.jpeg" width="800" height="610"&gt;&lt;/a&gt;&lt;em&gt;Converting the result back to decimal&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Solve That?
&lt;/h3&gt;

&lt;p&gt;Let’s see how to achieve &lt;strong&gt;accurate results&lt;/strong&gt; when working with applications that handle currency or financial calculations, where precision is crucial.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;i) Inbuilt Function: toFixed()&lt;/strong&gt; and &lt;strong&gt;toPrecision()&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;toFixed()&lt;/code&gt; converts a number into a string and rounds the string to the specified number of decimals.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;toPrecision()&lt;/code&gt; format a number to a specific precision or length and will add trailing zeros to fulfill the specified precision if required. &lt;em&gt;parseFloat()&lt;/em&gt; is to remove trailing zeros from a number.
&lt;/li&gt;
&lt;/ul&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;num1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.6&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;num2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.3&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;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;num1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;num2&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;toFixed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&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;toPrecision&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parseFloat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toPrecision&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;12&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;Using toFixed(): &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: 0.9&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;Using toPrecision(): &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;toPrecision&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: 0.9&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Limitation&lt;/strong&gt;&lt;br&gt;
toFixed() always rounds the number to the given decimal place, which might not align the same in all cases. toPrecision() is also similar, and it may not produce accurate results for very small or very large numbers, as its arguments should be between 1–100.&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="c1"&gt;//1. Adding 0.03 and 0.255 =&amp;gt; expected 0.283&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="mf"&gt;0.03&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.253&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="c1"&gt;// returns 0.3&lt;/span&gt;

&lt;span class="c1"&gt;//2. Values are added as a string&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toPrecision&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toPrecision&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// returns 0.10.2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;ii) Third-Party Libraries&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
There are various libraries like &lt;a href="https://mathjs.org/" rel="noopener noreferrer"&gt;math.js&lt;/a&gt;, &lt;a href="https://mikemcl.github.io/decimal.js/" rel="noopener noreferrer"&gt;decimal.js&lt;/a&gt;, &lt;a href="https://mikemcl.github.io/big.js/" rel="noopener noreferrer"&gt;big.js&lt;/a&gt; that solve the problem. &lt;em&gt;Each library functions according to its documentation. This approach is comparatively better.&lt;/em&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="c1"&gt;//Example using big.js&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Big&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="s1"&gt;big.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;Big&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="nx"&gt;e6&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Set positive exponent for maximum precision in Big.js&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="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Big&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;plus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Big&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;//0.3&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="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Big&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.6&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;plus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Big&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;//0.9&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="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Big&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.03&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;plus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Big&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.253&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;//0.283&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="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Big&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;times&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Big&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.4&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;//0.04&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;The IEEE 754 standard for storing decimal numbers can lead to minor discrepancies. Various libraries can be used to achieve more precise results. Choose the appropriate approach based on application requirements. Equivalent packages exist in other languages like &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html" rel="noopener noreferrer"&gt;BigDecimal&lt;/a&gt; for Java and &lt;a href="https://docs.python.org/3/library/decimal.html" rel="noopener noreferrer"&gt;Decimal&lt;/a&gt; for python.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;References:&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://en.wikipedia.org/wiki/Double-precision_floating-point_format" rel="noopener noreferrer"&gt;What is Double-precision floating-point format&lt;/a&gt;&lt;br&gt;
&lt;a href="https://binary-system.base-conversion.ro/real-number-converted-from-decimal-system-to-64bit-double-precision-IEEE754-binary-floating-point.php?decimal_number_base_ten" rel="noopener noreferrer"&gt;Convert decimal to IEEE 64 Bit Double Precision&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.binaryconvert.com/convert_double.html" rel="noopener noreferrer"&gt;Convert IEEE 64 Bit Double Precision to Decimal&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.mathsisfun.com/calculator-precision.html" rel="noopener noreferrer"&gt;Full Precision Calculator&lt;/a&gt;&lt;br&gt;
&lt;a href="https://zhuanlan.zhihu.com/p/33333351" rel="noopener noreferrer"&gt;https://zhuanlan.zhihu.com/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://0.30000000000000004.com/" rel="noopener noreferrer"&gt;https://0.30000000000000004.com/&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Thanks for reading. Feel free to comment your opinion😊. Hope this post was helpful. You can hit me up on &lt;a href="https://www.linkedin.com/in/jeevaramanathan" rel="noopener noreferrer"&gt;&lt;strong&gt;Linked In&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;. Few other posts to check here.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/jeevaramanathan/first-attempt-at-open-source-contribution-hacktoberfest23i-1dkh"&gt;First Attempt at Open Source Contribution: Hacktoberfest'23 Journey&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/jeevaramanathan/hide-the-source-code-in-react-from-dev-tools-3-different-ways-5467"&gt;How to Hide the Source Code in React from Dev Tools [3 different ways]&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@jeevaramanathan/how-to-set-up-a-react-project-with-create-react-app-in-windows-4f30895daefa?source=post_page-----976a0fa01640--------------------------------" rel="noopener noreferrer"&gt;How To Create and Set Up a React Project with Create React App in Windows?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




</description>
      <category>javascript</category>
      <category>hacktoberfest</category>
      <category>programming</category>
      <category>floatingpoint</category>
    </item>
    <item>
      <title>First Attempt at Open Source Contribution: Hacktoberfest'23 Journey🚀💻</title>
      <dc:creator>Jeeva Ramanathan</dc:creator>
      <pubDate>Tue, 14 Nov 2023 07:43:53 +0000</pubDate>
      <link>https://dev.to/jeevaramanathan/first-attempt-at-open-source-contribution-hacktoberfest23i-1dkh</link>
      <guid>https://dev.to/jeevaramanathan/first-attempt-at-open-source-contribution-hacktoberfest23i-1dkh</guid>
      <description>&lt;p&gt;This was the first time participating in Hacktoberfest, marking not only an initial attempt at the event but also my introduction to the world of &lt;em&gt;Open Source contribution&lt;/em&gt;. This blog post will explore the path through the Hacktoberfest event 🛣️.&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%2Fm5f7srqzwefc1zkulucm.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%2Fm5f7srqzwefc1zkulucm.png" alt="Image description" width="800" height="506"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;What is Hacktoberfest and Open Source Contribution?&lt;br&gt;
     Hacktoberfest is an annual worldwide event held during the month of October. The event encourages open-source developers to contribute to repositories through pull requests (PR).&lt;br&gt;
    Open source contribution is participating in the development or improvement of open-source software. This can involve anything from reporting bugs and fixing code to writing documentation&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Discovery🔍
&lt;/h2&gt;

&lt;p&gt;Unknowing where to begin, I planned to contribute to the projects that aligned with my tech stack and interests and started exploring repositories. There are various approaches to refine the search to find a suitable repository for contribution. GitHub's search function allows to filter results using hacktoberfest tags, programming languages, and recently updated etc. And some websites like &lt;a href="//goodfirstissue.dev"&gt;goodfirstissue.dev&lt;/a&gt;, &lt;a href="//finder.usmans.me"&gt;finder.usmans.me&lt;/a&gt; also helped to find a suitable repository to start with. Identifying an active repo might be particularly helpful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the Repository and Contribution Guidelines📋
&lt;/h2&gt;

&lt;p&gt;Once found a repository to contribute to, the next steps was what and how should I contribute.&lt;/p&gt;

&lt;p&gt;Started by looking into the &lt;em&gt;contributing.md&lt;/em&gt;, &lt;em&gt;code_of_conduct.md&lt;/em&gt;, &lt;em&gt;Readme.md&lt;/em&gt; files to understand the procedures. Additionally traversed the issue section and pull request section to understand how the issues are reported and addressed, which gave some better idea about it.&lt;/p&gt;

&lt;p&gt;Each repository had different guidelines. Some allowed work to be started on existing or newly reported issues only after they had been assigned to us, while others allowed solutions to be provided to any open issues, which would be accepted if they met requirements. Additionally, there were repositories where all issues were not open, only with specific tags like &lt;em&gt;ready to take&lt;/em&gt;, &lt;em&gt;ready for dev&lt;/em&gt; indicates for open source contribution. So, checking the repository's guidelines is important as they provide all information from setup to how to create pull requests with proper titles. Starting with issues tagged &lt;em&gt;good first issue&lt;/em&gt;, &lt;em&gt;hacktoberfest&lt;/em&gt; is also suitable for making the first contribution towards open source.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making Changes and Creating Pull Requests 🛠️
&lt;/h2&gt;

&lt;p&gt;Initially forked the repository and created a working branch, then understood the code base and identified an issue to work on. After making the required changes and testing them, committed the changes to the working branch of forked repository and raised a pull request with base repository as original repository and head repository as forked repository-working branch according to the guidelines. The project maintainers reviewed the changes and provided some feedback or suggestions in some cases. After addressing that, the PR was merged.&lt;/p&gt;

&lt;h3&gt;
  
  
  Here are some of the pull requests (PRs)
&lt;/h3&gt;

&lt;p&gt;My contributions include identifying and resolving issues, as well as implementing new features and updating documentation.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://github.com/DhanushNehru/calculator/pull/118" rel="noopener noreferrer"&gt;Calculation Error&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/DhanushNehru/board/pull/57" rel="noopener noreferrer"&gt;Google Sign-in Feature&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/zero-to-mastery/Animation-Nation/pull/2384/files" rel="noopener noreferrer"&gt;Ping Pong Animation&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://github.com/jeevaramanathan" rel="noopener noreferrer"&gt;For more of my contributions, check out the GitHub repository&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Further Explorations and Challenges🤔
&lt;/h2&gt;

&lt;p&gt;So, while contributing to the beginner repositories, opted to explore a few larger and real-time repositories during last week. &lt;/p&gt;

&lt;p&gt;As this kind of large repository includes both frontend and backend, understanding the codebase and setting it up locally was quite hard, and for some, I did not had the necessary infrastructure or software in the system by the time. But &lt;a href="//gitpod.io"&gt;gitpod.io&lt;/a&gt; was really helpful here in setting up the few projects that are integrated with it. Gitpod is a cloud-based development platform. It provided a seamless and ready-to-code environment, ease the complexities of local setup. In this process, I made contributions to the &lt;a href="https://github.com/EddieHubCommunity/BioDrop/pull/9663" rel="noopener noreferrer"&gt;Biodrop&lt;/a&gt; and freecodecamp.&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%2F1ajydl5quou3fbnrnb0k.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%2F1ajydl5quou3fbnrnb0k.png" alt="Image description" width="800" height="97"&gt;&lt;/a&gt;Fortunately, identified an minor alignment issue in &lt;a href="https://github.com/freeCodeCamp/freeCodeCamp/issues?q=is%3Aissues+author%3Ajeevaramanathan+alignment+issue+in+email+signup" rel="noopener noreferrer"&gt;FreeCodeCamp&lt;/a&gt; and reported the issue with a workable solution. Following a while, the solution was also accepted as a temporary fix; However within the same issue, spotted another issue by proposing a fix. But after a loong back-and-forth discussion with the moderator involving testing on various browsers with different approaches, we came to a conclusion and the fix was also finally merged after the event. &lt;a href="https://github.com/freeCodeCamp/freeCodeCamp/pull/52132#discussion_r1374672879" rel="noopener noreferrer"&gt;Pull Request: Button Alignment&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✍️Writing insightful comments, creating descriptive issues, and submitting explained pull requests was really tricky.&lt;/p&gt;

&lt;h2&gt;
  
  
  Progress
&lt;/h2&gt;

&lt;p&gt;By exploring various repositories, had the opportunity to observe different coding standards, structures and approaches to problem-solving. &lt;br&gt;
It helped to have a better understanding of good coding structures, provided valuable insights into industry-standard coding practices. Also, it helped to improve collaboration and communication skills.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion✅
&lt;/h3&gt;

&lt;p&gt;Hacktoberfest makes a nice platform to start with open source, more than making contributions, it's also a great opportunity to learn from the open source community.&lt;/p&gt;

&lt;p&gt;Although I may not made significant contributions, it was still a good experience for me and a great opportunity to learn something new in the initial attempt towards opensource. Contributing to open source also allows you to understand how collaborative software development works. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;And if your interest is towards open-source, I would endorse you to start the same, it does not necessarily need to be code contributions, there can be non-code contributions as well.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Happy Contributing✨! &lt;/p&gt;




&lt;p&gt;You can hit me up on &lt;a href="http://github.com/jeevaramanathan" rel="noopener noreferrer"&gt;Github&lt;/a&gt; | &lt;a href="https://in.linkedin.com/in/jeevaramanathan" rel="noopener noreferrer"&gt;Linkedin&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Few other posts to check here.&lt;br&gt;
&lt;a href="https://dev.to/jeevaramanathan/decoding-why-06-03-08999999999999999-in-js-and-how-to-solve-640"&gt;Decoding Why 0.6 + 0.3 = 0.8999999999999999 🤯 in JS and How to Solve?&lt;/a&gt;&lt;/p&gt;

</description>
      <category>hack23contributor</category>
      <category>hacktoberfest</category>
      <category>opensource</category>
      <category>hacktoberfest23</category>
    </item>
    <item>
      <title>Hide the Source Code in React from Dev Tools [3 different ways]</title>
      <dc:creator>Jeeva Ramanathan</dc:creator>
      <pubDate>Sun, 02 Oct 2022 18:24:24 +0000</pubDate>
      <link>https://dev.to/jeevaramanathan/hide-the-source-code-in-react-from-dev-tools-3-different-ways-5467</link>
      <guid>https://dev.to/jeevaramanathan/hide-the-source-code-in-react-from-dev-tools-3-different-ways-5467</guid>
      <description>&lt;p&gt;On moving the code to production, it was identified that the whole source code of the React app, including the project structure is visible in the dev tools (inspect) source tab. &lt;em&gt;It may be an security issue of exposing your whole code in production or its not appreciated.&lt;/em&gt;&lt;br&gt;
After exploring, I identified why this happens and a solution for it to hide them.&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%2F2mcsl5ha1zv4n8zrf6w5.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%2F2mcsl5ha1zv4n8zrf6w5.png" alt="Image description" width="800" height="343"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Why is the source code visible?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Build files are created to deploy the app to production. While generating the build, by default React app will create the source “.map” files because react-script source map is enabled. These map files will have a reference to our source code. &lt;/p&gt;

&lt;p&gt;That is the mapping between the generated JavaScript file and the original source file. In development time, it will be easy to identify the error in your original file. &lt;/p&gt;

&lt;p&gt;Your browser will use the “.map” files to reconstruct the original source code visible in your browser. So to avoid this, the “.map” files should be removed. Removing those map files will also reduce the build size.&lt;/p&gt;

&lt;p&gt;We can remove or avoid the creation of those map files either way.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Through .env file&lt;/li&gt;
&lt;li&gt;Through package.json&lt;/li&gt;
&lt;li&gt;Using postbuild script&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  1. Through .env file
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create a &lt;code&gt;.env&lt;/code&gt; file in the project root folder.&lt;/li&gt;
&lt;li&gt;Add &lt;code&gt;GENERATE_SOURCEMAP=FALSE&lt;/code&gt; in the created env file.&lt;/li&gt;
&lt;/ul&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%2Fyxc1n1phqxahfb2mokin.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%2Fyxc1n1phqxahfb2mokin.png" alt="Image description" width="550" height="307"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, build your project through &lt;em&gt;&lt;code&gt;npm run build&lt;/code&gt;&lt;/em&gt; and deploy your app. It will avoid creating the map files during your build. Now you will not find the whole source code in the browser.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Through package.json
&lt;/h2&gt;

&lt;p&gt;Edit your &lt;em&gt;package.json&lt;/em&gt; build script like the below:&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%2Frxqntk6em6c2f6m0nufg.jpg" 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%2Frxqntk6em6c2f6m0nufg.jpg" alt="Image description" width="675" height="142"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You have to modify your build script in your package.json by adding generate source map to false.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#windows
build: set \"GENERATE_SOURCEMAP=false\" &amp;amp;&amp;amp; react-scripts build
#linux
build: GENERATE_SOURCEMAP=false react-scripts build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is also another way of mentioning the build to avoid creating the map files by setting the source map to false.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Using postbuild
&lt;/h2&gt;

&lt;p&gt;In this approach, it will first create the build files and then post the build, the “.map” files inside the &lt;em&gt;build/static/js&lt;/em&gt; and &lt;em&gt;build/static/css&lt;/em&gt; will be removed.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;rimraf&lt;/em&gt; is used to remove the folders and files recursively. It’s like the rm -rf command in Linux.&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%2F2564go3d8lrhptwln8o8.jpg" 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%2F2564go3d8lrhptwln8o8.jpg" alt="Image description" width="451" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add the postbuild script &lt;code&gt;"postbuild":"rimraf build/static/**/*.map"&lt;/code&gt; to the script and run &lt;code&gt;npm build&lt;/code&gt; . It will initially create the build “.map” files in the build folder and will remove those files post build. On deploying the app to production, you will not find the complete source code.&lt;/p&gt;

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

&lt;p&gt;So there are many ways to achieve the same. In the first two approaches, we avoid creating those map files initially, and in the last approach, we remove the “.map” files inside build/static/js and build/static/css after creation post the build.&lt;br&gt;
It will hide the source code from &lt;em&gt;inspect&amp;gt; sources tab&lt;/em&gt; in browser and also this will make your build faster and also reduce a lot of space in the build folder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Feel free to comment your opinion or provide your suggestions&lt;/em&gt;&lt;/strong&gt;😊.&lt;strong&gt;&lt;em&gt;Hope this post was helpful, thanks for reading.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This post was originally published &lt;a href="https://medium.com/dev-genius/how-to-hide-the-source-code-in-react-from-dev-tools-3-ways-60c8aea1d299" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/jeevaramanathan" rel="noopener noreferrer"&gt;Linked In&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
