<?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: Neel-Vekariya</title>
    <description>The latest articles on DEV Community by Neel-Vekariya (@neel-vekariya).</description>
    <link>https://dev.to/neel-vekariya</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3968256%2Ff900b976-6eab-4295-bca9-6c8b6fd937e2.jpeg</url>
      <title>DEV Community: Neel-Vekariya</title>
      <link>https://dev.to/neel-vekariya</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/neel-vekariya"/>
    <language>en</language>
    <item>
      <title>What Does Express.js Abstract Away?</title>
      <dc:creator>Neel-Vekariya</dc:creator>
      <pubDate>Wed, 14 Oct 2026 06:00:12 +0000</pubDate>
      <link>https://dev.to/neel-vekariya/what-does-expressjs-abstract-away-59c8</link>
      <guid>https://dev.to/neel-vekariya/what-does-expressjs-abstract-away-59c8</guid>
      <description>&lt;p&gt;In the past, we talked about the general deeper understanding about what Express.js actually is, what problem it tries to solve, and what existed before Express. But another question is: what abstraction does it introduce?&lt;/p&gt;

&lt;p&gt;If you've read my previous posts, you know that Express.js provides an abstraction over Node.js's HTTP module. In this post, we'll go deeper and explore what those abstractions actually are.&lt;/p&gt;

&lt;p&gt;The most common central abstraction, the low-level processing of an HTTP request into a programmable pipeline of middleware and routes. This is a broad perspective of the Express.js abstraction. But this broad abstraction has many small abstractions. And those abstractions are:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;*) Route Matching&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Express abstracts manually route matching. It takes responsibility for matching routes for incoming requests. It abstracts that task and gives a simple way to use routes without the complexity of matching routes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;*) Route Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The next abstraction Express.js provides is parsing request parameters for us, so we don't have to handle them manually. It hides the mechanics of matching and extracting that value. Without it, you might have to manually parse the parameters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;*) Request Processing:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Express abstracts raw HTTP request information into data that is easily accessible to the application. The task of processing raw information of the request is abstracted by Express.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;*) Middleware:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Express allows you to represent cross-cutting request processing as reasonable functions. Instead of manually deciding everything inside one HTTP callback, it gives functionality to compose the application out of functions that process the request sequentially.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;*) Composition Model:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Express gives you compose behaviour where each piece has a focused responsibility. That’s much more scalable than putting everything into one request.&lt;/p&gt;

&lt;p&gt;Express makes application development easier by abstracting some of the complexity, but it does not abstract away everything involved in building an application.&lt;/p&gt;

&lt;p&gt;It doesn’t decide:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How my business should work&lt;/li&gt;
&lt;li&gt;How I should store users&lt;/li&gt;
&lt;li&gt;Which database I should use&lt;/li&gt;
&lt;li&gt;How an order should be calculated&lt;/li&gt;
&lt;li&gt;How payment should work&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>softwareengineering</category>
      <category>express</category>
    </item>
    <item>
      <title>What Existed Before Express?</title>
      <dc:creator>Neel-Vekariya</dc:creator>
      <pubDate>Sat, 10 Oct 2026 04:04:14 +0000</pubDate>
      <link>https://dev.to/neel-vekariya/what-existed-before-express-2b38</link>
      <guid>https://dev.to/neel-vekariya/what-existed-before-express-2b38</guid>
      <description>&lt;p&gt;I already made a post about what Express really is and which problem Express tries to solve. But do you think about what existed before Express? How did developers build servers in the JavaScript ecosystem?&lt;/p&gt;

&lt;p&gt;I had this question, and I found out a really interesting thing.&lt;/p&gt;

&lt;p&gt;In the JavaScript ecosystem, Node.js was released in 2009, and its standard library already allowed developers to create HTTP servers directly.&lt;/p&gt;

&lt;p&gt;Think about the complexity and repetition of code for building servers using the Node.js HTTP module. I saw code for handling different routes, where you handle different types of requests and routes using the if-else block.&lt;/p&gt;

&lt;p&gt;Like this:&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;server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createServer&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;method&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;req&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeHead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&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;Content-Type&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;text/plain&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Home page&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;method&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;req&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/about&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeHead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&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;Content-Type&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;text/plain&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;About page&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeHead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;404&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;Content-Type&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;text/plain&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;404 - Page not found&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You repetitively write which data type you send and what the actual data (response) will be sent by the server. And this process becomes cumbersome as the application grows.&lt;/p&gt;

&lt;p&gt;Developers therefore built higher-level abstractions around Node.js HTTP capabilities, which are frameworks and libraries. Express is one of those abstractions and became particularly influential.&lt;/p&gt;

&lt;p&gt;Node.js brought JavaScript to the server, and Express provided a popular web framework abstraction for that environment.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>softwareengineering</category>
      <category>webdev</category>
      <category>node</category>
    </item>
    <item>
      <title>The Engineering Problem Express Tries to Solve</title>
      <dc:creator>Neel-Vekariya</dc:creator>
      <pubDate>Wed, 07 Oct 2026 14:36:07 +0000</pubDate>
      <link>https://dev.to/neel-vekariya/the-engineering-problem-express-tries-to-solve-57bd</link>
      <guid>https://dev.to/neel-vekariya/the-engineering-problem-express-tries-to-solve-57bd</guid>
      <description>&lt;h1&gt;The Engineering Problem Express Tries to Solve&lt;/h1&gt;

&lt;p&gt;If you don’t know, we can also build an HTTP application using Node.js low-level HTTP APIs. The application is working properly and able to handle requests and generate responses. So, why do we need to build Express?&lt;/p&gt;

&lt;p&gt;The reason behind that is that building an HTTP application using Node.js low-level HTTP APIs becomes repetitive and cumbersome (difficult) as the application grows. The repetition of writing code for request parsing, routing, middleware, and handling the logic becomes more complex.&lt;/p&gt;

&lt;h2&gt;The Problem Express Solves:&lt;/h2&gt;

