<?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>Forem: Vaibhav Bahuguna</title>
    <description>The latest articles on Forem by Vaibhav Bahuguna (@vaibhav423).</description>
    <link>https://forem.com/vaibhav423</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%2F2815609%2Fa63cc142-6baa-43f2-be62-1c9d141d9617.jpg</url>
      <title>Forem: Vaibhav Bahuguna</title>
      <link>https://forem.com/vaibhav423</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/vaibhav423"/>
    <language>en</language>
    <item>
      <title>MongoDB Concepts</title>
      <dc:creator>Vaibhav Bahuguna</dc:creator>
      <pubDate>Sun, 16 Mar 2025 15:12:28 +0000</pubDate>
      <link>https://forem.com/vaibhav423/mongodb-concepts-3229</link>
      <guid>https://forem.com/vaibhav423/mongodb-concepts-3229</guid>
      <description>&lt;h3&gt;
  
  
  🚀 Mastering MongoDB Concepts for Web Technologies
&lt;/h3&gt;




&lt;p&gt;MongoDB is the backbone of &lt;strong&gt;MERN Stack applications&lt;/strong&gt;, and understanding it is crucial for &lt;strong&gt;building scalable applications&lt;/strong&gt; and &lt;strong&gt;acing interviews&lt;/strong&gt;. Here’s a &lt;strong&gt;quick guide&lt;/strong&gt; covering all essential concepts! 👇  &lt;/p&gt;

&lt;h3&gt;
  
  
  🔹 &lt;strong&gt;1. MongoDB Basics&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;✔ &lt;strong&gt;NoSQL Database&lt;/strong&gt; – Stores data in JSON-like &lt;strong&gt;BSON&lt;/strong&gt; format.&lt;br&gt;&lt;br&gt;
✔ &lt;strong&gt;Collections &amp;amp; Documents&lt;/strong&gt; – Similar to SQL tables &amp;amp; rows, but flexible.  &lt;/p&gt;
&lt;h3&gt;
  
  
  🔹 &lt;strong&gt;2. CRUD Operations&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;✔ &lt;strong&gt;Create&lt;/strong&gt; – &lt;code&gt;db.users.insertOne({ name: "Alice" })&lt;/code&gt;&lt;br&gt;&lt;br&gt;
✔ &lt;strong&gt;Read&lt;/strong&gt; – &lt;code&gt;db.users.find({ age: { $gt: 20 } })&lt;/code&gt;&lt;br&gt;&lt;br&gt;
✔ &lt;strong&gt;Update&lt;/strong&gt; – &lt;code&gt;db.users.updateOne({ name: "Alice" }, { $set: { age: 30 } })&lt;/code&gt;&lt;br&gt;&lt;br&gt;
✔ &lt;strong&gt;Delete&lt;/strong&gt; – &lt;code&gt;db.users.deleteOne({ name: "Alice" })&lt;/code&gt;  &lt;/p&gt;
&lt;h3&gt;
  
  
  🔹 &lt;strong&gt;3. Indexing for Performance&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;✔ Speed up queries using indexes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createIndex&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="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔹 &lt;strong&gt;4. Aggregation Framework&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;✔ Used for data analytics &amp;amp; reporting.&lt;br&gt;&lt;br&gt;
