<?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: Drishti Saraf</title>
    <description>The latest articles on DEV Community by Drishti Saraf (@drishti1920).</description>
    <link>https://dev.to/drishti1920</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%2F1162010%2F9124dc81-1457-4634-ae0a-e7c9ee33468d.jpg</url>
      <title>DEV Community: Drishti Saraf</title>
      <link>https://dev.to/drishti1920</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/drishti1920"/>
    <language>en</language>
    <item>
      <title>Introducing DevTools Hub: All Your Developer Utilities in One Place</title>
      <dc:creator>Drishti Saraf</dc:creator>
      <pubDate>Fri, 09 May 2025 10:35:31 +0000</pubDate>
      <link>https://dev.to/drishti1920/introducing-devtools-hub-all-your-developer-utilities-in-one-place-18h8</link>
      <guid>https://dev.to/drishti1920/introducing-devtools-hub-all-your-developer-utilities-in-one-place-18h8</guid>
      <description>&lt;p&gt;In the fast-paced world of web development, context switching is a productivity killer. One tab for formatting JSON. Another for decoding JWTs. A third for converting colors...&lt;/p&gt;

&lt;p&gt;Before you know it, you’ve got a browser filled with a dozen tabs — and zero focus.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;That’s exactly the problem DevTools Hub solves.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 What is DevTools Hub?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;DevTools Hub&lt;/strong&gt; is a free, web-based toolkit that brings together a curated collection of essential utilities for developers, designers, and tech enthusiasts — all in one clean, fast, and distraction-free interface.&lt;/p&gt;

&lt;p&gt;No ads. No signups. Just tools.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🧠 Perfect for: Frontend devs, backend engineers, UI/UX designers, and students.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🔧 Tools Available
&lt;/h2&gt;

&lt;p&gt;Here's what you can use today:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔐 &lt;strong&gt;JWT Decoder&lt;/strong&gt; – View the payload of any JSON Web Token&lt;/li&gt;
&lt;li&gt;🧮 &lt;strong&gt;JSON Formatter&lt;/strong&gt; – Beautify and validate JSON&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;UUID Generator&lt;/strong&gt; – Create version 4 UUIDs&lt;/li&gt;
&lt;li&gt;🧾 &lt;strong&gt;Base64 Encoder/Decoder&lt;/strong&gt; – Convert text to/from Base64&lt;/li&gt;
&lt;li&gt;🎨 &lt;strong&gt;Color Converter&lt;/strong&gt; – HEX ⇄ RGB ⇄ HSL&lt;/li&gt;
&lt;li&gt;🧹 &lt;strong&gt;Code Minifier&lt;/strong&gt; – Minify HTML, CSS, and JavaScript&lt;/li&gt;
&lt;li&gt;🗃️ &lt;strong&gt;Regex Tester&lt;/strong&gt; – Debug your regular expressions&lt;/li&gt;
&lt;li&gt;📄 &lt;strong&gt;Lorem Ipsum Generator&lt;/strong&gt; – Generate dummy content&lt;/li&gt;
&lt;li&gt;⚙️ ...with more tools coming soon!&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧠 Why DevTools Hub?
&lt;/h2&gt;

&lt;p&gt;✅ &lt;strong&gt;Lightning Fast&lt;/strong&gt; – Built with Vite and React&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Clean UI&lt;/strong&gt; – No clutter, no distractions&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Tailored for Devs&lt;/strong&gt; – Only the tools you actually use&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Free Forever&lt;/strong&gt; – And we're working on open-sourcing it too!&lt;/p&gt;




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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt;: Vite + React + TypeScript
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Styling&lt;/strong&gt;: TailwindCSS
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hosting&lt;/strong&gt;: Netlify (can also run on GitHub Pages)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance&lt;/strong&gt;: Optimized for speed and usability
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🌐 Try DevTools Hub Now
&lt;/h2&gt;

&lt;p&gt;➡️ &lt;a href="https://dev-tool-hub.netlify.app/" rel="noopener noreferrer"&gt;Visit DevTools Hub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No login required. Just bookmark it and go.&lt;/p&gt;




&lt;h2&gt;
  
  
  🤝 Join the Journey
&lt;/h2&gt;

&lt;p&gt;If you're a developer who believes in simple tools done right, we’d love your feedback! Drop feature suggestions, connect with us on LinkedIn, or contribute once we open source.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🚀 &lt;strong&gt;DevTools Hub&lt;/strong&gt; – Because your developer tools deserve a better home.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;em&gt;Thanks for reading! Feel free to like, comment, or share if you found this useful. Happy coding!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>productivity</category>
      <category>react</category>
    </item>
    <item>
      <title>📦 How I Published My First npm Package: `how-much-time-ago`</title>
      <dc:creator>Drishti Saraf</dc:creator>
      <pubDate>Fri, 25 Apr 2025 06:27:53 +0000</pubDate>
      <link>https://dev.to/drishti1920/how-i-published-my-first-npm-package-how-much-time-ago-nmo</link>
      <guid>https://dev.to/drishti1920/how-i-published-my-first-npm-package-how-much-time-ago-nmo</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vkcqorw7hcywsidyzya.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vkcqorw7hcywsidyzya.png" alt="npm" width="800" height="400"&gt;&lt;/a&gt;I've always wondered how to publish a package on npm.&lt;/p&gt;

&lt;p&gt;It seemed like one of those things “real devs” did — and I wasn’t sure where to start. But this week, I finally did it! I created and published my very first npm package: &lt;a href="https://www.npmjs.com/package/how-much-time-ago" rel="noopener noreferrer"&gt;&lt;code&gt;how-much-time-ago&lt;/code&gt;&lt;/a&gt; — a tiny utility that converts dates or timestamps into human-readable relative time strings like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;just now&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;2 minutes ago&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;3 days ago&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;1 year ago&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this post, I’ll walk you through how I built and published it — step by step — so if you’ve ever been curious about sharing your own code on npm, this is for you.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 The Idea
&lt;/h2&gt;

&lt;p&gt;I wanted a simple way to show relative times like “5 minutes ago” or “2 days ago” in my projects. There are libraries out there, but I wanted something &lt;strong&gt;lightweight&lt;/strong&gt;, &lt;strong&gt;dependency-free&lt;/strong&gt;, and easy to use in both Node.js and frontend apps.&lt;/p&gt;

&lt;p&gt;So I wrote it myself.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔧 Step-by-Step: Publishing an npm Package
&lt;/h2&gt;

&lt;p&gt;Here’s exactly how I did it — and how you can too.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Create Your Project Folder
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;how-much-time-ago &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;how-much-time-ago
npm init &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Update your &lt;code&gt;package.json&lt;/code&gt; with a good name, description, and author info:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"how-much-time-ago"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"A lightweight utility to show relative time like '2 hours ago'"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"main"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"index.js"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  2. Write Your Utility Code
&lt;/h3&gt;

&lt;p&gt;Here’s a minimal version of what’s inside &lt;code&gt;index.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function howMuchTimeAgo(input) {
  const date = new Date(input);
  const seconds = Math.floor((Date.now() - date.getTime()) / 1000);

  const intervals = {
    year: 31536000,
    month: 2592000,
    day: 86400,
    hour: 3600,
    minute: 60,
  };

  for (let [unit, value] of Object.entries(intervals)) {
    const count = Math.floor(seconds / value);
    if (count &amp;gt;= 1) return `${count} ${unit}${count &amp;gt; 1 ? 's' : ''} ago`;
  }

  return seconds &amp;lt; 10 ? 'just now' : `${seconds} seconds ago`;
}