&lt;p&gt;How can we build an HTTP application on top of Node.js without repeatedly implementing the same request parsing, routing, middleware, and response handling logic ourselves?&lt;/p&gt;

&lt;p&gt;Express introduces reusable abstractions for those common problems. In application building, the repeated infrastructure, such as routing, middleware composition, request parsing, response handling, and error handling, is directly provided by those reusable abstractions.&lt;/p&gt;

&lt;p&gt;If you are confused by reusable abstractions, don’t worry. It simply means a ready-made piece of code or concept that solves a common problem.&lt;/p&gt;

&lt;p&gt;This reusable abstraction gives us the ability to write actual business logic instead of writing complex application infrastructure for every project.&lt;/p&gt;

&lt;p&gt;This is the actual problem that Express tries to solve. And it exists to provide a higher-level abstraction over Node.js low-level HTTP APIs.&lt;/p&gt;

</description>
      <category>express</category>
      <category>node</category>
      <category>webdev</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>What is Express, really?</title>
      <dc:creator>Neel-Vekariya</dc:creator>
      <pubDate>Sun, 04 Oct 2026 06:46:33 +0000</pubDate>
      <link>https://dev.to/neel-vekariya/what-is-express-really-hn8</link>
      <guid>https://dev.to/neel-vekariya/what-is-express-really-hn8</guid>
      <description>&lt;h1&gt;What is Express, really?&lt;/h1&gt;

&lt;p&gt;In my last blog, I shared some of my personal experience and the thinking that led me from &lt;strong&gt;“How?” to “Why?”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So, I’m going to assume you already know the “how” of Express.&lt;/p&gt;

&lt;p&gt;Now, let’s start understanding the “why” behind Express.&lt;/p&gt;

&lt;h2&gt;First, let’s understand what Express really is.&lt;/h2&gt;

&lt;p&gt;As per the technical definition:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Express.js is a minimal, unopinionated web application framework for Node.js that provides abstractions and APIs for handling HTTP requests, generating HTTP responses, routing, middleware composition, and building web/API applications.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🤦‍♂️🤦‍♂️ Very technical, right?&lt;/p&gt;

&lt;p&gt;Don’t worry, I’ll explain it to you.&lt;/p&gt;

&lt;p&gt;In simple terms, Express.js is a web application framework that provides the bare minimum (&lt;strong&gt;small set of core abstractions&lt;/strong&gt;) tools to build your applications while giving you maximum freedom in how you structure your application.&lt;/p&gt;

&lt;p&gt;It does not force you to follow a specific file structure.&lt;/p&gt;

&lt;p&gt;It provides tools for handling requests, responses, routing, and other application tasks instead of making you manually handle those lower-level tasks.&lt;/p&gt;

&lt;p&gt;Now you get the idea of what Express is.&lt;/p&gt;

&lt;p&gt;But another confusing phrase came up:&lt;/p&gt;

&lt;h2&gt;“Lower-level application tasks.”&lt;/h2&gt;

&lt;p&gt;What does that actually mean?&lt;/p&gt;

&lt;p&gt;To understand this, you first need to understand &lt;strong&gt;what problem Express is solving.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And that is another big topic, which we’ll discuss in the next post.&lt;/p&gt;

&lt;p&gt;For now, assume there are some repeated tasks involved in building and setting up HTTP APIs.&lt;/p&gt;

&lt;p&gt;Express handles many of these tasks under the hood.&lt;/p&gt;

&lt;p&gt;This provides a layer of abstraction over those difficult tasks and gives developers a convenient way to work with:&lt;/p&gt;

&lt;h2&gt;1. Routing:&lt;/h2&gt;

&lt;p&gt;Deciding which code should handle a particular URL and HTTP method.&lt;/p&gt;

&lt;h2&gt;2. Middleware:&lt;/h2&gt;

&lt;p&gt;Creating a pipeline of functions that process requests and responses.&lt;/p&gt;

&lt;h2&gt;3. Request Handling:&lt;/h2&gt;

&lt;p&gt;Handling parameters, headers, and request bodies.&lt;/p&gt;

&lt;h2&gt;4. Response Handling:&lt;/h2&gt;

&lt;p&gt;Sending JSON, HTML, status codes, and other data.&lt;/p&gt;

&lt;h2&gt;5. Error Handling:&lt;/h2&gt;

&lt;p&gt;Handling errors consistently within the application.&lt;/p&gt;





&lt;p&gt;But this brings us to another question:&lt;/p&gt;

&lt;h2&gt;What problem was Express actually trying to solve?&lt;/h2&gt;

&lt;p&gt;That’s what we’ll understand in the next blog.&lt;/p&gt;

</description>
      <category>express</category>
      <category>webdev</category>
      <category>softwareengineering</category>
      <category>node</category>
    </item>
    <item>
      <title>Why I Started Learning Express.js Differently</title>
      <dc:creator>Neel-Vekariya</dc:creator>
      <pubDate>Thu, 01 Oct 2026 06:47:11 +0000</pubDate>
      <link>https://dev.to/neel-vekariya/why-i-started-learning-expressjs-differently-4ne3</link>
      <guid>https://dev.to/neel-vekariya/why-i-started-learning-expressjs-differently-4ne3</guid>
      <description>&lt;p&gt;Two months ago, if you asked me, “What is Express?”&lt;/p&gt;

&lt;p&gt;I would have said, “Express is a framework that handles requests, generates responses, and is used to build servers. That’s it.”&lt;/p&gt;

&lt;p&gt;I also learned Express from tutorials and built the projects that the instructor instructed me to build, which you’ve probably done too.&lt;/p&gt;

&lt;p&gt;After that, I built my personal project. I had a clear idea of the project, so I built it.&lt;/p&gt;

&lt;p&gt;I knew how to use controllers and routers, how to handle errors, requests, and responses, and how to implement middleware because I learned all these things from the tutorials.&lt;/p&gt;

&lt;p&gt;But somehow, I felt that something was confusing me.&lt;/p&gt;