✔ Example: &lt;strong&gt;Count users by age&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;aggregate&lt;/span&gt;&lt;span class="p"&gt;([{&lt;/span&gt; &lt;span class="na"&gt;$group&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;$age&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;$sum&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="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;
  
  
  🔹 &lt;strong&gt;5. Relationships: Embed vs. Reference&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;✔ &lt;strong&gt;Embed&lt;/strong&gt;: Store related data in the same document (faster reads).&lt;br&gt;&lt;br&gt;
✔ &lt;strong&gt;Reference&lt;/strong&gt;: Store ObjectIDs to avoid redundancy (normalized).  &lt;/p&gt;
&lt;h3&gt;
  
  
  🔹 &lt;strong&gt;6. Transactions for Atomic Operations&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;✔ Use &lt;strong&gt;Mongoose transactions&lt;/strong&gt; when updating multiple documents:&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;session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;mongoose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startSession&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startTransaction&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="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateOne&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;userId&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;balance&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;session&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;commitTransaction&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;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;abortTransaction&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;finally&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;endSession&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;
  
  
  🔹 &lt;strong&gt;7. MongoDB in MERN Stack&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;✔ &lt;strong&gt;Connect MongoDB to Node.js&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="nx"&gt;mongoose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mongodb://localhost:27017/myDB&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✔ &lt;strong&gt;Build APIs with Express.js&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/users&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&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;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;users&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;
  
  
  🔹 &lt;strong&gt;8. MongoDB Optimization &amp;amp; Best Practices&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;✅ Use &lt;strong&gt;Indexes&lt;/strong&gt; for faster queries.&lt;br&gt;&lt;br&gt;
✅ Use &lt;strong&gt;Aggregation&lt;/strong&gt; for analytics and reporting.&lt;br&gt;
✅ Use &lt;strong&gt;Projection&lt;/strong&gt; to fetch only required fields.&lt;br&gt;&lt;br&gt;
✅ Use &lt;strong&gt;Pagination&lt;/strong&gt; with &lt;code&gt;.limit()&lt;/code&gt; and &lt;code&gt;.skip()&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
✅ Choose between &lt;strong&gt;Embedding vs. Referencing&lt;/strong&gt; wisely.  &lt;/p&gt;

&lt;h3&gt;
  
  
  🔥 Common &lt;strong&gt;Interview Questions&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;🔹 How does MongoDB differ from SQL?&lt;br&gt;&lt;br&gt;
🔹 What is the use of indexing in MongoDB?&lt;br&gt;&lt;br&gt;
🔹 How would you design a &lt;strong&gt;scalable database&lt;/strong&gt; in MongoDB?&lt;br&gt;&lt;br&gt;
🔹 How do &lt;strong&gt;transactions&lt;/strong&gt; work in MongoDB?  &lt;/p&gt;




&lt;p&gt;💬 Have any doubts? Drop them in the comments! Let's discuss. 👇  &lt;/p&gt;

</description>
      <category>database</category>
      <category>mongodb</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>My LeetCode Experience</title>
      <dc:creator>Vaibhav Bahuguna</dc:creator>
      <pubDate>Mon, 17 Feb 2025 07:13:55 +0000</pubDate>
      <link>https://forem.com/vaibhav423/my-leetcode-experience-1jm7</link>
      <guid>https://forem.com/vaibhav423/my-leetcode-experience-1jm7</guid>
      <description>&lt;p&gt;🔥 &lt;strong&gt;My LeetCode Experience: From Fibonacci to Dynamic Programming&lt;/strong&gt; 🔥  &lt;/p&gt;

&lt;p&gt;When I first started tackling LeetCode problems, even the basics like &lt;strong&gt;Fibonacci&lt;/strong&gt; and &lt;strong&gt;Two Sum&lt;/strong&gt; felt like climbing a mountain. But with consistent practice and a structured approach, I began to see patterns, improve my problem-solving skills, and build confidence. Over time, I explored advanced topics like &lt;strong&gt;recursion&lt;/strong&gt;, &lt;strong&gt;backtracking&lt;/strong&gt;, &lt;strong&gt;dynamic programming (DP)&lt;/strong&gt;, &lt;strong&gt;union-find&lt;/strong&gt;, and &lt;strong&gt;tree-based algorithms&lt;/strong&gt;, solidifying my understanding of data structures and algorithms.  &lt;/p&gt;

&lt;p&gt;Here’s how I transformed my LeetCode journey from overwhelming to empowering—and how you can too!  &lt;/p&gt;




&lt;h3&gt;
  
  
  🚀 &lt;strong&gt;My Process for Solving LeetCode Problems&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;1️⃣ &lt;strong&gt;Read the question twice&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First, read to understand the problem.
&lt;/li&gt;
&lt;li&gt;Second, read to identify inputs, outputs, and edge cases.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2️⃣ &lt;strong&gt;Brainstorm multiple approaches&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Think about brute force first, then optimize.
&lt;/li&gt;
&lt;li&gt;Consider time and space complexity for each approach.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3️⃣ &lt;strong&gt;Think end-to-end&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visualize the flow: inputs → processing → outputs.
&lt;/li&gt;
&lt;li&gt;Anticipate edge cases (e.g., empty inputs, large datasets).
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4️⃣ &lt;strong&gt;Write a clear algorithm&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pseudocode or step-by-step plan before coding.
&lt;/li&gt;
&lt;li&gt;This helps avoid getting stuck mid-implementation.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;5️⃣ &lt;strong&gt;Code the solution&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Start with the simplest approach, then refine.
&lt;/li&gt;
&lt;li&gt;Keep the code clean and readable.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;6️⃣ &lt;strong&gt;Analyze the approach&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After solving, reflect: What worked? What didn’t?
&lt;/li&gt;
&lt;li&gt;Could the solution be more efficient?
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;7️⃣ &lt;strong&gt;Explore alternative solutions&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Look at other submissions or discuss with peers.
&lt;/li&gt;
&lt;li&gt;Learn from optimized solutions to improve your skills.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔥 &lt;strong&gt;Lessons Learned Along the Way&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;✅ &lt;strong&gt;Consistency beats intensity&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Solving a few problems daily is better than cramming.
&lt;/li&gt;
&lt;li&gt;Small, consistent efforts compound over time.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;✅ &lt;strong&gt;Pattern recognition is key&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Most problems fall into familiar categories (e.g., sliding window, two pointers, DP).
&lt;/li&gt;
&lt;li&gt;Recognizing these patterns speeds up problem-solving.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;✅ &lt;strong&gt;Failure isn’t the end—it’s a lesson&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Debugging and learning from mistakes is part of the process.
&lt;/li&gt;
&lt;li&gt;Every error is an opportunity to grow.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  💡 &lt;strong&gt;Why I Keep Going&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;A couple of months ago, seeing a wall of errors was frustrating. Today? It’s just another puzzle to solve. Progress isn’t always about getting the right answer immediately—it’s about learning how to think.  &lt;/p&gt;

&lt;p&gt;I used to struggle alone, thinking I had to figure out everything myself. But I’ve realized that struggling endlessly isn’t a badge of honor—&lt;strong&gt;learning is&lt;/strong&gt;. Ask for help, debug, optimize, and repeat.  &lt;/p&gt;

&lt;p&gt;Every problem solved is a step forward, and I’m here for the grind. 💪🔥  &lt;/p&gt;




&lt;h3&gt;
  
  
  🛠️ &lt;strong&gt;Tools and Resources That Helped Me&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;LeetCode Discuss Section&lt;/strong&gt;: Great for understanding alternative approaches.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NeetCode&lt;/strong&gt;: Structured problem sets and video explanations.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cracking the Coding Interview&lt;/strong&gt;: A classic book for mastering DSA.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visualgo&lt;/strong&gt;: Visualizing algorithms made concepts click for me.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🌟 &lt;strong&gt;My Progress So Far&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;148+ problems solved&lt;/strong&gt;, ranging from Easy to Hard.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Concepts mastered&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Dynamic Programming (Knapsack, Coin Change)
&lt;/li&gt;
&lt;li&gt;Graph Traversal (BFS, DFS)
&lt;/li&gt;
&lt;li&gt;Tree Algorithms (BST, Trie, Heaps)
&lt;/li&gt;
&lt;li&gt;Sliding Window, Two Pointers, and more!
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  🚨 &lt;strong&gt;Final Thoughts&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;LeetCode isn’t just about acing interviews—it’s about building a problem-solving mindset. Whether you’re just starting or already deep into your journey, remember: &lt;strong&gt;progress takes time, but every step counts&lt;/strong&gt;.  &lt;/p&gt;

&lt;p&gt;Keep grinding, keep learning, and most importantly, enjoy the process!  &lt;/p&gt;




&lt;p&gt;What’s your LeetCode journey been like? Share your tips, struggles, and wins in the comments below! Let’s grow together. 💬👇  &lt;/p&gt;

</description>
      <category>leetcode</category>
      <category>programming</category>
      <category>dsa</category>
      <category>java</category>
    </item>
    <item>
      <title>Understanding Event Propagation in JavaScript</title>
      <dc:creator>Vaibhav Bahuguna</dc:creator>
      <pubDate>Tue, 04 Feb 2025 16:12:13 +0000</pubDate>
      <link>https://forem.com/vaibhav423/understanding-event-propagation-in-javascript-44ag</link>
      <guid>https://forem.com/vaibhav423/understanding-event-propagation-in-javascript-44ag</guid>
      <description>&lt;p&gt;JavaScript events play a crucial role in interactive web applications. Understanding &lt;strong&gt;event propagation&lt;/strong&gt; helps developers manage how events travel through the DOM. Let's break down event propagation and its related concepts.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. &lt;strong&gt;Event Propagation&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Event propagation determines how events traverse the DOM tree. It consists of three phases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Capturing Phase&lt;/strong&gt;: The event starts from the &lt;code&gt;window&lt;/code&gt; and moves down the DOM tree to the target element.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Target Phase&lt;/strong&gt;: The event reaches the target element where it was triggered.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bubbling Phase&lt;/strong&gt;: The event bubbles up from the target element back to the &lt;code&gt;window&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. &lt;strong&gt;Event Bubbling&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;In the bubbling phase, the event starts from the target element and propagates upwards through its ancestors.&lt;/li&gt;
&lt;li&gt;Example: Clicking a &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; inside a &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; first triggers the event on the button (target phase), then on the &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;, and so on.&lt;/li&gt;
&lt;li&gt;To stop bubbling, use:
&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="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stopPropagation&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  3. &lt;strong&gt;Event Capturing (Trickling)&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The opposite of bubbling, where the event moves from the &lt;code&gt;window&lt;/code&gt; down to the target element.&lt;/li&gt;
&lt;li&gt;Capturing can be enabled by setting the third parameter of &lt;code&gt;addEventListener&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;:
&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="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;handler&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  4. &lt;strong&gt;event.target&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;event.target&lt;/code&gt; refers to the element on which the event originally occurred.&lt;/li&gt;
&lt;li&gt;Example:
&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="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;click&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;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="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;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tagName&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  5. &lt;strong&gt;this.tagName&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;this.tagName&lt;/code&gt; points to the parent element on which the function is called, similar to &lt;code&gt;event.currentTarget&lt;/code&gt;.
&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="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="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="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tagName&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;h2&gt;
  
  
  6. &lt;strong&gt;event.currentTarget&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;event.currentTarget&lt;/code&gt; refers to the element that is handling the event.&lt;/li&gt;
&lt;li&gt;Example:
&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="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;click&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;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="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;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;currentTarget&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tagName&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  7. &lt;strong&gt;Event Capturing and Trickling&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Capturing (or trickling) describes the initial phase where an event moves from the &lt;code&gt;window&lt;/code&gt; down to the target element.&lt;/li&gt;
&lt;li&gt;Enabled by setting &lt;code&gt;useCapture&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt; in &lt;code&gt;addEventListener&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Example Code
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"parent"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"child"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Click Me&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;parent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;parent&lt;/span&gt;&lt;span class="dl"&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;child&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;child&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Capturing phase&lt;/span&gt;
  &lt;span class="nx"&gt;parent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;click&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;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="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="s1"&gt;Capturing - Parent:&lt;/span&gt;&lt;span class="dl"&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="nx"&gt;currentTarget&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tagName&lt;/span&gt;&lt;span class="p"&gt;);&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="nx"&gt;child&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;click&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;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="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="s1"&gt;Capturing - Child:&lt;/span&gt;&lt;span class="dl"&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="nx"&gt;currentTarget&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tagName&lt;/span&gt;&lt;span class="p"&gt;);&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;// Order: parent → child&lt;/span&gt;

  &lt;span class="c1"&gt;// Bubbling phase&lt;/span&gt;
  &lt;span class="nx"&gt;parent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;click&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;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="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="s1"&gt;Bubbling - Parent:&lt;/span&gt;&lt;span class="dl"&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="nx"&gt;currentTarget&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="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="nx"&gt;child&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;click&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;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="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="s1"&gt;Target - Child:&lt;/span&gt;&lt;span class="dl"&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="nx"&gt;currentTarget&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="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="c1"&gt;// Order: child → parent&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Key Differences
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Property/Method&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;event.target&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The element where the event originated.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;event.currentTarget&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The element to which the event handler is attached.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;event.stopPropagation()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stops the event from propagating further.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;event.preventDefault()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Prevents the default behavior of an event (e.g., form submission).&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Event propagation&lt;/strong&gt; has three phases: capturing, target, and bubbling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bubbling&lt;/strong&gt; is the default behavior where events move upward.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Capturing&lt;/strong&gt; enables events to travel downward first.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;event.target&lt;/code&gt; refers to the event's originating element.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;event.currentTarget&lt;/code&gt; refers to the element handling the event.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;addEventListener&lt;/code&gt; with &lt;code&gt;true&lt;/code&gt; for capturing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mastering these concepts will help you handle JavaScript events efficiently! 🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>career</category>
    </item>
    <item>
      <title>.Store - E-Commerce Application</title>
      <dc:creator>Vaibhav Bahuguna</dc:creator>
      <pubDate>Tue, 04 Feb 2025 15:46:08 +0000</pubDate>
      <link>https://forem.com/vaibhav423/store-e-commerce-application-3oic</link>
      <guid>https://forem.com/vaibhav423/store-e-commerce-application-3oic</guid>
      <description>&lt;h2&gt;
  
  
  🌟 Introduction
&lt;/h2&gt;

&lt;p&gt;Welcome to &lt;strong&gt;.Store&lt;/strong&gt;, an advanced, full-featured &lt;strong&gt;E-Commerce application&lt;/strong&gt; built with the &lt;strong&gt;MERN Stack&lt;/strong&gt; (MongoDB, Express, React, Node.js). Whether you're a developer looking for inspiration or a business owner seeking a scalable online store, this project has everything you need!&lt;/p&gt;

&lt;h3&gt;
  
  
  💻 Live Demo: &lt;a href="https://storeapp-f8uo.onrender.com/" rel="noopener noreferrer"&gt;Try it Now&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;This platform allows seamless product browsing, filtering, sorting, cart management, and secure payment processing—all with an intuitive and modern UI. Plus, administrators get full control with a robust dashboard for managing products, users, and orders.&lt;/p&gt;




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

&lt;h3&gt;
  
  
  🛡️ Authentication &amp;amp; Security
&lt;/h3&gt;

&lt;p&gt;🔹 &lt;strong&gt;User Authentication&lt;/strong&gt; – Secure login and registration using &lt;strong&gt;JWT-based authentication&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
🔹 &lt;strong&gt;Password Encryption&lt;/strong&gt; – User credentials are safely stored using &lt;strong&gt;bcrypt&lt;/strong&gt;  &lt;/p&gt;

&lt;h3&gt;
  
  
  🛍️ Shopping &amp;amp; Cart
&lt;/h3&gt;

&lt;p&gt;🛒 &lt;strong&gt;Browse Products&lt;/strong&gt; – Explore a variety of items with real-time search and filtering&lt;br&gt;&lt;br&gt;
🛍️ &lt;strong&gt;Cart Management&lt;/strong&gt; – Add, remove, and update items in the cart&lt;br&gt;&lt;br&gt;
📦 &lt;strong&gt;Order Tracking&lt;/strong&gt; – Keep an eye on your order history &amp;amp; status  &lt;/p&gt;

&lt;h3&gt;
  
  
  💳 Payments &amp;amp; Transactions
&lt;/h3&gt;

&lt;p&gt;💰 &lt;strong&gt;Integrated Payment Gateway&lt;/strong&gt; – Secure online transactions using &lt;strong&gt;Stripe/PayPal&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
🎯 &lt;strong&gt;Real-Time Order Processing&lt;/strong&gt; – Instant confirmation and updates for a seamless experience  &lt;/p&gt;

&lt;h3&gt;
  
  
  📊 Admin Dashboard
&lt;/h3&gt;

&lt;p&gt;🛠️ &lt;strong&gt;Product Management&lt;/strong&gt; – Add, update, or delete products from an intuitive interface&lt;br&gt;&lt;br&gt;
📋 &lt;strong&gt;Order Control&lt;/strong&gt; – Manage user orders and update statuses&lt;br&gt;&lt;br&gt;
📈 &lt;strong&gt;User Management&lt;/strong&gt; – Keep track of customers and their activities  &lt;/p&gt;

&lt;h3&gt;
  
  
  🔥 Modern UI &amp;amp; UX
&lt;/h3&gt;

&lt;p&gt;🎨 &lt;strong&gt;Responsive Design&lt;/strong&gt; – Fully optimized for mobile, tablet, and desktop&lt;br&gt;&lt;br&gt;
✨ &lt;strong&gt;Notifications&lt;/strong&gt; – Real-time updates using &lt;strong&gt;Toastify&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
🧐 &lt;strong&gt;Advanced Search &amp;amp; Filters&lt;/strong&gt; – Easily find what you need with dynamic filters  &lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Tech Stack &amp;amp; Tools
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt;: React, Redux, Tailwind CSS, Bootstrap, Ant Design (antd)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend&lt;/strong&gt;: Node.js, Express.js
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database&lt;/strong&gt;: MongoDB
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Payment Gateway&lt;/strong&gt;: Stripe/PayPal
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Other Libraries &amp;amp; Tools&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;JWT&lt;/strong&gt; – Secure authentication&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Axios&lt;/strong&gt; – API request handling&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multer&lt;/strong&gt; – File uploads (e.g., product images)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Moment.js&lt;/strong&gt; – Date/time formatting&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Colors&lt;/strong&gt; – Enhanced terminal styling&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;dotenv&lt;/strong&gt; – Environment variable management&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  📌 Why You Should Check This Out
&lt;/h2&gt;

&lt;p&gt;✅ &lt;strong&gt;Scalable Architecture&lt;/strong&gt; – Built for performance &amp;amp; easy expansion&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Real-World Use Case&lt;/strong&gt; – Implements best practices for modern eCommerce&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Open Source&lt;/strong&gt; – Modify and contribute to improve it further!  &lt;/p&gt;




&lt;h2&gt;
  
  
  🏆 Acknowledgments
&lt;/h2&gt;

&lt;p&gt;📌 The product data used in this project was sourced from &lt;strong&gt;Zara&lt;/strong&gt; for demonstration purposes only.&lt;br&gt;&lt;br&gt;
📌 Inspired by &lt;strong&gt;modern eCommerce giants&lt;/strong&gt; like Amazon &amp;amp; Flipkart.&lt;/p&gt;

&lt;p&gt;💬 &lt;strong&gt;Have feedback or suggestions? Drop a comment below!&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
🚀 &lt;strong&gt;Let’s build something amazing together!&lt;/strong&gt;&lt;/p&gt;

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