module.exports = howMuchTimeAgo;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  3. Add a README.md
&lt;/h3&gt;

&lt;p&gt;Write a clear README so other devs can understand and use your package easily:&lt;/p&gt;

&lt;h1&gt;
  
  
  how-much-time-ago
&lt;/h1&gt;

&lt;p&gt;🕒 A tiny utility to convert dates or timestamps into human-readable relative time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install how-much-time-ago
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const timeAgo = require('how-much-time-ago');

console.log(timeAgo(new Date(Date.now() - 90 * 1000))); // "1 minute ago"
console.log(timeAgo('2023-01-01')); // "1 year ago"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Output Examples
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;just now&lt;/li&gt;
&lt;li&gt;30 seconds ago&lt;/li&gt;
&lt;li&gt;5 minutes ago&lt;/li&gt;
&lt;li&gt;3 hours ago&lt;/li&gt;
&lt;li&gt;2 days ago&lt;/li&gt;
&lt;li&gt;6 months ago&lt;/li&gt;
&lt;li&gt;1 year ago&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4. Login and Publish to npm
&lt;/h3&gt;

&lt;p&gt;First, login (create an npm account if you don’t have one):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then publish your package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm publish
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it! Your package is live 🚀&lt;br&gt;&lt;br&gt;
👉 &lt;a href="https://www.npmjs.com/package/how-much-time-ago" rel="noopener noreferrer"&gt;View it on npm&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  🧪 Optional: Test Locally First
&lt;/h2&gt;

&lt;p&gt;Before publishing, you can test your package with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;link&lt;/span&gt;
&lt;span class="c"&gt;# Then in another project:&lt;/span&gt;
npm &lt;span class="nb"&gt;link &lt;/span&gt;how-much-time-ago
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This simulates installing the package globally without publishing.&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 Final Thoughts
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;If you've ever been curious about npm publishing — just try it!&lt;/li&gt;
&lt;li&gt;A good name, clear README, and working code is all you need to start&lt;/li&gt;
&lt;li&gt;Keep your first package simple, and iterate from there&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Want to Try It?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;how-much-time-ago
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then:&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;timeAgo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;how-much-time-ago&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;timeAgo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2024-12-01&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// e.g., "4 months ago"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔜 Coming Soon
&lt;/h2&gt;

&lt;p&gt;I’m planning to add:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Optional future time handling (“in 5 minutes”)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Open to feedback and contributions!&lt;br&gt;&lt;br&gt;
👉 &lt;a href="https://github.com/drishti1920/time-ago-lite" rel="noopener noreferrer"&gt;GitHub repo&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>npm</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>React+ ShadCN Dark Theme Boilerplate</title>
      <dc:creator>Drishti Saraf</dc:creator>
      <pubDate>Thu, 27 Mar 2025 04:47:48 +0000</pubDate>
      <link>https://dev.to/drishti1920/vite-shadcn-boilerplate-save-time-and-get-started-quickly-jhg</link>
      <guid>https://dev.to/drishti1920/vite-shadcn-boilerplate-save-time-and-get-started-quickly-jhg</guid>
      <description>&lt;h2&gt;
  
  
  Why I Built This Boilerplate
&lt;/h2&gt;

&lt;p&gt;I initially started this project because I wanted to create a Vite project using ShadCN. However, as someone who had never used the React + TypeScript template before, I quickly realized that setting it up could be tricky. Being an absolute beginner in TypeScript, I tried to avoid it but eventually had to embrace the learning curve.&lt;/p&gt;

&lt;p&gt;During this process, I found that setting up a project in Vite with ShadCN and a theme-switching feature can be a bit overwhelming for first-timers. I didn’t want to go through all the trouble every time I started a new project, so I built this boilerplate for myself. Then I thought, why not share it with others who might face the same struggle? I am also open to suggestions, including whether this setup is feasible with a React + JavaScript template.&lt;/p&gt;

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