&lt;p&gt;I didn’t clearly know what was confusing me.&lt;/p&gt;

&lt;p&gt;But I found out what was confusing me after a very long time.&lt;/p&gt;

&lt;p&gt;And that thing is very interesting:&lt;/p&gt;

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

&lt;p&gt;What is “why”?&lt;/p&gt;

&lt;p&gt;For me, “why” means: “Why do all these things work this way?”&lt;/p&gt;

&lt;p&gt;I knew how to build a project using controllers and middleware. I knew how to handle requests and responses.&lt;/p&gt;

&lt;p&gt;But the “why” was missing, and I realized this after a very long time.&lt;/p&gt;

&lt;p&gt;The “why” is very important when learning the “how.”&lt;/p&gt;

&lt;p&gt;I think some realizations are important because they give you the right perspective to see things.&lt;/p&gt;

&lt;p&gt;Every time I need to learn a new technology, I run toward “how” and not “why".&lt;/p&gt;

&lt;p&gt;The thinking behind “why” is important when understanding how we implement a technology in our projects.&lt;/p&gt;

&lt;p&gt;Why gives you an engineering perspective and a clear answer to why we use this technology instead of another technology.&lt;/p&gt;

&lt;p&gt;To understand the why give to ability to use this particular technology in particular situation.&lt;/p&gt;

&lt;p&gt;That shift helped me understand the engineering thinking behind the technologies I use—not just the APIs, syntax, or common patterns.&lt;/p&gt;

&lt;p&gt;So I decided to start sharing this way of thinking here.&lt;/p&gt;

&lt;p&gt;I’m starting with Express.js, and I’ll be sharing what I learn along the way.&lt;/p&gt;

&lt;p&gt;If you’re also trying to move from “I can use it” to “I understand why it works,” follow along.&lt;/p&gt;





&lt;p&gt;If you’re also learning software development, I’d love to hear your thoughts in the comments.&lt;/p&gt;

</description>
      <category>express</category>
      <category>node</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Testing Pyramid</title>
      <dc:creator>Neel-Vekariya</dc:creator>
      <pubDate>Tue, 15 Sep 2026 10:30:53 +0000</pubDate>
      <link>https://dev.to/neel-vekariya/testing-pyramid-4dna</link>
      <guid>https://dev.to/neel-vekariya/testing-pyramid-4dna</guid>
      <description>&lt;p&gt;In recent my posts, I talk about the AAA model of the testing and what is the importance of testing. Now I think this time is perfect for introduce and talk about the testing Pyramid.&lt;/p&gt;

&lt;p&gt;The concept of the testing pyramid is introduced by Mike Cohn in 2004. Then in 2009 The formal and polished version of the testing pyramid is introduced in his book “Succeeding with Agile”. They introduce three levels pyramid which is UI tests, Service tests and Unit tests.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1v5hpgdq3jctd59eoag0.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1v5hpgdq3jctd59eoag0.png" alt="Three level diagram" width="481" height="277"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;The levels of pyramid divides based on their scope, speed, cost and frequency. Different levels have different scope, speed, cost and the running frequency. Based on this parameter, you can easily decide which type of tests to use, where to use them, and how much of each type you need.&lt;/p&gt;

&lt;p&gt;Generally, the ratio of this tests levels is 10:20:70. 10 percent of your tests is UI tests, 20 percent tests is service tests and rest of 70 percent tests is unit tests. This ratio is popularized by the google in 2015, in their testing blog “Just Say No to More End-to-End Tests”.&lt;/p&gt;





&lt;p&gt;Now let’s understand deeply what are those different levels. Let’s start with unit tests.&lt;/p&gt;

&lt;h2&gt;Unit Tests&lt;/h2&gt;

&lt;p&gt;Generally, Unit tests are small and independent block of tests for small feature, small function or small component. This unit tests are isolated then other tests. It tests and checks smallest part of the program.&lt;/p&gt;

&lt;p&gt;It run on isolation so that their scope is limited to that function or that component. Unit tests are extremely fast due to mocking of database query, API requests and file I/O. The mocking of those operation makes unit tests faster to execute.&lt;/p&gt;

&lt;p&gt;The frequency of the unit tests is very high. After every file change, the unit tests run automatically, testing the relevant cases and providing instant feedback.&lt;/p&gt;

&lt;p&gt;Now after every change the test cases automatically checks every component or feature then if any mistake was created it directly indicates failure and the cost of fix this mistake in development phase is very cheap.&lt;/p&gt;

&lt;p&gt;So that’s is all about unit tests now let’s understand service tests.&lt;/p&gt;





&lt;h2&gt;Service Tests&lt;/h2&gt;

&lt;p&gt;In unit tests we tests individual component, function or feature working individually in isolation or not. But that is not necessary if component works on isolation then it also works when they dependent to each other. In real application most of function is dependent on some component or some dependency in this time unit test is not reliable. So, we done service tests.&lt;/p&gt;

&lt;p&gt;In service case we test that the interaction between different parts like function or component is done reliably or not. The goal is to ensure that the complete system behaves correctly when its components are connected.&lt;/p&gt;

&lt;p&gt;In service tests, mocking is rarely used. In case where you use external API that is expensive, unreliable or unavailable then the mocking is used in service tests.&lt;/p&gt;

&lt;p&gt;In service tests the scope of the tests is from two component to multiple component due to use case of service test. The component is not isolated because they depend on other component so the speed of executing service test is slower than unit test.&lt;/p&gt;

&lt;p&gt;The frequency of service tests is lower than unit tests. Because service tests require multiple components or dependencies to work together, they take more time to execute. So we don't need to run every service test after every small file change.&lt;/p&gt;

&lt;p&gt;But when we change something that can affect the interaction between components, service tests become very important.&lt;/p&gt;

&lt;p&gt;They give us confidence that different parts of our application are working correctly when they are connected with each other.&lt;/p&gt;

&lt;p&gt;Now we understand unit tests and service tests. But there is still one level remaining in the Testing Pyramid. That is UI tests.&lt;/p&gt;





&lt;h2&gt;UI Tests&lt;/h2&gt;

&lt;p&gt;UI tests are tests where we test the application from the user interface. Instead of directly testing a function or connecting different components, here we test the application from the point where the real user interacts with it.&lt;/p&gt;

&lt;p&gt;The test can open the application, find the email input, enter the email, enter the password, click on the login button and check whether the user successfully reaches the dashboard.&lt;/p&gt;

&lt;p&gt;So, UI tests test the complete user interaction with the application.&lt;/p&gt;

&lt;p&gt;The scope of UI tests is much bigger than unit tests and service tests because it can cover the complete application flow. It can involve UI components, frontend logic, backend services, database and other dependencies.&lt;/p&gt;

&lt;p&gt;Because of this large scope, UI tests are much slower than unit tests and service tests. The test needs to start and interact with the application and sometimes it also needs to communicate with the backend and database.&lt;/p&gt;

&lt;p&gt;The cost of UI tests is also higher. Writing and maintaining these tests takes more time because even a small change in UI can break the test. For example, if we change the button structure or change some text or element, the UI test may need to be updated.&lt;/p&gt;

&lt;p&gt;The frequency of UI tests is also lower. We don't want to run every UI test after every small change because they take more time and resources.&lt;/p&gt;





&lt;p&gt;So if we compare all three levels, unit tests have the smallest scope, highest speed, lowest cost and highest frequency.&lt;/p&gt;

&lt;p&gt;Service tests have a bigger scope than unit tests, slower speed, higher cost and lower frequency.&lt;/p&gt;

&lt;p&gt;UI tests have the biggest scope, lowest speed, highest cost and lowest frequency.&lt;/p&gt;

&lt;p&gt;This is the basic idea behind the Testing Pyramid.&lt;/p&gt;





&lt;p&gt;There is one more thing that is important to understand.&lt;/p&gt;

&lt;p&gt;The terminology around the Testing Pyramid has changed over time.&lt;/p&gt;

&lt;p&gt;The original Testing Pyramid described the three levels as Unit Tests, Service Tests and UI Tests.&lt;/p&gt;

&lt;p&gt;But as software development practices evolved, different teams and organizations started using different terminology for these levels.&lt;/p&gt;

&lt;p&gt;The term UI tests is now often discussed as End-to-End tests, or E2E tests, and service tests discussed as integration tests.&lt;/p&gt;

</description>
      <category>softwareengineering</category>
      <category>testing</category>
      <category>webdev</category>
      <category>learning</category>
    </item>
    <item>
      <title>Is Being Good at Coding Enough?</title>
      <dc:creator>Neel-Vekariya</dc:creator>
      <pubDate>Sat, 12 Sep 2026 05:26:05 +0000</pubDate>
      <link>https://dev.to/neel-vekariya/is-being-good-at-coding-enough-j3i</link>
      <guid>https://dev.to/neel-vekariya/is-being-good-at-coding-enough-j3i</guid>
      <description>&lt;p&gt;Over the last six months, I’ve learned a few things that changed the way I think about building a career in software.&lt;/p&gt;

&lt;p&gt;When we think about technical careers like software engineering, frontend development, or backend development, we usually believe technical skills are enough to build a successful and stable career.&lt;/p&gt;

&lt;p&gt;so we focusing on learning new languages, explore new frameworks, new tools and try to become good in problem solving.&lt;/p&gt;

&lt;p&gt;but this is really enough?. I don't saying like this technical skills is not necessary. it is necessary but this are skills alone actually enough.&lt;/p&gt;





&lt;h2&gt;And this is where social media become interesting.&lt;/h2&gt;

&lt;p&gt;Today, social media is not just place for entertainment it also become marketplace. where every company today come and they market them and gets visibility and trust. they build their identity as brand use of social media.&lt;/p&gt;

&lt;p&gt;do you think how companies build their identity.&lt;/p&gt;

&lt;p&gt;lets understand by simple example&lt;/p&gt;





&lt;h2&gt;How Companies Build Their Identity&lt;/h2&gt;

&lt;p&gt;lets imagine a company has a good product. does it simply build the product and wait for people to discover it?&lt;/p&gt;

&lt;p&gt;usually not.&lt;/p&gt;

&lt;p&gt;After building great product company market their product, communicate with community, creates content and tells people about what they stands for. what it does, what it believes in, and what makes its product valuable.&lt;/p&gt;

&lt;p&gt;over a time people start recognize the company and associating them with some products which company sells. now company have their identity in the market.&lt;/p&gt;





&lt;h2&gt;Now Come to Our Main Question&lt;/h2&gt;

&lt;p&gt;now come to our main question Is it really enough?. now in this case the product is our skills. company may have good product but does it automatically have customers? not&lt;/p&gt;

&lt;p&gt;so what does company do?&lt;/p&gt;

&lt;p&gt;its markets its product&lt;/p&gt;

&lt;p&gt;in a same way we need to market our skills. we need to create our identity, we need to tell people what we does, what is believes in and why we are valuable.&lt;/p&gt;





&lt;h2&gt;But Think About It Again&lt;/h2&gt;

&lt;p&gt;Now, let's recall the process of how a company builds its identity.&lt;/p&gt;

&lt;p&gt;But think about it again.&lt;/p&gt;

&lt;p&gt;Is the company actually trying to build an identity?&lt;/p&gt;

&lt;p&gt;Not exactly.&lt;/p&gt;

&lt;p&gt;The company is actually building its distribution a way to get its product and services in front of more people.&lt;/p&gt;





&lt;h2&gt;Let's Understand How Distribution Actually Works&lt;/h2&gt;

&lt;p&gt;First, let's make one thing clear:&lt;/p&gt;

&lt;p&gt;The benefits of content are random and unexpected.&lt;/p&gt;

&lt;p&gt;You cannot predict exactly who will see your content, who will connect with it, or what opportunity may come from it.&lt;/p&gt;