&lt;p&gt;This boilerplate includes a proper folder structure with clearly defined components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Components Folder:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ui/&lt;/code&gt; (ShadCN components)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;layout/&lt;/code&gt; (Contains project layout: &lt;code&gt;Layout.tsx&lt;/code&gt;, &lt;code&gt;Navbar.tsx&lt;/code&gt;, &lt;code&gt;Footer.tsx&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;themes/&lt;/code&gt; (Theme provider and theme toggle)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;A separate &lt;code&gt;routes/&lt;/code&gt; folder&lt;/li&gt;

&lt;li&gt;A &lt;code&gt;pages/&lt;/code&gt; folder&lt;/li&gt;

&lt;li&gt;A clean and well-structured &lt;code&gt;app.js&lt;/code&gt; codebase&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installation &amp;amp; Usage
&lt;/h2&gt;

&lt;p&gt;Getting started is super simple:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clone the repository&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;npm install&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Start the development server with &lt;code&gt;npm run dev&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That’s it! You’ll have a basic project layout ready to go.&lt;/p&gt;

&lt;h2&gt;
  
  
  Customization
&lt;/h2&gt;

&lt;p&gt;This boilerplate provides a flexible structure that allows for easy customization:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use ShadCN’s theming feature to generate custom CSS variables for &lt;code&gt;index.css&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Update the &lt;code&gt;Navbar.tsx&lt;/code&gt; and &lt;code&gt;Footer.tsx&lt;/code&gt; code as needed.&lt;/li&gt;
&lt;li&gt;Modify the layout to fit your project requirements.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I have provided a structured project layout, but it’s designed to be easily editable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;p&gt;This project is built with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Vite&lt;/strong&gt; – A fast and modern frontend build tool&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TypeScript&lt;/strong&gt; – For type safety and better developer experience&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tailwind CSS&lt;/strong&gt; – A utility-first CSS framework&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ShadCN&lt;/strong&gt; – For beautiful and customizable UI components&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lucide-react&lt;/strong&gt; – A modern and lightweight icon library&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As a beginner in Tailwind CSS, I initially avoided it, but given the current industry standards, learning it has become essential.&lt;/p&gt;

&lt;h2&gt;
  
  
  Future Plans
&lt;/h2&gt;

&lt;p&gt;I’m open to suggestions because I’m sure I might have missed some things while building this boilerplate. If you have any ideas for improvements or additional features, feel free to share them!&lt;/p&gt;

&lt;h2&gt;
  
  
  Call to Action
&lt;/h2&gt;

&lt;p&gt;If you find this boilerplate useful, consider &lt;strong&gt;starring the repository on GitHub&lt;/strong&gt; ⭐. Feel free to contribute, provide feedback, or suggest enhancements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GITHUB LINK&lt;/strong&gt; - &lt;a href="https://github.com/drishti1920/vite_shadcn_boilerplate" rel="noopener noreferrer"&gt;source code&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PREVIEW&lt;/strong&gt; - &lt;a href="https://exquisite-pavlova-6e0724.netlify.app/" rel="noopener noreferrer"&gt;preview&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s make setting up Vite + ShadCN projects easier for everyone! 🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>Micro Frontends Architecture</title>
      <dc:creator>Drishti Saraf</dc:creator>
      <pubDate>Thu, 27 Feb 2025 07:31:32 +0000</pubDate>
      <link>https://dev.to/drishti1920/micro-frontends-architecture-4lhj</link>
      <guid>https://dev.to/drishti1920/micro-frontends-architecture-4lhj</guid>
      <description>&lt;p&gt;In modern web development, applications are becoming larger and more complex. While Microservices have revolutionized backend development, Micro Frontends bring similar advantages to the frontend world. This approach allows independent teams to develop, test, and deploy different parts of a web application separately, leading to better scalability and maintainability.&lt;/p&gt;

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

&lt;p&gt;In this blog, we will explore what Micro Frontends are, why they are useful, how they work, and how to implement them in a project.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Micro Frontends Architecture?
&lt;/h2&gt;

&lt;p&gt;Micro Frontends is an architectural pattern where a web application is broken down into smaller, independent frontend components or applications that can be developed, deployed, and managed separately. These micro applications are then composed together to create a seamless user experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Characteristics:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Independent Development:&lt;/strong&gt; Different teams can work on different frontend components.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Technology Agnostic:&lt;/strong&gt; Different parts of the frontend can be built using different frameworks (React, Angular, Vue, etc.).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Decentralized Deployment:&lt;/strong&gt; Individual components can be updated and deployed without affecting the entire application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scalability:&lt;/strong&gt; Enhances scalability by allowing independent teams to manage different parts of the frontend.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Understanding Micro Frontends with an Example
&lt;/h2&gt;

&lt;p&gt;Consider a company that provides multiple applications to its customers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ERP System:&lt;/strong&gt; Used for managing business processes and resources.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;E-commerce Admin Dashboard:&lt;/strong&gt; Used for managing products, orders, and customers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;License Management System:&lt;/strong&gt; Used for managing software licenses.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A single customer may use all three applications, and they share a single login application that handles authentication and user management.&lt;/p&gt;

&lt;p&gt;Using a Micro Frontends Architecture, each of these applications can be developed independently while still being seamlessly integrated into a single unified experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Micro Frontends Help in This Scenario:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Independent Deployment:&lt;/strong&gt; Each system (ERP, E-commerce Admin, License Management) can be updated separately without affecting others.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Shared Authentication:&lt;/strong&gt; The login application can be a standalone Micro Frontend, shared across all systems.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Technology Diversity:&lt;/strong&gt; Different teams can use different frontend frameworks suitable for their needs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scalability:&lt;/strong&gt; New applications can be added without disrupting existing ones.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For instance, the login application could be built with React, while the ERP dashboard might use Angular, and the License Management system might be developed in Vue.js. With Micro Frontends, these different frontend technologies can co-exist within the same ecosystem while still functioning as a cohesive application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges and Best Practices
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Challenges
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;State Management&lt;/strong&gt; - Managing state across multiple frontend modules can be complex.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Routing&lt;/strong&gt; - Coordinating navigation between different Micro Frontends requires careful planning.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Styling Conflicts&lt;/strong&gt; - Different Micro Frontends may have conflicting styles, which needs to be handled properly (e.g., using CSS Modules or Shadow DOM).&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Use Module Federation for seamless integration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Implement Shared State Management using Redux, Context API, or Event Bus.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Adopt Consistent Design Guidelines to maintain uniformity across Micro Frontends.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Utilize CI/CD Pipelines for automated deployment of individual Micro Frontends.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Micro Frontends Architecture is a game-changer for scalable and modular frontend applications. It enables independent development, faster deployments, and the freedom to use different technologies within the same project. By leveraging Module Federation, Single SPA, or Web Components, you can create maintainable and efficient frontend applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources and References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.turing.com/blog/micro-frontends-what-are-they-when-to-use-them" rel="noopener noreferrer"&gt;Turing&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://micro-frontends.org/" rel="noopener noreferrer"&gt;Micro-Frontends&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.xenonstack.com/insights/micro-frontend-architecture" rel="noopener noreferrer"&gt;Xenonstack&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://euristiq.com/micro-frontend-architecture/" rel="noopener noreferrer"&gt;Euristiq&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>news</category>
    </item>
    <item>
      <title>Top UI Libraries for Faster Development</title>
      <dc:creator>Drishti Saraf</dc:creator>
      <pubDate>Thu, 06 Feb 2025 08:54:39 +0000</pubDate>
      <link>https://dev.to/drishti1920/top-react-component-libraries-for-faster-ui-development-3n04</link>
      <guid>https://dev.to/drishti1920/top-react-component-libraries-for-faster-ui-development-3n04</guid>
      <description>&lt;p&gt;Have you noticed how animated UI component libraries are becoming super popular lately? It’s not just about making things look pretty, user interactions today are about engagement and experience.&lt;/p&gt;

&lt;p&gt;As developers, we rely on these libraries for two key reasons: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;They save time &lt;/li&gt;
&lt;li&gt;They make web interactions feel incredibly smooth.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Another reason more developers are adopting these libraries is that they help create landing pages that are visually appealing, fluid, and premium-looking—boosting user engagement and conversion rates.&lt;/p&gt;

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

&lt;p&gt;So, if you're looking to level up your UI game, here are some of the best React component libraries worth checking out!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://magicui.design/" rel="noopener noreferrer"&gt;Material-UI (MUI)&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Material-UI is a powerhouse when it comes to implementing Google’s Material Design principles in React apps. It offers a set of polished, customizable components that ensure a modern and accessible UI.&lt;/p&gt;

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

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

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Pre-designed components that follow Material Design guidelines&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Easy theming and customization&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Strong community support&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Built-in dark mode&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ideal For:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Dashboards and admin panels&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Apps that follow Material Design principles&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://ant.design/" rel="noopener noreferrer"&gt;Ant Design&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Ant Design is a full-featured React UI library that’s widely used in enterprise applications. It has a robust set of components, built-in form handling, and a sleek professional look.&lt;/p&gt;

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

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

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Comprehensive set of polished UI components&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Advanced theming options&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Internationalization (i18n) support&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Great for complex applications&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ideal For:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Enterprise and business apps&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data-heavy dashboards&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://chakra-ui.com/" rel="noopener noreferrer"&gt;Chakra UI&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Chakra UI is all about simplicity and accessibility. It makes styling super easy with a props-based system while ensuring your UI is fully responsive.&lt;/p&gt;

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

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

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Super customizable with a simple API&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Dark mode support out of the box&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Built-in accessibility features&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Works great with animations&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ideal For:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Projects that need lightweight, flexible UIs&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Developers who want a smooth DX (Developer Experience)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://react-bootstrap.netlify.app/" rel="noopener noreferrer"&gt;React Bootstrap&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;If you love Bootstrap but want to work with React components, React Bootstrap is the way to go! It provides Bootstrap components that are fully React-compatible, eliminating the need for jQuery.&lt;/p&gt;

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

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

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Fully responsive Bootstrap grid system&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Easy to theme using Bootstrap variables&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Compatible with Bootstrap documentation&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ideal For:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Projects already built on Bootstrap&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mobile-first applications&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;There’s no &lt;em&gt;one-size-fits-all&lt;/em&gt; when it comes to React component libraries. The best choice depends on your project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Material-UI&lt;/strong&gt; and &lt;strong&gt;Ant Design&lt;/strong&gt; are perfect for enterprise applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Chakra UI&lt;/strong&gt; and &lt;strong&gt;Tailwind UI&lt;/strong&gt; offer flexibility and customization.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;React Bootstrap&lt;/strong&gt; is great for those who love Bootstrap.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using a component library not only speeds up the development process but also helps maintain consistency and create seemless user experience.&lt;/p&gt;

&lt;p&gt;There are many more interesting UI libraries that you can try. I haven't mentioned them in my blog because I haven't tested them yet. Some of these library include &lt;strong&gt;ShadCN&lt;/strong&gt;, &lt;strong&gt;Aceternity UI&lt;/strong&gt;, and many more. If you have used any of these, I'd love to hear about your development experience in the comments. 🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>API Protocol: REST vs SOAP vs GraphQL vs RPC</title>
      <dc:creator>Drishti Saraf</dc:creator>
      <pubDate>Tue, 04 Feb 2025 11:22:23 +0000</pubDate>
      <link>https://dev.to/drishti1920/rest-vs-soap-vs-graphql-vs-rpc-which-api-protocol-should-you-use-mn7</link>
      <guid>https://dev.to/drishti1920/rest-vs-soap-vs-graphql-vs-rpc-which-api-protocol-should-you-use-mn7</guid>
      <description>&lt;p&gt;APIs are the backbone of modern software communication. They enable applications to exchange data efficiently, whether it's a mobile app fetching data from a server or a website integrating with third-party services.&lt;/p&gt;

&lt;p&gt;However, not all APIs function the same way. Different API protocols have been developed to serve specific needs, each with its own strengths and weaknesses. &lt;/p&gt;

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

&lt;h2&gt;
  
  
  1. REST (Representational State Transfer)
&lt;/h2&gt;

&lt;p&gt;REST is the most widely used API protocol today, known for its simplicity and scalability. It relies on HTTP methods (GET, POST, PUT, DELETE) and uses stateless communication.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Uses standard HTTP methods&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Supports multiple data formats (JSON, XML, etc.), but JSON is the most common&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stateless architecture, meaning each request is independent&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scalable and cacheable for better performance&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;✅ Simple and easy to implement&lt;br&gt;
✅ Works well with web applications&lt;br&gt;
✅ Caching improves performance&lt;/p&gt;

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

&lt;p&gt;❌ Over-fetching or under-fetching of data&lt;br&gt;
❌ Lack of flexibility in queries&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Use Cases:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Web services and mobile applications&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Social media platforms (e.g., Twitter API)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;E-commerce applications&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. SOAP (Simple Object Access Protocol)
&lt;/h2&gt;

&lt;p&gt;SOAP is an older API protocol that uses XML-based messaging and operates over multiple protocols (HTTP, SMTP, TCP, etc.). It is commonly used in enterprise-level applications where security and reliability are top priorities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Uses XML for data exchange&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Highly secure (supports WS-Security)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Strict standards ensure reliability&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Supports ACID transactions (important for financial applications)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;✅ Strong security features&lt;br&gt;
✅ Reliable and standardized for enterprise use&lt;br&gt;
✅ Supports multiple transport protocols&lt;/p&gt;

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

&lt;p&gt;❌ Verbose and complex XML format&lt;br&gt;
❌ Slower compared to REST&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Use Cases:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Banking and financial services&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Healthcare systems&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enterprise software&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. GraphQL
&lt;/h2&gt;

&lt;p&gt;Developed by Facebook, GraphQL is a query language that allows clients to request only the data they need. Unlike REST, it avoids over-fetching and under-fetching issues by letting clients specify their required fields.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Allows flexible queries (fetch only needed data)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Uses a single endpoint for all operations&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Strongly typed schema&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;✅ Efficient data fetching (avoids over-fetching/under-fetching)&lt;br&gt;
✅ Reduces the number of API calls&lt;br&gt;
✅ Self-documenting API with strong schema&lt;/p&gt;

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

&lt;p&gt;❌ Higher learning curve&lt;br&gt;
❌ Complex caching mechanisms&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Use Cases:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Social media platforms (e.g., Facebook, GitHub APIs)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mobile applications with dynamic data needs&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data-heavy applications&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. RPC (Remote Procedure Call)
&lt;/h2&gt;

&lt;p&gt;RPC allows clients to call functions on a remote server as if they were local. It can be JSON-RPC or gRPC (Google Remote Procedure Call).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Calls remote functions directly&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Can use JSON (JSON-RPC) or Protocol Buffers (gRPC)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Low-latency and efficient communication&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;✅ Fast and lightweight&lt;br&gt;
✅ Ideal for microservices architecture&lt;br&gt;
✅ Works well with low-latency applications&lt;/p&gt;

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

&lt;p&gt;❌ Tight coupling between client and server&lt;br&gt;
❌ Debugging can be complex&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Use Cases:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Real-time applications (e.g., gaming, messaging apps)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Microservices communication&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;High-performance APIs&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Choosing the right API protocol depends on your specific needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Use &lt;strong&gt;REST&lt;/strong&gt; for web and mobile applications that require scalability and simplicity.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose &lt;strong&gt;SOAP&lt;/strong&gt; for enterprise applications where security and reliability are critical.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go with &lt;strong&gt;GraphQL&lt;/strong&gt; if you need flexible data fetching with minimal API calls.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Opt for &lt;strong&gt;RPC&lt;/strong&gt; when building real-time, high-performance systems.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Understanding these protocols helps developers make informed decisions when designing APIs. Which API protocol do you prefer using? Let me know in the comments! 🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>discuss</category>
      <category>node</category>
    </item>
    <item>
      <title>Error Handling in Frontend Development</title>
      <dc:creator>Drishti Saraf</dc:creator>
      <pubDate>Mon, 03 Feb 2025 11:57:10 +0000</pubDate>
      <link>https://dev.to/drishti1920/error-handling-in-frontend-development-dik</link>
      <guid>https://dev.to/drishti1920/error-handling-in-frontend-development-dik</guid>
      <description>&lt;p&gt;Error handling is a crucial part of frontend development—it ensures a smooth user experience and helps developers debug issues efficiently. Whether you're working with JavaScript, React, or any other frontend framework, handling errors properly can prevent unexpected crashes and frustrating user interactions.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Common Types of Errors in Frontend Development
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Syntax Errors –&lt;/strong&gt; These happen when there's a mistake in your code structure, preventing it from running.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Runtime Errors –&lt;/strong&gt; These occur while the code is executing, like trying to access an undefined variable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Logical Errors –&lt;/strong&gt;  These don't crash your app, but they produce incorrect results, making debugging tricky.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Network Errors –&lt;/strong&gt; When API calls fail due to connectivity issues, timeouts, or server errors.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;User Input Errors –&lt;/strong&gt; Happen when users enter invalid data, so proper validation is needed.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to Handle Errors Effectively
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Using Try-Catch for Handling Errors&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A &lt;code&gt;try-catch&lt;/code&gt; block is great for catching runtime errors without breaking the entire application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;try {
  let result = riskyOperation(); // A function that may throw an error
} catch (error) {
  console.error("Oops! Something went wrong:", error);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Handling Errors in Promises&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For asynchronous operations, handling errors properly prevents app crashes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetch("https://api.example.com/data")
  .then(response =&amp;gt; response.json())
  .catch(error =&amp;gt; console.error("Failed to fetch data:", error));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With async/await:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function fetchData() {
  try {
    let response = await fetch("https://api.example.com/data");
    let data = await response.json();
  } catch (error) {
    console.error("Error fetching data:", error);
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Catching Global Errors&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using &lt;code&gt;window.onerror&lt;/code&gt; or &lt;code&gt;window.addEventListener("error", callback)&lt;/code&gt; helps capture unexpected errors globally.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;window.onerror = function (message, source, lineno, colno, error) {
  console.error("Something went wrong:", message, " at ", source, ":", lineno);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Handling unhandled promise rejections:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;window.addEventListener("unhandledrejection", function (event) {
  console.error("Unhandled Promise Rejection:", event.reason);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Handling Errors in React Applications&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;React provides error boundaries to catch component tree errors.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class ErrorBoundary extends React.Component {
  constructor(props) {
    super(props);
    this.state = { hasError: false };
  }

  static getDerivedStateFromError(error) {
    return { hasError: true };
  }

  componentDidCatch(error, info) {
    console.error("Error caught by boundary:", error, info);
  }

  render() {
    if (this.state.hasError) {
      return &amp;lt;h1&amp;gt;Oops! Something went wrong.&amp;lt;/h1&amp;gt;;
    }
    return this.props.children;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Usage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;ErrorBoundary&amp;gt;
  &amp;lt;MyComponent /&amp;gt;
&amp;lt;/ErrorBoundary&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Providing User-Friendly Feedback&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Users should get clear messages when errors occur instead of vague alerts or crashes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;try {
  performAction();
} catch (error) {
  showToast("Something went wrong. Please try again.");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Best Practices for Handling Errors
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use Meaningful Error Messages&lt;/strong&gt; – Avoid generic messages like "Something went wrong." Be specific.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Log Errors Efficiently&lt;/strong&gt; – Use tools like Sentry or LogRocket to capture and analyze errors.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fail Gracefully&lt;/strong&gt; – Your app should remain functional even if an error occurs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Validate User Inputs&lt;/strong&gt; – Prevent errors before they happen with proper validation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Test for Edge Cases&lt;/strong&gt; – Use unit and integration tests to catch potential issues before deploying.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Error handling in frontend development is crucial for a smooth user experience. By implementing strategies like try-catch, promise handling, global error listeners, and React error boundaries, you can prevent app crashes and improve stability.&lt;/p&gt;

&lt;p&gt;Do you have any go-to strategies for handling frontend errors? Share your thoughts in the comments!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>react</category>
    </item>
    <item>
      <title>ReactJS for beginners</title>
      <dc:creator>Drishti Saraf</dc:creator>
      <pubDate>Thu, 23 Jan 2025 05:32:09 +0000</pubDate>
      <link>https://dev.to/drishti1920/getting-started-with-reactjs-85f</link>
      <guid>https://dev.to/drishti1920/getting-started-with-reactjs-85f</guid>
      <description>&lt;p&gt;ReactJS is a powerful JavaScript library for building user interfaces. Created by Facebook, it's widely used for its component-based architecture and the ability to build fast and interactive web applications.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Step 1: Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before diving into React, make sure you have the following installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Node.js and npm&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;React relies on Node.js and npm (Node Package Manager) to manage dependencies. To check if they’re installed, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node -v
npm -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If not installed, download and install the latest version of Node.js from nodejs.org.&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://nodejs.org/en" rel="noopener noreferrer"&gt;
      nodejs.org
    &lt;/a&gt;
&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A Code Editor&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I recommend using Visual Studio Code for its features and extensions tailored to JavaScript and React development.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Setting Up a React Project
&lt;/h2&gt;

&lt;p&gt;There are two primary ways to set up a React project: using Create React App or Vite. Here, we'll use Create React App for simplicity.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Install Create React App&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run the following command to globally install Create React App:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g create-react-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Create a New React Project&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Create a new project named &lt;code&gt;my-react-app:&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-react-app my-react-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Navigate to Your Project Directory&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd my-react-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Start the Development Server&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run the following command to start your React app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will open a new tab in your browser at &lt;code&gt;http://localhost:3000&lt;/code&gt;, where you can see the default React app running.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Understanding the Project Structure
&lt;/h2&gt;

&lt;p&gt;Your new React project will have the following structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my-react-app
├── public
├── src
│   ├── App.css
│   ├── App.js
│   ├── index.css
│   ├── index.js
├── package.json
├── node_modules
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;public:&lt;/strong&gt; Contains static files like index.html.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;src:&lt;/strong&gt; Contains your React components and styles.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;package.json:&lt;/strong&gt; Manages project dependencies and scripts.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 4: Creating Your First Component
&lt;/h2&gt;

&lt;p&gt;React apps are built with components. Let’s create a simple HelloWorld component.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Create a New File&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Inside the src folder, create a file named &lt;code&gt;HelloWorld.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/HelloWorld.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Write the Component&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';

function HelloWorld() {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;Hello, World!&amp;lt;/h1&amp;gt;
      &amp;lt;p&amp;gt;Welcome to your first React component.&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export default HelloWorld;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Import and Use the Component&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Open &lt;code&gt;App.js&lt;/code&gt; and modify it to include your new component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import HelloWorld from './HelloWorld';

function App() {
  return (2. Write the Component

Add the following code to HelloWorld.js:

import React from 'react';

function HelloWorld() {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;Hello, World!&amp;lt;/h1&amp;gt;
      &amp;lt;p&amp;gt;Welcome to your first React component.&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export default HelloWorld;


    &amp;lt;div className="App"&amp;gt;
      &amp;lt;HelloWorld /&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file, and your browser should display the "Hello, World!" message.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Styling Your Component
&lt;/h2&gt;

&lt;p&gt;React allows you to style components using CSS. Let’s style the HelloWorld component.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Create a CSS File&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Create a file named &lt;code&gt;HelloWorld.css&lt;/code&gt; in the src folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/HelloWorld.css
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Add Styles&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Add the following CSS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;h1 {
  color: #61dafb;
  font-family: Arial, sans-serif;
}

p {
  color: #282c34;
  font-size: 18px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Apply the Styles&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Import the CSS file in &lt;code&gt;Helloworld.js&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import './HelloWorld.css';

function HelloWorld() {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;Hello, World!&amp;lt;/h1&amp;gt;
      &amp;lt;p&amp;gt;Welcome to your first React component.&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export default HelloWorld;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file, and you’ll see the updated styles in your browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Adding More Components
&lt;/h2&gt;

&lt;p&gt;You can continue building your app by creating more components and importing them into &lt;code&gt;App.js&lt;/code&gt;. Each component can have its own logic, structure, and styles.&lt;/p&gt;

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

&lt;p&gt;Congratulations! You’ve just set up your first React project and created your first component. This is just the beginning of your React journey. As you grow, you’ll explore more advanced topics like state management, routing, and API integration. Happy coding!&lt;/p&gt;

&lt;p&gt;If you found this tutorial helpful, share it with others and stay tuned for more React tutorials!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>react</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Responsive "Coming Soon" Page</title>
      <dc:creator>Drishti Saraf</dc:creator>
      <pubDate>Wed, 22 Jan 2025 04:50:41 +0000</pubDate>
      <link>https://dev.to/drishti1920/building-a-responsive-coming-soon-page-3pgg</link>
      <guid>https://dev.to/drishti1920/building-a-responsive-coming-soon-page-3pgg</guid>
      <description>&lt;p&gt;Recently, I took on a challenge from Frontend Mentor to build a responsive "Coming Soon" page for a fashion store. The challenge involved creating a landing page with an email subscription form, a background image, and a design that should work well on both desktop and mobile devices. In this blog post, I’ll walk you through how I approached this challenge, the key decisions I made, and how I solved problems along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Understanding the Project
&lt;/h2&gt;

&lt;p&gt;Before I dove into the coding, I took some time to understand the requirements of the project. The challenge involved creating the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A hero section with a logo and a “coming soon” message.&lt;/li&gt;
&lt;li&gt;A form that allows users to subscribe via email.&lt;/li&gt;
&lt;li&gt;A responsive layout with a background image that changes according to the screen size.&lt;/li&gt;
&lt;li&gt;Basic email validation to ensure users input a valid email. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 2: Structuring the HTML
&lt;/h2&gt;

&lt;p&gt;The first step was to structure the HTML. I wanted to create a clean, semantic layout with minimal divs. The overall layout would consist of two main parts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The details section that includes the logo, heading, description, and the email input form.&lt;/li&gt;
&lt;li&gt;The image section that contains the background image.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here's how I structured the HTML:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="coming-soon-container"&amp;gt;
  &amp;lt;div class="details-container"&amp;gt;
    &amp;lt;div class="logo-container"&amp;gt;
      &amp;lt;img src="./images/logo.svg" alt="fashion-store-logo" /&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div class="details"&amp;gt;
      &amp;lt;h1&amp;gt;
        &amp;lt;span class="josefin-sans-thin"&amp;gt;We're&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;
        coming &amp;lt;br /&amp;gt;soon
      &amp;lt;/h1&amp;gt;
      &amp;lt;p&amp;gt;
        Hello fellow shoppers! We're currently building our new fashion store.
        Add your email below to stay up-to-date with announcements and our launch deals.
      &amp;lt;/p&amp;gt;
      &amp;lt;div class="input-container"&amp;gt;
        &amp;lt;input type="email" id="email-input" placeholder="Enter your email" /&amp;gt;
        &amp;lt;span class="icon-span" onclick="validateEmail()"&amp;gt;
          &amp;lt;img src="./images/icon-arrow.svg" alt="arrow-icon" /&amp;gt;
        &amp;lt;/span&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
  &amp;lt;div class="image-container"&amp;gt;
    &amp;lt;img src="./images/hero-desktop.jpg" alt="fashion-store-hero-image" /&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Styling the Layout with CSS
&lt;/h2&gt;

&lt;p&gt;Now it was time to make the layout look good and responsive. For this, I relied heavily on Flexbox to control the layout of the two main sections. Flexbox helps arrange elements in both horizontal and vertical directions without having to worry about floats or positioning.&lt;/p&gt;

&lt;p&gt;I started by styling the container to create a side-by-side layout for desktop views. On mobile, I used a media query to stack the elements vertically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Flexbox Layout:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.coming-soon-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 768px) {
  .coming-soon-container {
    flex-direction: column-reverse;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;.coming-soon-container&lt;/code&gt; class uses &lt;code&gt;display: flex&lt;/code&gt; to create a row-based layout.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;justify-content: space-between&lt;/code&gt; ensures that the details and image sections are spaced apart.&lt;/li&gt;
&lt;li&gt;On smaller screens (below 768px), I used a media query to change the direction of the layout to column, so the image section appears below the details section.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 4: Designing the Email Input and Arrow Icon
&lt;/h2&gt;

&lt;p&gt;One of the key interactive elements of this page was the email subscription form. I wanted it to look clean and modern, so I focused on making the input field and the submit button (the arrow icon) visually appealing.&lt;/p&gt;

&lt;p&gt;Here’s the CSS for the email input and the arrow icon:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.input-container {
  position: relative;
  width: 385px;
}

.input-container input {
  width: 100%;
  padding: 10px 50px 10px 15px;
  border: 1px solid var(--desaturated-Red);
  border-radius: 25px;
  font-size: 16px;
  outline: none;
}

.input-container input::placeholder {
  color: var(--desaturated-Red);
  opacity: 0.6;
  font-size: 12px;
}

.input-container span {
  position: absolute;
  top: 50%;
  right: 1px;
  transform: translateY(-50%);
  width: 70px;
  height: 40px;
  border-radius: 28px;
  background-image: linear-gradient(135deg, hsl(0, 80%, 86%), hsl(0, 74%, 74%));
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 1;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;.input-container&lt;/code&gt; class uses &lt;code&gt;position: relative&lt;/code&gt; to position the arrow icon within the input field.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;input&lt;/code&gt; field has a nice rounded border with padding and a placeholder style.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;span&lt;/code&gt; tag, which wraps the arrow icon, is absolutely positioned inside the input field, centered vertically. The background uses a gradient to give it a more modern look.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 5: Adding a Responsive Hero Image
&lt;/h2&gt;

&lt;p&gt;The hero image needed to be responsive, so I used the object-fit property to make sure it covered the container properly without distorting the image.&lt;/p&gt;

&lt;p&gt;Here’s the CSS for the image container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.image-container {
  width: 40%;
  height: 100vh;
  overflow: hidden;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;.image-container&lt;/code&gt; is set to a fixed width (&lt;code&gt;40%&lt;/code&gt;), and it fills the full viewport height (&lt;code&gt;100vh&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;The image inside the container uses &lt;code&gt;object-fit: cover&lt;/code&gt; to ensure it covers the entire area while maintaining the aspect ratio.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;object-position: top&lt;/code&gt; ensures the top part of the image is visible, which is important for maintaining focus on the key part of the image.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 6: Email Validation with JavaScript
&lt;/h2&gt;

&lt;p&gt;Finally, I needed to add email validation to ensure that users entered a valid email address. For this, I used a simple JavaScript function that checks if the email input matches the standard email pattern.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function validateEmail() {
  const emailInput = document.querySelector("#email-input");
  const errorMessage = document.querySelector("#error-message");

  const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;

  if (emailRegex.test(emailInput.value)) {
    errorMessage.style.display = "none";
    alert("Email is valid!");
  } else {
    errorMessage.textContent = "Please enter a valid email address.";
    errorMessage.style.display = "block";
    emailInput.style.borderColor = "var(--soft-red)";
  }
}

document
  .getElementById("email-input")
  .addEventListener("keypress", function (e) {
    if (e.key === "Enter") {
      validateEmail();
    }
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;I used a simple regular expression to validate the email format. If the input is valid, a success message is shown; otherwise, an error message is displayed.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;keypress&lt;/code&gt; event listener triggers the validation when the user presses Enter.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;This "Coming Soon" page project was a great exercise in building a responsive, modern landing page. By using Flexbox for layout, custom styles for the email input, and ensuring the page was mobile-friendly, I was able to create a clean and functional design. The challenge was especially helpful in reinforcing my understanding of responsive design and how to implement basic form validation.&lt;/p&gt;

&lt;p&gt;If you’re looking for a similar challenge to improve your frontend skills, I highly recommend checking out Frontend Mentor’s Coming Soon page challenge. You can visit it here.&lt;a href="https://www.frontendmentor.io/" rel="noopener noreferrer"&gt;https://www.frontendmentor.io/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can view the full code here. &lt;a href="https://github.com/drishti1920/Frontend-Mentor-Challenges/tree/main/coming-soon-page" rel="noopener noreferrer"&gt;https://github.com/drishti1920/Frontend-Mentor-Challenges/tree/main/coming-soon-page&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Optimized React Folder Structure</title>
      <dc:creator>Drishti Saraf</dc:creator>
      <pubDate>Tue, 21 Jan 2025 10:33:41 +0000</pubDate>
      <link>https://dev.to/drishti1920/optimized-folder-structure-for-react-applications-4lo4</link>
      <guid>https://dev.to/drishti1920/optimized-folder-structure-for-react-applications-4lo4</guid>
      <description>&lt;p&gt;Having a well-structured folder setup is essential for creating scalable and maintainable React applications. A clear and consistent folder structure not only simplifies collaboration but also helps in debugging and extending your codebase efficiently. &lt;/p&gt;

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

&lt;h2&gt;
  
  
  Why Is Folder Structure Important?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Scalability:&lt;/strong&gt; A clear structure allows your app to grow without becoming chaotic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Collaboration:&lt;/strong&gt; Team members can navigate the codebase more effectively.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maintainability:&lt;/strong&gt; It becomes easier to debug and add new features.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Basic Folder Structure
&lt;/h2&gt;

&lt;p&gt;For small to medium-sized React projects, here’s a straightforward and effective folder layout:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/
├── assets/
│   ├── images/
│   └── styles/
├── components/
├── pages/
├── hooks/
├── utils/
├── services/
├── context/
├── App.js
├── index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Folder Breakdown
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;assets/&lt;/code&gt;&lt;br&gt;
This folder holds static files such as images, fonts, global styles.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;components/&lt;/code&gt;&lt;br&gt;
This folder contains reusable UI components like buttons, modals, or input fields. Each component can have its own folder for related files like styles and tests.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;components/
├── Button/
│   ├── Button.jsx
│   ├── Button.css
│   └── Button.test.js
├── Modal/
│   ├── Modal.jsx
│   ├── Modal.css
│   └── Modal.test.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;pages/&lt;/code&gt;
This folder organizes components that represent entire pages of your application.
&lt;strong&gt;Example:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pages/
├── HomePage.jsx
├── AboutPage.jsx
├── ContactPage.jsx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;hooks/&lt;/code&gt;
Custom hooks that encapsulate reusable logic, such as data fetching or form handling, are placed here.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { useState, useEffect } from "react";

export const useFetch = (url) =&amp;gt; {
  const [data, setData] = useState(null);

  useEffect(() =&amp;gt; {
    fetch(url).then((response) =&amp;gt; response.json()).then(setData);
  }, [url]);

  return data;
};

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;utils/&lt;/code&gt;
Utility functions, such as those for formatting data or calculations, live here.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export const formatDate = (date) =&amp;gt; {
  return new Date(date).toLocaleDateString();
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;services/&lt;/code&gt;
This folder is used for API calls and integrations with third-party services, keeping the logic separate from components.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export const fetchUsers = async () =&amp;gt; {
  const response = await fetch("/api/users");
  return response.json();
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;context/&lt;/code&gt;
This is where you manage global state using React Context API.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;context/
├── AuthContext.js
└── ThemeContext.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { createContext, useState } from "react";

export const AuthContext = createContext();

export const AuthProvider = ({ children }) =&amp;gt; {
  const [user, setUser] = useState(null);

  return (
    &amp;lt;AuthContext.Provider value={{ user, setUser }}&amp;gt;
      {children}
    &amp;lt;/AuthContext.Provider&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Keep It Simple:&lt;/strong&gt; Avoid deeply nested folders unless necessary.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Group by Feature:&lt;/strong&gt; For larger projects, organize files by feature/module instead of type.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/
├── features/
│   ├── Auth/
│   │   ├── LoginPage.jsx
│   │   ├── RegisterPage.jsx
│   │   └── AuthService.js
│   ├── Dashboard/
│   │   ├── DashboardPage.jsx
│   │   ├── DashboardWidget.jsx
│   │   └── WidgetService.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;A well-organized folder structure makes your React application scalable, readable, and maintainable. Whether you’re building a small project or a large-scale application, investing time in setting up the right folder structure will save you hours in the long run.&lt;/p&gt;

&lt;p&gt;Share your own folder structure tips in the comments!&lt;/p&gt;

&lt;p&gt;Let me know if you'd like further refinements! 😊&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>frontend</category>
      <category>node</category>
    </item>
    <item>
      <title>3-Column Preview Card Component</title>
      <dc:creator>Drishti Saraf</dc:creator>
      <pubDate>Mon, 20 Jan 2025 04:42:40 +0000</pubDate>
      <link>https://dev.to/drishti1920/how-to-build-a-3-column-preview-card-component-2ecn</link>
      <guid>https://dev.to/drishti1920/how-to-build-a-3-column-preview-card-component-2ecn</guid>
      <description>&lt;p&gt;Creating visually appealing and functional components is an essential skill for front-end developers. In this blog, I’ll guide you through how I built a 3-Column Preview Card Component using HTML and CSS. This project helped me refine my layout, styling, and responsiveness skills while teaching me valuable best practices.&lt;/p&gt;

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

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

&lt;p&gt;The 3-Column Preview Card Component is perfect for showcasing products, services, or features. It features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A clean and modern layout with three distinct columns.&lt;/li&gt;
&lt;li&gt;Clear visual hierarchy using bold headings, concise descriptions, and icons.&lt;/li&gt;
&lt;li&gt;Responsive design for seamless viewing across devices.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Project Structure&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The project comprises a single HTML file, a CSS stylesheet, and assets like icons and fonts. Here’s the folder structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;3-column-preview-card/  
├── index.html  
├── style.css  
├── images/  
│   ├── icon-sedans.svg  
│   ├── icon-suvs.svg  
│   └── icon-luxury.svg  
└── README.md  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The HTML Layout&lt;/strong&gt;&lt;br&gt;
The component consists of three columns, each representing a feature or category. Each column includes an icon, a heading, a description, and a call-to-action button.&lt;/p&gt;

&lt;p&gt;Here’s the HTML structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="card-container"&amp;gt;  
  &amp;lt;div class="card sedan"&amp;gt;  
    &amp;lt;img src="./images/icon-sedans.svg" alt="Sedans Icon" /&amp;gt;  
    &amp;lt;h1&amp;gt;Sedans&amp;lt;/h1&amp;gt;  
    &amp;lt;p&amp;gt;Choose a sedan for its affordability and excellent fuel economy. Ideal for cruising in the city or on your next road trip.&amp;lt;/p&amp;gt;  
    &amp;lt;button&amp;gt;Learn More&amp;lt;/button&amp;gt;  
  &amp;lt;/div&amp;gt;  

  &amp;lt;div class="card suv"&amp;gt;  
    &amp;lt;img src="./images/icon-suvs.svg" alt="SUVs Icon" /&amp;gt;  
    &amp;lt;h1&amp;gt;SUVs&amp;lt;/h1&amp;gt;  
    &amp;lt;p&amp;gt;Take an SUV for its spacious interior, power, and versatility. Perfect for your next family vacation and off-road adventures.&amp;lt;/p&amp;gt;  
    &amp;lt;button&amp;gt;Learn More&amp;lt;/button&amp;gt;  
  &amp;lt;/div&amp;gt;  

  &amp;lt;div class="card luxury"&amp;gt;  
    &amp;lt;img src="./images/icon-luxury.svg" alt="Luxury Icon" /&amp;gt;  
    &amp;lt;h1&amp;gt;Luxury&amp;lt;/h1&amp;gt;  
    &amp;lt;p&amp;gt;Experience the pinnacle of comfort and style with our luxury options. Arrive in style wherever you go.&amp;lt;/p&amp;gt;  
    &amp;lt;button&amp;gt;Learn More&amp;lt;/button&amp;gt;  
  &amp;lt;/div&amp;gt;  
&amp;lt;/div&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Styling with CSS&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Setting Up Variables
CSS variables help maintain consistency across the design.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   :root {  
   --bright-orange: hsl(31, 77%, 52%);  
   --dark-cyan: hsl(184, 100%, 22%);  
   --very-dark-cyan: hsl(179, 100%, 13%);  
   --light-gray: hsl(0, 0%, 95%);  
   --white: hsl(0, 0%, 100%);  
    }  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Designing the Layout
The .card-container is a Flexbox container to align the three columns 
side by side. Each column has a distinct background color for visual 
separation.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   body {  
   display: grid;  
   place-content: center;  
   min-height: 100vh;  
   background-color: var(--light-gray);  
   margin: 0;  
   font-family: 'Lexend Deca', sans-serif;  
    }  

   .card-container {  
   display: flex;  
   border-radius: 10px;  
   overflow: hidden;  
   max-width: 960px;  
   margin: 0 auto;  
    }  

   .card {  
    flex: 1;  
   padding: 2rem;  
   color: var(--white);  
   text-align: center;  
    }  

  .sedan { background-color: var(--bright-orange); }  
  .suv { background-color: var(--dark-cyan); }  
  .luxury { background-color: var(--very-dark-cyan); }  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Making It Responsive&lt;br&gt;
Use media queries to stack the columns on smaller screens.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@media (max-width: 768px) {  
 .card-container {  
  flex-direction: column;  
 }  

 .card {  
padding: 1.5rem;  
  }  
 }  
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;Building a 3-Column Preview Card Component is an excellent way to practice modern CSS techniques like Flexbox, variables, and responsive design. &lt;/p&gt;

&lt;p&gt;Check out the live version here.&lt;a href="https://prismatic-heliotrope-6d66a2.netlify.app/" rel="noopener noreferrer"&gt;https://prismatic-heliotrope-6d66a2.netlify.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check out the entire code here. &lt;a href="https://github.com/drishti1920/Frontend-Mentor-Challenges/tree/main/3-column-layout" rel="noopener noreferrer"&gt;https://github.com/drishti1920/Frontend-Mentor-Challenges/tree/main/3-column-layout&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope this guide helps you improve your front-end skills. Let me know your thoughts or share your creations in the comments! 🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>learning</category>
    </item>
    <item>
      <title>Stats Preview Card Component</title>
      <dc:creator>Drishti Saraf</dc:creator>
      <pubDate>Sat, 18 Jan 2025 08:10:18 +0000</pubDate>
      <link>https://dev.to/drishti1920/building-the-stats-preview-card-component-a-beginners-project-299k</link>
      <guid>https://dev.to/drishti1920/building-the-stats-preview-card-component-a-beginners-project-299k</guid>
      <description>&lt;p&gt;Creating visually appealing and functional components is a crucial skill for front-end developers. In this blog, I’ll share how I built a Stats Preview Card Component using HTML and CSS. This project challenged my design and responsiveness skills while teaching me some best practices.&lt;/p&gt;

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

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

&lt;p&gt;The Stats Preview Card Component displays business insights with a clean layout, bold typography, and a visually striking image overlay. It adapts seamlessly to different screen sizes, ensuring users get a consistent experience on all devices.&lt;/p&gt;

&lt;p&gt;Here’s the project structure at a glance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTML:&lt;/strong&gt; Semantic structure for accessibility and clarity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CSS:&lt;/strong&gt; Variables, Flexbox, and media queries for styling and responsiveness.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Project Structure
&lt;/h2&gt;

&lt;p&gt;The project consists of a single HTML file, a CSS stylesheet, and assets like fonts and images. Here's the folder structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;stats-preview-card/
├── index.html
├── style.css
├── images/
│   └── image-header-desktop.jpg
└── README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The HTML Layout
&lt;/h2&gt;

&lt;p&gt;The component is divided into two sections:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Text Content:&lt;/strong&gt; Includes the heading, description, and statistics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image:&lt;/strong&gt; A decorative image with an overlay effect.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here’s the HTML code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="preview-card-container"&amp;gt;
  &amp;lt;div class="details-container"&amp;gt;
    &amp;lt;h1 class="inter-bold"&amp;gt;
      Get &amp;lt;span&amp;gt;insights&amp;lt;/span&amp;gt; that help your business grow.
    &amp;lt;/h1&amp;gt;
    &amp;lt;p class="paragrph"&amp;gt;
      Discover the benefits of data analytics and make better decisions
      regarding revenue, customer experience, and overall efficiency.
    &amp;lt;/p&amp;gt;
    &amp;lt;div class="ratings"&amp;gt;
      &amp;lt;div class="testimonials"&amp;gt;
        &amp;lt;h3&amp;gt;10k+&amp;lt;/h3&amp;gt;
        &amp;lt;p&amp;gt;companies&amp;lt;/p&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;div class="testimonials"&amp;gt;
        &amp;lt;h3&amp;gt;314&amp;lt;/h3&amp;gt;
        &amp;lt;p&amp;gt;templates&amp;lt;/p&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;div class="testimonials"&amp;gt;
        &amp;lt;h3&amp;gt;12m+&amp;lt;/h3&amp;gt;
        &amp;lt;p&amp;gt;queries&amp;lt;/p&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
  &amp;lt;div class="image-container"&amp;gt;
    &amp;lt;img src="./images/image-header-desktop.jpg" alt="business insights" /&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The use of semantic tags like &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; ensures better accessibility and a clear structure.&lt;/p&gt;

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

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Using CSS Variables&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To maintain consistency, I used variables for colors and fonts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:root {
  --bg-color: hsl(233, 47%, 7%);
  --card-background: hsl(244, 38%, 16%);
  --soft-violet: hsl(277, 64%, 61%);
  --main-heading: hsl(0, 0%, 100%);
  --main-paragraph: hsla(0, 0%, 100%, 0.75);
  --stat-headings: hsla(0, 0%, 100%, 0.6);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Designing the Card&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The card is styled with Flexbox for a clean, side-by-side layout.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.preview-card-container {
  display: flex;
  background-color: var(--card-background);
  color: var(--main-heading);
  width: 974px;
  height: 388px;
  border-radius: 10px;
  overflow: hidden;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Adding the Image Overlay&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I added a soft violet overlay to the image using the &lt;code&gt;::before&lt;/code&gt; pseudo-element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.image-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--soft-violet);
  opacity: 0.6;
  pointer-events: none;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Making It Responsive&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A media query ensures the layout adjusts for smaller screens.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@media (max-width: 991px) {
  .preview-card-container {
    flex-direction: column-reverse;
    width: 290px;
    height: auto;
  }
  .details-container {
    text-align: center;
    padding: 1rem;
  }
  .ratings {
    flex-direction: column;
    align-items: center;
  }
  .image-container img {
    border-radius: 10px 10px 0 0;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Key Challenges
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Image Overlay&lt;/strong&gt;&lt;br&gt;
Using &lt;code&gt;position: absolute&lt;/code&gt; for the overlay required careful attention to ensure it worked seamlessly with the image container.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Typography and Spacing&lt;/strong&gt;&lt;br&gt;
Balancing font sizes, line heights, and padding was critical to achieve a polished look.&lt;/p&gt;

&lt;p&gt;Check out the live version here: &lt;a href="https://shiny-frangollo-b13c2a.netlify.app/" rel="noopener noreferrer"&gt;https://shiny-frangollo-b13c2a.netlify.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check out the entire code here: &lt;a href="https://github.com/drishti1920/Frontend-Mentor-Challenges/tree/main/preview-card-component" rel="noopener noreferrer"&gt;https://github.com/drishti1920/Frontend-Mentor-Challenges/tree/main/preview-card-component&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;This project was a great way to practice building responsive components with clean, reusable code. I encourage you to try this challenge to improve your HTML and CSS skills.&lt;/p&gt;

&lt;p&gt;Happy coding! 🎉&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>learning</category>
      <category>css</category>
    </item>
  </channel>
</rss>