&lt;p&gt;But through distribution, you increase your chances and expend your surface area of getting opportunities.&lt;/p&gt;

&lt;p&gt;The more people who discover your work, your skills, and your thinking, the more chances you have of getting an opportunity.&lt;/p&gt;

&lt;p&gt;And over time, this repeated exposure creates recognition and builds your professional identity.&lt;/p&gt;





&lt;h2&gt;So Is Being Good at Coding Enough?&lt;/h2&gt;

&lt;p&gt;so now give answer Is Being Good at Coding Enough? no&lt;/p&gt;

&lt;h2&gt;because "Jo dikhta he vo bikta he"&lt;/h2&gt;

</description>
      <category>softwareengineering</category>
      <category>careerdevelopment</category>
      <category>personalbranding</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Why need software testing</title>
      <dc:creator>Neel-Vekariya</dc:creator>
      <pubDate>Sun, 06 Sep 2026 07:06:08 +0000</pubDate>
      <link>https://dev.to/neel-vekariya/why-need-software-testing-2257</link>
      <guid>https://dev.to/neel-vekariya/why-need-software-testing-2257</guid>
      <description>&lt;h1&gt;Why need software testing&lt;/h1&gt;

&lt;p&gt;Two days before, I posted about how my thoughts will change around testing, talked about the AAA model of testing, and how the AAA model is used for testing.&lt;/p&gt;

&lt;p&gt;Now the next question came into my mind: if testing is important is ok, but what are the actual and well-defined advantages of testing we have?&lt;/p&gt;

&lt;p&gt;I have some thoughts about those advantages, but I can’t describe them in words because I have very unclear thoughts.&lt;/p&gt;

&lt;p&gt;Then I decided, let’s make this answer clear. I searched about that and found lots of content created around testing.&lt;/p&gt;

&lt;p&gt;The content I found has different-different opinions about testing, but deeply I observed that all the content directly or indirectly indicates the same points, but people have different-different tests and experiences to explain those points.&lt;/p&gt;

&lt;p&gt;All the content I found describes the actual thinking on top of product management and software engineering, which is very important to create and maintain the product.&lt;/p&gt;

&lt;p&gt;In software engineering, to build the feature or product is not always the task. Software engineering is never about building new ordinary features and products which do not function properly, are not reliable, and do not have enough efficient use cases.&lt;/p&gt;

&lt;p&gt;It’s all about achieving maximum functionality, reliability, usability, efficiency, maintainability, and portability of the feature or product.&lt;/p&gt;

&lt;p&gt;And the thinking behind testing is to test a feature and product on top of these parameters. And at this point, I have some clear thoughts about testing, so let’s clean those thoughts more.&lt;/p&gt;





&lt;p&gt;I described many words like functionality, reliability, usability, efficiency, maintainability, and lastly portability, but what the actual meaning of these words is, let’s clear out more.&lt;/p&gt;

&lt;h2&gt;Functionality&lt;/h2&gt;

&lt;p&gt;Functionality :- Functionality means whether all the created or implemented functions do their work correctly or not.&lt;/p&gt;

&lt;p&gt;All the functions which are built to achieve some level of expected task, give the correct and well-defined output, and using all the output we achieve the expected task, output is defined by this functionality.&lt;/p&gt;

&lt;h2&gt;Reliability&lt;/h2&gt;

&lt;p&gt;Reliability :- Reliability means the downtime and failure rate of the software or service tend to be lower.&lt;/p&gt;

&lt;p&gt;The software or service must have maximum uptime and minimum failure time so the software or service does its work reliably.&lt;/p&gt;

&lt;h2&gt;Usability&lt;/h2&gt;

&lt;p&gt;Usability :- Usability means designing your software in a way where the features of the software are actually usable and have maximum and easy access to the feature.&lt;/p&gt;

&lt;p&gt;This thinking leads to improving the GUI of the product or feature.&lt;/p&gt;

&lt;h2&gt;Efficiency&lt;/h2&gt;

&lt;p&gt;Efficiency :- Efficiency means using your resources very wisely.&lt;/p&gt;

&lt;p&gt;The resources are very expensive, so design your feature or product in a way where your feature or product consumes a minimum amount of resources and gives the best output using the consumed resources.&lt;/p&gt;

&lt;h2&gt;Maintainability&lt;/h2&gt;

&lt;p&gt;Maintainability :- Maintainability means the feature or product is maintainable.&lt;/p&gt;

&lt;p&gt;If you design your feature or product in a way where maintaining the feature or product is harder or complex, then this will kill the maintainability of the product.&lt;/p&gt;

&lt;p&gt;In software engineering, we try to build a feature or product in a way where the maintainability of the feature or product is very high, so later, if we need to make changes, then we can make changes simply.&lt;/p&gt;

&lt;h2&gt;Portability&lt;/h2&gt;

&lt;p&gt;Now last is portability :- Portability is all about running your product on various operating systems.&lt;/p&gt;

&lt;p&gt;If your product or feature only runs on your operating system, then the portability of your product or feature is very low.&lt;/p&gt;





&lt;p&gt;So this is all the parameters where the quality of the software depends, and to test all the parameters, you need to test these points.&lt;/p&gt;

</description>
      <category>performance</category>
      <category>software</category>
      <category>softwareengineering</category>
      <category>testingbenefits</category>
    </item>
    <item>
      <title>New way to build the software</title>
      <dc:creator>Neel-Vekariya</dc:creator>
      <pubDate>Wed, 02 Sep 2026 05:56:48 +0000</pubDate>
      <link>https://dev.to/neel-vekariya/new-way-to-build-the-software-k2g</link>
      <guid>https://dev.to/neel-vekariya/new-way-to-build-the-software-k2g</guid>
      <description>&lt;p&gt;If you read my blogs, then you definitely know I learned to build a full-stack application.&lt;/p&gt;

&lt;p&gt;But to build an application and to build an application that is efficient, robust, and performs well under any circumstances are different levels of skills and engineering.&lt;/p&gt;

&lt;p&gt;In this AI era, everyone generates code using AI and builds applications, but actual software engineering is never about writing code.&lt;/p&gt;

&lt;p&gt;The real engineering is to build software that works under any conditions, gives the correct output, and is reliable and well-tested.&lt;/p&gt;

&lt;p&gt;This one thought led me to explore things about testing.&lt;/p&gt;

&lt;p&gt;Before building my project, I never thought about testing and edge cases.&lt;/p&gt;

&lt;p&gt;I built the feature, and if it gave the correct output, then fine, my feature was ready and I moved on to build another feature.&lt;/p&gt;

&lt;p&gt;I wrote hundreds of lines of code without any real value because the feature was not reliable, not robust, and did not perform well under critical situations.&lt;/p&gt;





&lt;p&gt;Then I found out this is the difference between a senior developer and a junior developer.&lt;/p&gt;

&lt;p&gt;I learned to build software, but I didn’t learn to think about edge cases, what if my feature faced a critical situation, and what about robustness.&lt;/p&gt;

&lt;p&gt;I missed thinking about edge cases, critical situations, and robustness.&lt;/p&gt;

&lt;p&gt;This is the thinking that differentiates a junior developer from a senior developer.&lt;/p&gt;





&lt;p&gt;At this stage, I had one doubt, and the doubt was: if testing is important, then I want to learn testing deeply.&lt;/p&gt;

&lt;p&gt;If you have the same doubt, then I found the correct answer.&lt;/p&gt;

&lt;p&gt;To build reliable, robust software that works in critical situations, you don’t need to learn software testing deeply if your goal is not to become a QA engineer specifically.&lt;/p&gt;

&lt;p&gt;Why did I say this? The reason is that you only need to know how to verify your feature in the way you want to perform the task.&lt;/p&gt;

&lt;p&gt;During the development period, the cost of finding bugs and vulnerabilities in the feature is very low if the developer finds their bugs in the early development stage.&lt;/p&gt;

&lt;p&gt;To overcome the maximum damage of the feature and save your resources, testing becomes very essential in the development phase.&lt;/p&gt;





&lt;p&gt;Now I understand the real value of testing, so I need to go deep into testing and need to learn testing.&lt;/p&gt;

&lt;p&gt;And I found out that the basic thinking of testing depends on AAA (Arrange, Act, and Assert).&lt;/p&gt;

&lt;p&gt;Think like this: these are the main pillars of testing.&lt;/p&gt;

&lt;p&gt;In testing, you first arrange your configuration related to the feature, define some inputs and dependencies.&lt;/p&gt;

&lt;p&gt;This is called Arrange.&lt;/p&gt;

&lt;p&gt;Then the next step is Act.&lt;/p&gt;

&lt;p&gt;In Act, you execute the behavior of the feature using the configuration you created in Arrange.&lt;/p&gt;

&lt;p&gt;Now the next step is Assert.&lt;/p&gt;

&lt;p&gt;Assert means verifying whether the output of the feature matches your expectation or not.&lt;/p&gt;





&lt;p&gt;Let’s take one example for that.&lt;/p&gt;

&lt;p&gt;I want to test my function &lt;code&gt;greaterOfTwoNumber()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Then my flow of the testing is like that:&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;// Arrange&lt;/span&gt;

&lt;span class="c1"&gt;// Import the Function for testing.&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&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;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Act&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="nf"&gt;greaterOfTwoNumber&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Assert&lt;/span&gt;

&lt;span class="nf"&gt;expect&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;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the most basic example of AAA.&lt;/p&gt; 

&lt;p&gt;In the first step, we do all the configuration like defining inputs and importing the dependencies and functions or features for the test.&lt;/p&gt; 

&lt;p&gt;Now in the next step, we do Act.&lt;/p&gt; 

&lt;p&gt;In Act, we execute the behavior of the function or feature, and in Assert, we check whether the output is as per our need or not.&lt;/p&gt; 

&lt;p&gt;If the output is not as per our need, then the test fails; if we have the correct output, then the test passes.&lt;/p&gt; 


 

&lt;p&gt;This is the basic overview of the testing.&lt;/p&gt; 

&lt;p&gt;If I am wrong in any section, please drop your thoughts in the comments. &lt;/p&gt; 

</description>
      <category>softwareengineering</category>
      <category>testing</category>
      <category>web</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Next step to client-side storage</title>
      <dc:creator>Neel-Vekariya</dc:creator>
      <pubDate>Sun, 23 Aug 2026 09:44:40 +0000</pubDate>
      <link>https://dev.to/neel-vekariya/next-step-to-client-side-storage-4g83</link>
      <guid>https://dev.to/neel-vekariya/next-step-to-client-side-storage-4g83</guid>
      <description>&lt;h2&gt;
  
  
  Next step to client-side storage
&lt;/h2&gt;

&lt;p&gt;In my past one blog, I wrote about how I improve the performance of the application using the local storage. And the problem local storage solves.&lt;/p&gt;

&lt;p&gt;But now I face another problem about the client storage. My project is simply about order management software for the rental clothing industry.&lt;/p&gt;

&lt;p&gt;In the rental clothing industry, Showrooms or small shops have a big problem. The problem starts when one order has a single or multiple items that are booked in a particular time range.&lt;/p&gt;

&lt;p&gt;Now, a second order wants the same item in between that particular time range. If, by mistake, the second order books that item, then the problem starts.&lt;/p&gt;

&lt;p&gt;The item is booked two times in that particular time range. That is called double booking of the item.&lt;/p&gt;

&lt;p&gt;This mistake is created by the use of traditional register booking. Now, when I need to store the items data, that is a small amount of data, so I simply use the local storage.&lt;/p&gt;

&lt;p&gt;But now I need another and a big storage for storing order details. I build two features: first one is for showing all the orders and second one is for showing the full order.&lt;/p&gt;

&lt;p&gt;To implement those features and to maintain the user experience, I decide to store a small amount of data about the order on the client side. First, I decide to store data in local storage.&lt;/p&gt;

&lt;p&gt;But to store data in the local storage is not a good option because the local storage is used for storing small details about the application, and storing order details in the local storage compromises the performance of the application.&lt;/p&gt;

&lt;p&gt;Now I want a new storage option for storing order details. And again I find out, and that is the IndexedDB.&lt;/p&gt;





&lt;p&gt;To integrate IndexedDB in my application, I want to learn about that storage. I search multiple videos about IndexedDB, but no one is teaching me properly.&lt;/p&gt;

&lt;p&gt;After finding hundreds of tutorials, I finally found one tutorial that is teaching properly how to integrate IndexedDB in the application. Now I want to share that learning with you.&lt;/p&gt;





&lt;p&gt;To integrate IndexedDB, we want to create first one database in IndexedDB. The &lt;code&gt;dbConnect&lt;/code&gt; is built for that and used to get the reference of the created database.&lt;/p&gt;

&lt;p&gt;To build that function, we want to create first two environment variables: &lt;code&gt;db_name&lt;/code&gt; and &lt;code&gt;version&lt;/code&gt;. Those two variables describe the name and the version of that database.&lt;/p&gt;

&lt;p&gt;If any updation happens in the version variable, then this function will execute and update the database.&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;dbConnect&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;const&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;indexedDB&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;db_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;version&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onupgradeneeded&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;const&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&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="c1"&gt;// Access the reference of the database.&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;keyPath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;autoIncrement&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="c1"&gt;// The payload is for creating a primary key.&lt;/span&gt;

    &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createObjectStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;orders&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Create the object that is called store in IndexedDB.&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onsuccess&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="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;Success&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;req&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="p"&gt;};&lt;/span&gt;

  &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onerror&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="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;Failed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, in the function, we create first one database and get the reference of that database. The &lt;code&gt;req.onupgradeneeded&lt;/code&gt; is an event for updating the database when the version variable is changed, then this event is run and updates the database.&lt;/p&gt; 

&lt;p&gt;The &lt;code&gt;req&lt;/code&gt; variable sends the request to open the database, and after the request is complete, we now have access to the database connection reference. The &lt;code&gt;payload&lt;/code&gt; is the rule for how the primary key of that particular store will be generated.&lt;/p&gt; 

&lt;p&gt;To create a store, first we access the result object, and in the result object, we use the &lt;code&gt;createObjectStore&lt;/code&gt; method. &lt;code&gt;onsuccess&lt;/code&gt; and &lt;code&gt;onerror&lt;/code&gt; are events that indicate the success or failure of the connection.&lt;/p&gt; 


 

&lt;p&gt;The function &lt;code&gt;dbConnect&lt;/code&gt; is an asynchronous function, so the next step is to convert this asynchronous function to a synchronous function. To create a synchronous function, we simply wrap this function into the promise.&lt;/p&gt;

&lt;p&gt;Let's do that.&lt;/p&gt; &lt;p&gt;We do this promise in the &lt;code&gt;req.onsuccess&lt;/code&gt; or &lt;code&gt;req.onerror&lt;/code&gt; event. If the &lt;code&gt;req&lt;/code&gt; is successful, we resolve the promise; otherwise, we reject the promise.&lt;/p&gt; 

&lt;p&gt;The updated event is:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onsuccess&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onerror&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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;dbConnect&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="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;indexedDB&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;db_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;version&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onupgradeneeded&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="p"&gt;};&lt;/span&gt;

    &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onsuccess&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="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&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="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onerror&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="nf"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now our function is converted into the synchronous function. Now, the next step we explore is how to store, update, read and delete the data.&lt;/p&gt; 

&lt;p&gt;In IndexedDB, all the operations are transactions. Means if any error happens, then all the started operations are undone.&lt;/p&gt; 


 

&lt;p&gt;Now the next step is to get knowledge about the permission. When we want to store or delete or update the data, the first step is to define the permission.&lt;/p&gt; &lt;p&gt;&lt;code&gt;readonly&lt;/code&gt;, &lt;code&gt;readwrite&lt;/code&gt; are the types of permission.&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;storeData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="k"&gt;try&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;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;dbConnect&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;transaction&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;transaction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;orders&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;readwrite&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Define the permission.&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt; &lt;span class="o"&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;Neel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;neel@gmail.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;

    &lt;span class="c1"&gt;// The data to store.&lt;/span&gt;

    &lt;span class="nx"&gt;transaction&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;objectStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;orders&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nx"&gt;transaction&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;oncomplete&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="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;Data Stored Successfully.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is all about storing the data. Now we learn about reading the data.&lt;/p&gt; &lt;p&gt;For reading the data, we use &lt;code&gt;readonly&lt;/code&gt; permission. The &lt;code&gt;getAll()&lt;/code&gt; function is used to get all the data, and &lt;code&gt;get()&lt;/code&gt; is used to get particular data.&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;readData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="k"&gt;try&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;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;dbConnect&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;transaction&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;transaction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;orders&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;readonly&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Define the permission.&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;transaction&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;objectStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;orders&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;getAll&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onsuccess&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="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;Data Fetched Successfully.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;request&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="p"&gt;};&lt;/span&gt;

  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




 &lt;p&gt;This is all about how to read the data. Now next, we learn how to update the data.&lt;/p&gt; &lt;p&gt;To update the data, we use the &lt;code&gt;readwrite&lt;/code&gt; permission.&lt;/p&gt;
&lt;br&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;updateData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="k"&gt;try&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;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;dbConnect&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;transaction&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;transaction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;orders&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;readwrite&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Define the permission.&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;transaction&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;objectStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;orders&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// In this store we do not use any function; either we get the reference.&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Get old data.&lt;/span&gt;

    &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onsuccess&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;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&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="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&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;payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;data&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;Jay&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Jay@gmail.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="p"&gt;};&lt;/span&gt;

      &lt;span class="c1"&gt;// Only change name and email and other data store as it is.&lt;/span&gt;

      &lt;span class="nx"&gt;store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;put&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is all about how to update the data. Now next, we learn how to delete the data.&lt;/p&gt; 

&lt;p&gt;To delete the data, we use the &lt;code&gt;.delete()&lt;/code&gt; method.&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;deleteData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="k"&gt;try&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;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;dbConnect&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;transaction&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;transaction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;orders&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;readwrite&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Define the permission.&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;transaction&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;objectStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;orders&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// In this store we do not use any function; either we get the reference.&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Delete data.&lt;/span&gt;

  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




 

&lt;p&gt;Now we successfully implemented the IndexedDB in our project.&lt;/p&gt; 

&lt;p&gt;If I made any mistake, then share my mistake in the comments.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>frontend</category>
      <category>node</category>
      <category>software</category>
    </item>
    <item>
      <title>Then My Project Needed This</title>
      <dc:creator>Neel-Vekariya</dc:creator>
      <pubDate>Sat, 15 Aug 2026 07:33:22 +0000</pubDate>
      <link>https://dev.to/neel-vekariya/then-my-project-needed-this-3fep</link>
      <guid>https://dev.to/neel-vekariya/then-my-project-needed-this-3fep</guid>
      <description>&lt;h2&gt;
  
  
  Finally, I Integrated the Multiselect Autocomplete Dropdown
&lt;/h2&gt;

&lt;p&gt;In the past few months, I learned a lot of things and also made a project after many retries. The project taught me many important concepts that I didn’t know after learning languages, frameworks, or even in lectures.&lt;/p&gt;

&lt;p&gt;These were concepts that I only came across when I wanted to use them in my project or when I faced some issues. The Multiselect Autocomplete Dropdown is one of the concepts that I didn’t learn when I was actually in the learning phase, but I learned it when I was building something on top of my learnings.&lt;/p&gt;





&lt;p&gt;In my project, I wanted a feature in the frontend where a user could send me multiple-selected values of one field, and I also wanted that field to be searchable and autocomplete.&lt;/p&gt;

&lt;p&gt;Then I noticed that this type of feature is also provided in HTML with the &lt;code&gt;select&lt;/code&gt; tag, but there was an exception with this tag, and the exception was that the tag is not searchable and does not support multiple values.&lt;/p&gt;

&lt;p&gt;So, I needed a different solution, and I wanted to figure out that solution.&lt;/p&gt;





&lt;p&gt;In the age of AI, finding a solution is very easy, but the difficult part was integrating it into my project.&lt;/p&gt;

&lt;p&gt;I found the solution with the help of AI, and now the next step is to integrate it into my project.&lt;/p&gt;





&lt;p&gt;I think this type of feature is learned only for a purpose. The topic is learned when the functionality is needed.&lt;/p&gt;

&lt;p&gt;When the topic is learned only for the purpose of learning, then the topic is not available in the course we want to learn from, documentation, or some video where the topic is not fully explained.&lt;/p&gt;

&lt;p&gt;In this case, I faced the same problem.&lt;/p&gt;





&lt;p&gt;If you face the same problem, please share your experience in the comments.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Finally I access The Child Element</title>
      <dc:creator>Neel-Vekariya</dc:creator>
      <pubDate>Tue, 11 Aug 2026 04:21:58 +0000</pubDate>
      <link>https://dev.to/neel-vekariya/finally-i-access-the-child-element-29al</link>
      <guid>https://dev.to/neel-vekariya/finally-i-access-the-child-element-29al</guid>
      <description>&lt;p&gt;
Recently, if you read my little weird blogs, you know I learn &lt;b&gt;React.js&lt;/b&gt; and build one project.
In the project, I made many mistakes like creating a complex component structure.
Later I removed all components and made a clear folder structure.
&lt;/p&gt;

&lt;p&gt;
I created cards that did not show data, and I don’t know why.
And so on.
But one problem came when I used the React-Hook-Forms and my custom input field.
&lt;/p&gt;





&lt;p&gt;
This problem gave me more knowledge as well as an idea about how react-hook-form works.
The problem is like this.
When I want to access the child component from the parent component to access the data entered by the user.
&lt;/p&gt;

&lt;p&gt;
That gave me &lt;b&gt;undefined instead of the value&lt;/b&gt; which was passed by the user.
I was not able to find out why that happened.
Later I found out that my parent element does not have access to the input field.
That is the problem.
&lt;/p&gt;





&lt;p&gt;
Now I don’t know why the parent element does not access the child element.
In the parent element, I did not make a mistake in using the child element.
Then why did that happen.
&lt;/p&gt;

&lt;p&gt;
Subsequently, I found out that the &lt;b&gt;register&lt;/b&gt; which is used for accessing the value from the child element sends one ref to the child element.
But I did not define that or use that.
Now I found out the method that is used to pass reference to the child component.
&lt;/p&gt;





&lt;p&gt;
React provides a higher order function named &lt;b&gt;forwardRef&lt;/b&gt; to solve the problem of passing the reference to the child component.
The forwardRef is not needed in a normal input or select field.
&lt;/p&gt;

&lt;p&gt;
The custom component built for reusability blocks the reference.
In this situation, we need a service that passes the reference from the parent to the child component.
&lt;/p&gt;

&lt;p&gt;
The service is provided by the higher order function &lt;b&gt;forwardRef&lt;/b&gt;.
To use forwardRef in the custom component, you need to import it from React.
And pass it as a secondary separate parameter ref in the function.
&lt;/p&gt;

&lt;p&gt;
Now pass this parameter as a &lt;b&gt;ref property&lt;/b&gt; in the custom input component.
And wrap your exported component in &lt;b&gt;forwardRef&lt;/b&gt;.
Now you have access to the child component in the parent.
&lt;/p&gt;

&lt;p&gt;
And also have the value which is passed in your child component.
Now this function solved my problem of passing undefined value.
&lt;/p&gt;





&lt;p&gt;
If I have done something wrong, please let me know in the comments.
&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>frontend</category>
      <category>react</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
