<?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: JAKER HOSSAIN</title>
    <description>The latest articles on DEV Community by JAKER HOSSAIN (@jackfd120).</description>
    <link>https://dev.to/jackfd120</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%2F2589245%2F982beace-1ff1-4e10-bb1c-8200d1a864ca.png</url>
      <title>DEV Community: JAKER HOSSAIN</title>
      <link>https://dev.to/jackfd120</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jackfd120"/>
    <language>en</language>
    <item>
      <title>Building a Centralized Action for Large-Scale SaaS with Next.js</title>
      <dc:creator>JAKER HOSSAIN</dc:creator>
      <pubDate>Thu, 04 Dec 2025 08:49:27 +0000</pubDate>
      <link>https://dev.to/jackfd120/building-a-centralized-action-for-large-scale-saas-with-nextjs-53p7</link>
      <guid>https://dev.to/jackfd120/building-a-centralized-action-for-large-scale-saas-with-nextjs-53p7</guid>
      <description>&lt;p&gt;Learn how to implement a centralized mutation system for multi-tenant SaaS using Next.js Server Actions. Explore RBAC, multi-subdomain handling, cache revalidation, and scalable API patterns for secure, maintainable backend architecture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A. Architecture Overview&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In large SaaS projects, handling server actions individually in every module creates:&lt;/p&gt;

&lt;p&gt;1- Code duplication&lt;br&gt;
2- Inconsistent authorization checks&lt;br&gt;
3- Cache invalidation issues&lt;br&gt;
4 -Multi-tenant subdomain problems&lt;/p&gt;

&lt;p&gt;The centralized mutation engine consolidates all API mutations into one reusable function. It handles authentication, authorization, shop/subdomain context, request payloads, fetch execution, and cache revalidation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;B. Core Utilities&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;logger – Structured logging for debugging and monitoring.&lt;/p&gt;

&lt;p&gt;resolveModelName – Converts route names like &lt;em&gt;&lt;strong&gt;saved-attribute → saved_attribute.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;hasPermission &amp;amp; parseAccessRules – Implements RBAC to check if a user can perform a specific action.&lt;/p&gt;

&lt;p&gt;getBaseUrlWithSubdomain – Resolves the correct API base URL based on the shop subdomain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;C. Authentication Handling&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;if (requireAuth) {
  accessToken = cookieStore.get("accessToken")?.value;
  if (!accessToken) return { message: "You are not authorized to perform this action!" };
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-Validates JWT access token.&lt;br&gt;
-Immediately stops unauthorized requests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;D. Shop / Subdomain Context&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;if (requireShopId) {
  subdomain = cookieStore.get("shopSubdomain")?.value;
  if (!subdomain) return { message: "Shop identifier not found!" };
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-Supports multi-tenant SaaS using shop subdomains.&lt;br&gt;
-Injects x-app-identifier for API requests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;E. Role-Based Access Control (RBAC)&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;const rulesRaw = cookieStore.get("accessRules")?.value;
const rules = parseAccessRules(rulesRaw);
const model = resolveModelName(route.split("/")[1]);
const action = methodToAction[method];
if (!hasPermission(rules, model, action)) return { success: false, message: "Permission denied" };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-Maps HTTP methods → CRUD actions.&lt;br&gt;
-Validates permissions dynamically.&lt;br&gt;
-Ensures consistent security across the SaaS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;F. Dynamic Payload Handling&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;let body: string | undefined = undefined;
if (method === "DELETE" &amp;amp;&amp;amp; ids?.length) body = JSON.stringify({ ids });
else if (method !== "DELETE" &amp;amp;&amp;amp; data) body = data;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-Supports single ID deletion, bulk deletion, and POST/PUT payloads.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;G. Fetch Execution&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;const response = await fetch(url, { method, headers, body, cache: "no-store" });
const result = await response.json();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-Executes server-side mutations with fresh data (no-store).&lt;br&gt;
-Centralizes API interaction logic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;H. Cache Revalidation&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;paths.forEach(path =&amp;gt; typeof path === "string" &amp;amp;&amp;amp; revalidatePath(path));
tags.forEach(tag =&amp;gt; typeof tag === "string" &amp;amp;&amp;amp; revalidateTag(tag));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-Automatically revalidates Next.js paths or tags after mutation.&lt;br&gt;
-Ensures UI always reflects latest backend data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I. Error Handling &amp;amp; Logging&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;catch (error) {
  logger(error);
  return { success: false, message: "An error occurred during the mutation." };
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-Standardizes error handling.&lt;br&gt;
-Logs all server-side errors for monitoring.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;J. Benefits&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reusability – Single mutation handler for all models.&lt;/li&gt;
&lt;li&gt;Security – Global RBAC enforcement.&lt;/li&gt;
&lt;li&gt;Multi-Tenant Ready – Handles shop-specific subdomains.&lt;/li&gt;
&lt;li&gt;Consistency – Unified logging, error handling, and cache revalidation.&lt;/li&gt;
&lt;li&gt;Scalability – Easy to extend as SaaS grows.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;K. Usage Example&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;await mutation({
  route: "/customer",
  method: "POST",
  data: JSON.stringify({ name: "John Doe" }),
  pathToRevalidate: "/customers",
  tagsToRevalidate: ["customer-list"],
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-Handles authentication, RBAC, payload, and cache invalidation in one call.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                 ┌────────────────────┐
                 │  Client / Frontend │
                 │ (React / Next.js)  │
                 └─────────┬──────────┘
                           │
                           ▼
                 ┌────────────────────┐
                 │  Server Action Call│
                 │   mutation(params) │
                 └─────────┬──────────┘
                           │
             ┌─────────────┴─────────────┐
             │                           │
             ▼                           ▼
   ┌───────────────────┐        ┌───────────────────┐
   │  AUTHENTICATION   │        │ SHOP / SUBDOMAIN  │
   │ check JWT token   │        │ get shopidentifier│
   │ from cookies      │        │ from cookies      │
   └─────────┬─────────┘        └─────────┬─────────┘
             │                           │
             └─────────────┬─────────────┘
                           ▼
                 ┌────────────────────┐
                 │ ROLE-BASED ACCESS  │
                 │ CONTROL (RBAC)     │
                 │ hasPermission()    │
                 │ parseAccessRules() │
                 └─────────┬──────────┘
                           ▼
                 ┌────────────────────┐
                 │  Construct Headers │
                 │ - Authorization    │
                 │ - x-app-identifier │
                 └─────────┬──────────┘
                           ▼
                 ┌─────────────────────┐
                 │   Determine Payload │
                 │  - DELETE ids array │
                 │  - POST / PUT data  │
                 └─────────┬─────────  ┘
                           ▼
                 ┌────────────────────┐
                 │     FETCH Request  │
                 │   method, headers, │
                 │       body         │
                 └─────────┬──────────┘
                           ▼
                 ┌────────────────────┐
                 │  Response Handling │
                 │ - parse JSON       │
                 │ - log errors       │
                 └─────────┬──────────┘
                           ▼
             ┌─────────────┴─────────────┐
             │                           │
             ▼                           ▼
   ┌───────────────────┐        ┌──────────────────┐
   │ PATH REVALIDATION │        │ TAG REVALIDATION │
   │ revalidatePath()  │        │ revalidateTag()  │
   └─────────┬─────────┘        └────────┬─────────┘
             │                           │
             └─────────────┬─────────────┘
                           ▼
                 ┌─────────────────────┐
                 │      CLIENT UI      │
                 │  Updated with fresh │
                 │      data           │
                 └─────────────────────┘

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;M. Takeaways&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Centralized server actions reduce boilerplate and improve maintainability.&lt;/li&gt;
&lt;li&gt;RBAC ensures consistent security across all API mutations.&lt;/li&gt;
&lt;li&gt;Subdomain-aware multi-tenant architecture supports SaaS scalability.&lt;/li&gt;
&lt;li&gt;Automatic cache revalidation guarantees UI always displays fresh data.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Implementing a centralized mutation engine in a large-scale SaaS project dramatically improves code maintainability, security, and scalability. By consolidating authentication, role-based access control (RBAC), multi-tenant subdomain handling, payload management, and cache revalidation into a single server action, developers can:&lt;/p&gt;

&lt;p&gt;-Eliminate repetitive code across multiple endpoints.&lt;/p&gt;

&lt;p&gt;-Enforce consistent security with dynamic permission checks.&lt;/p&gt;

&lt;p&gt;-Support multi-tenant architectures efficiently via subdomain-aware API calls.&lt;/p&gt;

&lt;p&gt;-Ensure UI consistency by automatically revalidating Next.js paths and tags.&lt;/p&gt;

&lt;p&gt;-Scale easily as the SaaS grows, adding new models or endpoints without breaking existing logic.&lt;/p&gt;

&lt;p&gt;In essence, this approach creates a robust, maintainable, and secure foundation for handling server-side mutations in any complex SaaS ecosystem. It’s a best-practice architecture that balances developer efficiency, security, and performance, making your backend easier to manage and your frontend more reliable.&lt;/p&gt;

&lt;p&gt;👨‍💻 About the Author&lt;br&gt;
Name: &lt;strong&gt;JAKER HOSSAIN&lt;/strong&gt;&lt;br&gt;
Username: &lt;a class="mentioned-user" href="https://dev.to/jackfd120"&gt;@jackfd120&lt;/a&gt;&lt;br&gt;
Role: Senior Frontend Developer&lt;br&gt;
Portfolio: &lt;a href="https://www.poranfolio.space/" rel="noopener noreferrer"&gt;https://www.poranfolio.space/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>nextjs</category>
      <category>typescript</category>
      <category>software</category>
    </item>
    <item>
      <title>Simplifying Query Parameters in Next.js 14/15 with React Query and TypeScript</title>
      <dc:creator>JAKER HOSSAIN</dc:creator>
      <pubDate>Thu, 19 Jun 2025 08:43:47 +0000</pubDate>
      <link>https://dev.to/jackfd120/simplifying-query-parameters-in-nextjs-1415-with-react-query-and-typescript-4755</link>
      <guid>https://dev.to/jackfd120/simplifying-query-parameters-in-nextjs-1415-with-react-query-and-typescript-4755</guid>
      <description>&lt;p&gt;Take control of query parameters using TypeScript-powered utilities like &lt;strong&gt;queryExtractor&lt;/strong&gt;, &lt;strong&gt;paramsExtractor&lt;/strong&gt;, and &lt;strong&gt;fetchData&lt;/strong&gt;. A real-world guide to scaling your dynamic pages in React &amp;amp; Next.js&lt;/p&gt;

&lt;p&gt;📌 Overview&lt;br&gt;
If you're building a modern frontend application with Next.js App Router (14/15), you’re likely dealing with query params for:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search&lt;/li&gt;
&lt;li&gt;Filter (price range, brand, category, color)&lt;/li&gt;
&lt;li&gt;Sort&lt;/li&gt;
&lt;li&gt;Pagination&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This article will walk you through how to parse, build, and use query parameters using powerful, reusable TypeScript utilities like:&lt;/p&gt;

&lt;p&gt;🔍 &lt;a href="https://medium.com/@jackfd120/one-function-endless-possibilities-meet-paramsextractor-bce06684ef09" rel="noopener noreferrer"&gt;paramsExtractor&lt;/a&gt;&lt;br&gt;
🔧 queryExtractor&lt;br&gt;
⚙️ &lt;a href="https://medium.com/@jackfd120/-59ad3af4c739" rel="noopener noreferrer"&gt;fetchData&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🧠 Why This Approach?&lt;br&gt;
✅ Next.js 14 compatible — works with App Router and server components&lt;br&gt;
✅ Type-safe and reusable&lt;br&gt;
✅ Easily composable with filters, pagination, and API queries&lt;br&gt;
✅ Works seamlessly with React Query or server-side fetching&lt;br&gt;
✅ Clean and maintainable for long-term scaling&lt;/p&gt;

&lt;p&gt;🧩 &lt;strong&gt;Example: Category Page in Next.js&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;const CategoryPage = async ({
  searchParams,
}: {
  searchParams: Promise&amp;lt;Record&amp;lt;string, string | string[]&amp;gt; | undefined&amp;gt;;
}) =&amp;gt; {
  const { filter } = await paramsExtractor({
    searchParam: searchParams,
  });

  const stringifiedQuery = queryExtractor({
    sortBy: filter?.sortBy,
    extra: {
      "variants.sellingPrice[gte]": filter?.min_price,
      "variants.sellingPrice[lte]": filter?.max_price,
      "variants.variantName": filter?.color_name
        ? filter.color_name.split(",").map((b) =&amp;gt; b.trim())
        : [],
      "brand.brandName": filter?.brandNames
        ? filter.brandNames.split(",").map((b) =&amp;gt; b.trim())
        : [],
      "category.categoryName": filter?.categoryNames
        ? filter.categoryNames.split(",").map((b) =&amp;gt; b.trim())
        : [],
    },
  });

  const productsData = await fetchData({
    route: "/product",
    query: stringifiedQuery,
    limit: 18,
    tags: ["/product"],
  });

  // render your component using productsData
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🧩 What Is &lt;strong&gt;&lt;a href="https://medium.com/@jackfd120/one-function-endless-possibilities-meet-paramsextractor-bce06684ef09" rel="noopener noreferrer"&gt;paramsExtractor&lt;/a&gt;&lt;/strong&gt;?&lt;br&gt;
If you haven’t read it yet, check out the full breakdown of paramsExtractor. It's a utility that parses searchParams from Next.js and returns a normalized object with:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Cleaned values&lt;/li&gt;
&lt;li&gt;Mapped keys&lt;/li&gt;
&lt;li&gt;Optional conversion to array, number, or string&lt;/li&gt;
&lt;li&gt;Proper defaults&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Perfect for server-side usage in dynamic routes like /category?brand=Apple,Samsung&amp;amp;sortBy=price.&lt;/p&gt;

&lt;p&gt;🔧 &lt;strong&gt;queryExtractor&lt;/strong&gt;: Build Clean Query Strings&lt;br&gt;
This utility transforms a QueryOptions object into a query string with support for:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Defaults&lt;/li&gt;
&lt;li&gt;Nested filtering (e.g., variants.sellingPrice[gte])&lt;/li&gt;
&lt;li&gt;Arrays&lt;/li&gt;
&lt;li&gt;Optional values&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;⚡ &lt;strong&gt;fetchData: Data Fetching Made Clean&lt;/strong&gt;&lt;br&gt;
fetchData is an abstraction over fetch (or Axios) with a powerful config API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;await fetchData({
  route: "/product",
  query: "category=Phone&amp;amp;brand=Apple",
  limit: 18,
  tags: ["/product"],
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More on this utility in the official guide 👉 &lt;strong&gt;&lt;a href="https://medium.com/@jackfd120/-59ad3af4c739" rel="noopener noreferrer"&gt;read now&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;🧵 &lt;strong&gt;Connect Everything&lt;/strong&gt;&lt;br&gt;
With these 3 pieces, your Next.js dynamic page becomes scalable and maintainable:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;paramsExtractor&lt;/strong&gt;: Server-side param parsing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;queryExtractor&lt;/strong&gt;: Build structured queries&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;fetchData&lt;/strong&gt;: Fetch paginated, sorted, and filtered data from the backend&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All of this while keeping TypeScript and React Query (or fetch) integration seamless.&lt;/p&gt;

&lt;p&gt;🔧 &lt;strong&gt;Using queryExtractor as a Standalone Utility&lt;/strong&gt;&lt;br&gt;
📦 Step 1: Add the Utility Function&lt;br&gt;
Here’s the complete code for &lt;strong&gt;queryExtractor&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;export interface QueryOptions {
  searchTerm?: string;
  sortBy?: string;
  sortOrder?: "asc" | "desc";
  page?: number;
  limit?: number;
  extra?: Record&amp;lt;string, any&amp;gt;;
}

export const queryExtractor = ({
  searchTerm,
  sortBy = "created_at",
  sortOrder = "desc",
  page = 1,
  limit = 10,
  extra = {},
}: QueryOptions): string =&amp;gt; {
  const query = new URLSearchParams();

  if (searchTerm?.trim()) query.set("searchTerm", searchTerm.trim());
  query.set("sortBy", sortBy);
  query.set("sortOrder", sortOrder);
  query.set("page", Math.max(1, page).toString());
  query.set("limit", Math.max(1, limit).toString());

  Object.entries(extra).forEach(([key, value]) =&amp;gt; {
    if (value !== undefined &amp;amp;&amp;amp; value !== null) {
      if (Array.isArray(value)) {
        value.forEach((val) =&amp;gt; {
          if (val !== "") query.append(key, String(val));
        });
      } else {
        query.append(key, String(value));
      }
    }
  });

  return query.toString();
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;strong&gt;Step 2: Basic Example&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;import { queryExtractor } from "./queryExtractor";

const queryString = queryExtractor({
  searchTerm: "laptop",
  sortBy: "price",
  sortOrder: "asc",
  page: 2,
  limit: 20,
  extra: {
    "brand": ["HP", "Dell"],
    "category": "Electronics",
    "price[gte]": 1000,
    "price[lte]": 3000,
  },
});

console.log(queryString);

// Output:
// searchTerm=laptop&amp;amp;sortBy=price&amp;amp;sortOrder=asc&amp;amp;page=2&amp;amp;limit=20&amp;amp;brand=HP&amp;amp;brand=Dell&amp;amp;category=Electronics&amp;amp;price[gte]=1000&amp;amp;price[lte]=3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;💡Pro Tips&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Supports arrays (e.g. brand=HP&amp;amp;brand=Dell)&lt;/li&gt;
&lt;li&gt;Ignores empty/null/undefined values&lt;/li&gt;
&lt;li&gt;Safe defaults for sortBy, sortOrder, page, and limit&lt;/li&gt;
&lt;li&gt;Can be reused anywhere: backend services, Node.js CLI tools, etc.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;🏁 &lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;br&gt;
This setup:&lt;/p&gt;

&lt;p&gt;✅ Makes query management clean and DRY&lt;br&gt;
✅ Enhances developer experience with strong typing&lt;br&gt;
✅ Scales easily with complex filters&lt;br&gt;
✅ Plays nicely with Next.js App Router&lt;br&gt;
✅ Perfect for dynamic category/product/search pages&lt;/p&gt;

&lt;p&gt;👨‍💻 About the Author&lt;br&gt;
Name: JAKER HOSSAIN&lt;br&gt;
Username: &lt;a class="mentioned-user" href="https://dev.to/jackfd120"&gt;@jackfd120&lt;/a&gt;&lt;br&gt;
Role: Senior Frontend Developer&lt;br&gt;
Portfolio: &lt;a href="https://www.poranfolio.space/" rel="noopener noreferrer"&gt;https://www.poranfolio.space/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I write about scalable frontend architecture, modern React/Next.js patterns, and TypeScript best practices.&lt;br&gt;
If you liked this post, feel free to follow or reach out via my portfolio!&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>typescript</category>
      <category>react</category>
      <category>api</category>
    </item>
    <item>
      <title>What is React.js and Why You Should Learn It in 2025</title>
      <dc:creator>JAKER HOSSAIN</dc:creator>
      <pubDate>Thu, 29 May 2025 14:49:02 +0000</pubDate>
      <link>https://dev.to/jackfd120/what-is-reactjs-and-why-you-should-learn-it-in-2025-5c20</link>
      <guid>https://dev.to/jackfd120/what-is-reactjs-and-why-you-should-learn-it-in-2025-5c20</guid>
      <description>&lt;p&gt;React.js is a popular JavaScript library for building modern, dynamic, and high-performance user interfaces (UI). It was developed by Facebook (now Meta) in 2013 and has since become the most widely used frontend library in the world.&lt;/p&gt;

&lt;p&gt;One of React’s core strengths is its component-based architecture, which allows developers to break down the UI into reusable, manageable components. This leads to cleaner, more scalable code.&lt;/p&gt;

&lt;p&gt;✨ &lt;strong&gt;Why Learn React.js?&lt;/strong&gt;&lt;br&gt;
React offers several advantages that make it a top choice for frontend development:&lt;/p&gt;

&lt;p&gt;✅ Fast, Dynamic, and Interactive UI: React utilizes a virtual DOM to efficiently update only the parts of the UI that have changed.&lt;br&gt;
✅ Build Single Page Applications (SPAs): Create seamless, fast-loading web apps that feel like native applications.&lt;br&gt;
✅ Cross-Platform App Development with React Native: Use the same skills to build both web and mobile apps.&lt;br&gt;
✅ High Demand in Job &amp;amp; Freelance Markets: React developers are in huge demand across freelancing platforms and tech companies.&lt;br&gt;
✅ Perfect Fit with Backend APIs: Easily connect React to REST APIs built with Node.js, Django, Flask, or FastAPI.&lt;/p&gt;

&lt;p&gt;🔥 &lt;strong&gt;Why React.js is Essential to Learn in 2025&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Most In-Demand Frontend Skill&lt;/strong&gt;&lt;br&gt;
React continues to top the charts in JavaScript framework rankings. Tech giants like Google, Facebook, Netflix, Airbnb, and Instagram all rely on React in production.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;High Salary Opportunities&lt;/strong&gt;&lt;br&gt;
React developers command high salaries — even 6-figure USD salaries are common in the USA, Europe, or remote-first companies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;One Codebase for Web &amp;amp; Mobile&lt;/strong&gt;&lt;br&gt;
With React Native, you can use the same JavaScript and React knowledge to build native mobile apps for both Android and iOS.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Perfect Match with Backend Technologies&lt;/strong&gt;&lt;br&gt;
React works flawlessly with any backend — whether it’s Node.js, Django REST Framework, or FastAPI — making it ideal for full-stack development.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dominates Freelancing Platforms&lt;/strong&gt;&lt;br&gt;
On Fiverr, Upwork, and Freelancer, React is one of the most requested skills for web application projects.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;👨‍💻 &lt;strong&gt;Career Opportunities as a React.js Developer&lt;/strong&gt;&lt;br&gt;
Whether you want to freelance or land a full-time role, here are some paths React.js can lead you to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Frontend Developer — Work in product-based or SaaS companies&lt;/li&gt;
&lt;li&gt;Full-Stack Developer — MERN (MongoDB, Express, React, Node), PERN, or DJR (Django + React)&lt;/li&gt;
&lt;li&gt;Mobile App Developer — With React Native&lt;/li&gt;
&lt;li&gt;UI/UX-Oriented Web Developer&lt;/li&gt;
&lt;li&gt;Freelance Web Application Specialist&lt;/li&gt;
&lt;li&gt;JAMstack Developer — Combine React with Headless CMS (e.g., Contentful, Strapi)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;📘 &lt;strong&gt;Where to Start? Recommended Learning Resources&lt;/strong&gt;&lt;br&gt;
📚 &lt;strong&gt;Books&lt;/strong&gt;:&lt;br&gt;
The Road to React — Robin Wieruch&lt;br&gt;
Learning React — Alex Banks &amp;amp; Eve Porcello&lt;br&gt;
Fullstack React — Anthony Accomazzo&lt;/p&gt;

&lt;p&gt;🎓 &lt;strong&gt;Online Courses&lt;/strong&gt;:&lt;br&gt;
freeCodeCamp — React Full Course&lt;br&gt;
Udemy — React — The Complete Guide by Maximilian Schwarzmüller&lt;br&gt;
Scrimba — Learn React for Free&lt;/p&gt;

&lt;p&gt;🎥 &lt;strong&gt;YouTube Channels&lt;/strong&gt;:&lt;br&gt;
Learn with Sumit — One of the best React playlists in Bangla&lt;br&gt;
Codevolution, The Net Ninja, Traversy Media — Great React tutorials in English&lt;/p&gt;

&lt;p&gt;📌 &lt;strong&gt;Sources&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;ReactJS Official Documentation&lt;/li&gt;
&lt;li&gt;GitHub Stars &amp;amp; Trends&lt;/li&gt;
&lt;li&gt;Stack Overflow &amp;amp; Developer Surveys&lt;/li&gt;
&lt;li&gt;ChatGPT research synthesis&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;React.js isn’t just a trend — it’s a career-changing skill. Whether you’re building complex applications, starting freelancing, or diving into full-stack development, React is the key to unlocking those doors in 2025.&lt;/p&gt;

&lt;p&gt;✍️ Written by: &lt;strong&gt;JAKER HOSSAIN&lt;/strong&gt;&lt;br&gt;
Frontend Developer at expertsquad.net&lt;br&gt;
Contact: &lt;a href="https://www.poranfolio.space/" rel="noopener noreferrer"&gt;https://www.poranfolio.space/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>programming</category>
      <category>development</category>
    </item>
    <item>
      <title>Frontend Developer Resume: Tips, Structure &amp; What Gets Interviews</title>
      <dc:creator>JAKER HOSSAIN</dc:creator>
      <pubDate>Sun, 04 May 2025 15:30:11 +0000</pubDate>
      <link>https://dev.to/jackfd120/frontend-developer-resume-tips-structure-what-gets-interviews-2n2h</link>
      <guid>https://dev.to/jackfd120/frontend-developer-resume-tips-structure-what-gets-interviews-2n2h</guid>
      <description>&lt;p&gt;A practical, no-fluff guide to crafting a frontend developer resume that stands out — with examples, formatting advice, and real-world insights for junior to mid-level developers.&lt;/p&gt;

&lt;p&gt;🧠 &lt;strong&gt;Why This Post?&lt;/strong&gt;&lt;br&gt;
Most frontend developers spend hours perfecting their portfolios and GitHub repos, but struggle to present their skills effectively on a resume. This post breaks down &lt;strong&gt;exactly what to include&lt;/strong&gt;, how to &lt;strong&gt;structure your resume&lt;/strong&gt;, and &lt;strong&gt;what mistakes to avoid&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;📦 &lt;strong&gt;What This Guide Covers&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The must-have &lt;strong&gt;sections&lt;/strong&gt; of a frontend resume&lt;/li&gt;
&lt;li&gt;How to structure your content&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Project description&lt;/strong&gt; examples that get noticed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Formatting &amp;amp; keyword&lt;/strong&gt; tips&lt;/li&gt;
&lt;li&gt;Final export &amp;amp; sharing strategies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🧱 &lt;strong&gt;Resume Structure: Section-by-Section Breakdown&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;🔹 1. Header&lt;/strong&gt;&lt;br&gt;
Should contain:&lt;/p&gt;

&lt;p&gt;-Full Name&lt;br&gt;
-Job Title (e.g., Frontend Developer)&lt;br&gt;
-Location (City, Country — optional)&lt;br&gt;
-GitHub, Portfolio, LinkedIn&lt;br&gt;
-Email&lt;/p&gt;

&lt;p&gt;✅ Example:&lt;br&gt;
&lt;code&gt;Jane Doe  &lt;br&gt;
Frontend Developer  &lt;br&gt;
📍 Berlin, Germany  &lt;br&gt;
🌐 janedoe.dev | 🐙 github.com/janedoe | 🔗 linkedin.com/in/janedoe  &lt;br&gt;
📧 jane.doe@gmail.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;🔹 &lt;strong&gt;2. Professional Summary&lt;/strong&gt;&lt;br&gt;
A concise snapshot of who you are, what you do, and what you bring to the table.&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;Frontend Developer with 2+ years of experience building responsive, performant web applications using React, Next.js, and modern CSS frameworks. Passionate about clean code, UI/UX, and shipping accessible user interfaces.&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;🔹 &lt;strong&gt;3. Skills&lt;/strong&gt;&lt;br&gt;
Categorize your tools, frameworks, and languages.&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;🧠 Languages: HTML5, CSS3, JavaScript (ES6+), TypeScript  &lt;br&gt;
⚙️ Frameworks: React.js, Next.js, Redux, Tailwind CSS, Bootstrap  &lt;br&gt;
🔧 Tools: Git, GitHub, VS Code, Figma, Chrome DevTools  &lt;br&gt;
🌐 Others: REST APIs, Responsive Design, Web Performance, SEO Basics&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;🔹 &lt;strong&gt;4. Projects (Core Section)&lt;/strong&gt;&lt;br&gt;
Select 3–5 key projects. Show what the project is, what you used, and what impact you had.&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Example:&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;🛒 E-Shop — E-Commerce Web App  
🔗 [Live Demo](https://eshop.com) | [GitHub](https://github.com/eshop/eshop)

- Developed a responsive e-commerce frontend with React and Tailwind CSS.
- Implemented dynamic filters for price, brand, and rating.
- Optimized loading time using lazy loading and image compression.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔹 &lt;strong&gt;5. Experience&lt;/strong&gt;&lt;br&gt;
Include job roles or internships. Use bullet points to describe contributions.&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Example:&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;Frontend Developer  
TechNova Agency | Remote | Jan 2023 – Present
- Collaborated with backend engineers to deliver fully functional admin dashboards.
- Reduced initial page load by 50% using code splitting and performance optimization.
- Built and maintained a design system using Storybook.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔹 &lt;strong&gt;6. Education &amp;amp; Certifications&lt;/strong&gt;&lt;br&gt;
List your formal education and relevant certifications.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;🎓 B.Sc. in Computer Science  
XYZ University, 2021  

📜 Certifications:  
- The Complete JavaScript Course (Udemy)  
- Responsive Web Design – freeCodeCamp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔹 &lt;strong&gt;7. Optional Sections&lt;/strong&gt;&lt;br&gt;
Include these if applicable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🛠 Open Source Contributions&lt;/li&gt;
&lt;li&gt;📝 Technical Blogs&lt;/li&gt;
&lt;li&gt;🏆 Awards / Hackathons&lt;/li&gt;
&lt;li&gt;🌍 Languages&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🎨 &lt;strong&gt;Resume Formatting Best Practices&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stick to one page&lt;/li&gt;
&lt;li&gt;Use consistent formatting&lt;/li&gt;
&lt;li&gt;Highlight tools &amp;amp; outcomes over responsibilities&lt;/li&gt;
&lt;li&gt;Avoid long paragraphs — stick to bullets&lt;/li&gt;
&lt;li&gt;Use action verbs: built, developed, implemented, optimized&lt;/li&gt;
&lt;li&gt;Export as a PDF&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;⚠️ &lt;strong&gt;Mistakes to Avoid&lt;/strong&gt;&lt;br&gt;
❌ Listing every tech you've ever heard of&lt;br&gt;
❌ Projects with no context or links&lt;br&gt;
❌ Overused phrases like "hardworking team player"&lt;br&gt;
❌ Spelling and grammar mistakes&lt;br&gt;
❌ Generic, unfocused summaries&lt;/p&gt;

&lt;p&gt;✍️ &lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;br&gt;
Your resume is your &lt;strong&gt;first impression&lt;/strong&gt; in the hiring process. It should clearly show what you've built, what tools you know, and what problems you've solved.&lt;/p&gt;

&lt;p&gt;Focus on outcomes, be concise, and keep improving it as you grow. A great resume doesn’t need to be flashy — just clear, honest, and focused on what matters.&lt;/p&gt;

&lt;p&gt;💬 &lt;strong&gt;Got Questions?&lt;/strong&gt;&lt;br&gt;
Have your own tips? Need feedback on your resume or portfolio? Feel free to drop a comment below or connect via GitHub or LinkedIn. Let’s grow together! 🚀&lt;/p&gt;

</description>
      <category>career</category>
      <category>programming</category>
      <category>hiring</category>
      <category>interview</category>
    </item>
    <item>
      <title>Front-end Developer vs Front-end Engineer: What's the Real Difference?</title>
      <dc:creator>JAKER HOSSAIN</dc:creator>
      <pubDate>Sun, 27 Apr 2025 09:14:15 +0000</pubDate>
      <link>https://dev.to/jackfd120/front-end-developer-vs-front-end-engineer-whats-the-real-difference-2e32</link>
      <guid>https://dev.to/jackfd120/front-end-developer-vs-front-end-engineer-whats-the-real-difference-2e32</guid>
      <description>&lt;p&gt;In today’s fast-evolving tech world, job titles often blur together, and one of the most common areas of confusion is the difference between a Frontend Developer and a Frontend Engineer. While both work on the &lt;strong&gt;"front"&lt;/strong&gt; of applications that users interact with, the roles aren't always identical. Understanding the distinction can help you better define your career path, hire the right talent, or navigate tech discussions with more confidence.&lt;/p&gt;

&lt;p&gt;In this article, we'll break down the &lt;strong&gt;true differences&lt;/strong&gt; between a frontend developer and a frontend engineer — from skills to responsibilities, and even mindsets.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;What is a Frontend Developer?&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A &lt;strong&gt;Frontend Developer&lt;/strong&gt; is primarily responsible for bringing &lt;strong&gt;visual designs&lt;/strong&gt; to life and ensuring a great user experience. They translate &lt;strong&gt;UI/UX&lt;/strong&gt; designs into fully functional web pages or applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Core Responsibilities:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Implementing responsive and accessible web interfaces.&lt;/li&gt;
&lt;li&gt;Building pages using HTML, CSS, and JavaScript.&lt;/li&gt;
&lt;li&gt;Working with frontend frameworks like React, Vue, or Angular.&lt;/li&gt;
&lt;li&gt;Ensuring cross-browser compatibility.&lt;/li&gt;
&lt;li&gt;Integrating with backend APIs to display dynamic content.&lt;/li&gt;
&lt;li&gt;Collaborating with designers to match the intended user experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Focus Areas:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visual design to code translation.&lt;/li&gt;
&lt;li&gt;User interactivity and basic animations.&lt;/li&gt;
&lt;li&gt;Mobile-first and responsive development.&lt;/li&gt;
&lt;li&gt;Performance tuning at a basic level (e.g., image optimization).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;In short:&lt;/strong&gt; A frontend developer ensures that users have a beautiful, functional, and responsive experience.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;What is a Frontend Engineer?&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A &lt;strong&gt;Frontend Engineer&lt;/strong&gt; carries out all the duties of a frontend developer, but with a deeper technical focus. Their work doesn't stop at implementing designs — they also &lt;strong&gt;architect systems, optimize performance, and solve complex engineering challenges&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Core Responsibilities:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Designing scalable frontend architectures.&lt;/li&gt;
&lt;li&gt;Managing complex application states (e.g., using Redux, Zustand, or custom state managers).&lt;/li&gt;
&lt;li&gt;Performance optimization beyond surface-level tweaks (e.g., lazy loading, code splitting, bundle analysis).&lt;/li&gt;
&lt;li&gt;Implementing advanced testing strategies (unit tests, integration tests, end-to-end tests).&lt;/li&gt;
&lt;li&gt;Working with build tools (Webpack, Vite, Rollup) and CI/CD pipelines.&lt;/li&gt;
&lt;li&gt;Deep debugging (network issues, memory leaks, performance bottlenecks).&lt;/li&gt;
&lt;li&gt;Security awareness (XSS, CSRF prevention, secure authentication flows).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Focus Areas:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Application performance and scalability.&lt;/li&gt;
&lt;li&gt;Code maintainability and best practices.&lt;/li&gt;
&lt;li&gt;Setting up frontend infrastructure and tooling.&lt;/li&gt;
&lt;li&gt;Engineering for future-proofing (e.g., reusable design systems).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;In short:&lt;/strong&gt; A frontend engineer thinks beyond the page — &lt;strong&gt;they design systems that are scalable, efficient, and maintainable&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Frontend Developer vs Frontend Engineer: A Head-to-Head Comparison&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;(&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bjc500nxtnno6ku8hguv.png" rel="noopener noreferrer"&gt;https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bjc500nxtnno6ku8hguv.png&lt;/a&gt;)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Why Does This Distinction Matter?&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;For Developers:&lt;/strong&gt; Knowing the difference helps you plan your growth. If you want to deepen your technical expertise and have a bigger impact on system architecture, aiming to become a frontend engineer might be your next step.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;For Hiring Managers:&lt;/strong&gt; Setting the right expectations when hiring ensures you get the right skillset for the job at hand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;For the Industry:&lt;/strong&gt; Clearer role definitions lead to more efficient teams and better communication between departments.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Final Thoughts&lt;/strong&gt;
At many companies — especially startups — the titles "Frontend Developer" and "Frontend Engineer" are used interchangeably. The real key lies in the &lt;strong&gt;depth of technical expertise and architectural ownership&lt;/strong&gt; expected from the role.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you’re starting out, &lt;strong&gt;focus on mastering the fundamentals&lt;/strong&gt; as a frontend developer. As you grow, dig deeper into &lt;strong&gt;engineering best practices&lt;/strong&gt; and &lt;strong&gt;system design&lt;/strong&gt; to transition into a frontend engineer role.&lt;/p&gt;

&lt;p&gt;Remember: It's not just about what you build — &lt;strong&gt;it's about how well you build it&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;✍️ Written by: JAKER HOSSAIN&lt;br&gt;
Frontend Developer at &lt;strong&gt;&lt;a href="https://www.expertsquad.net/" rel="noopener noreferrer"&gt;expertsquad.net&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>frontend</category>
      <category>programming</category>
    </item>
    <item>
      <title>7 Essential JavaScript Interview Questions for Beginners (With Solutions &amp; Explanations)</title>
      <dc:creator>JAKER HOSSAIN</dc:creator>
      <pubDate>Tue, 22 Apr 2025 13:13:36 +0000</pubDate>
      <link>https://dev.to/jackfd120/7-essential-javascript-interview-questions-for-beginners-with-solutions-explanations-2d8c</link>
      <guid>https://dev.to/jackfd120/7-essential-javascript-interview-questions-for-beginners-with-solutions-explanations-2d8c</guid>
      <description>&lt;p&gt;JavaScript is one of the most in-demand programming languages today. Whether you're preparing for your first job interview or brushing up on your fundamentals, mastering the basics is essential.&lt;/p&gt;

&lt;p&gt;In this article, I've compiled 10 beginner-level JavaScript interview questions, complete with solutions and explanations, to help you build confidence and deepen your understanding.&lt;/p&gt;

&lt;p&gt;Let’s dive in! 👇&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Question 1&lt;/strong&gt;: What are the different ways to declare variables in JavaScript?&lt;br&gt;
☑️Solution:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var name = "Alice";  // function-scoped
let age = 25;        // block-scoped
const country = "USA"; // block-scoped, constant

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

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;var&lt;/strong&gt; is function-scoped and allows redeclaration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;let&lt;/strong&gt; is block-scoped and allows reassignment but not redeclaration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;const&lt;/strong&gt; is block-scoped and does not allow reassignment or redeclaration.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Question 2&lt;/strong&gt;: What is the difference between == and ===?&lt;br&gt;
☑️&lt;strong&gt;Solution&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;'5' == 5    // true (loose equality)
'5' === 5   // false (strict equality)
&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;&lt;p&gt;&lt;strong&gt;==&lt;/strong&gt; checks for value only and performs type coercion.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;===&lt;/strong&gt; checks for both value and type, making it more reliable.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Question 3&lt;/strong&gt;: What are the primitive data types in JavaScript?&lt;br&gt;
☑️&lt;strong&gt;Solution:&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;let str = "Hello";      // String
let num = 42;           // Number
let isOnline = true;    // Boolean
let nothing = null;     // Null
let notDefined;         // Undefined
let id = Symbol('id');  // Symbol
let bigInt = 9007199254740991n; // BigInt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 Explanation:&lt;/strong&gt;&lt;br&gt;
JavaScript has 7 primitive types: &lt;strong&gt;String&lt;/strong&gt;, &lt;strong&gt;Number&lt;/strong&gt;, &lt;strong&gt;Boolean&lt;/strong&gt;, &lt;strong&gt;null&lt;/strong&gt;, &lt;strong&gt;undefined&lt;/strong&gt;, &lt;strong&gt;Symbol&lt;/strong&gt;, and &lt;strong&gt;BigInt&lt;/strong&gt;. These are immutable and stored by value.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Question 4:&lt;/strong&gt; How do you check the type of a variable?&lt;br&gt;
&lt;strong&gt;☑️Solution:&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;typeof "hello";  // "string"
typeof 42;       // "number"
typeof null;     // "object" (quirky behavior!)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Question 5:&lt;/strong&gt; What is the DOM?&lt;br&gt;
&lt;strong&gt;☑️Solution:&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;document.getElementById("app").innerText = "Hello World!";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The DOM (Document Object Model)&lt;/strong&gt; is a way JavaScript can interact with HTML and CSS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Question 6:&lt;/strong&gt; What’s the difference between &lt;strong&gt;var&lt;/strong&gt;, &lt;strong&gt;let&lt;/strong&gt;, and &lt;strong&gt;const&lt;/strong&gt;?&lt;br&gt;
&lt;strong&gt;☑️Solution:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;(&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h00m833c53b7a3kxt0rg.png" rel="noopener noreferrer"&gt;https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h00m833c53b7a3kxt0rg.png&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Question 7:&lt;/strong&gt; How does JavaScript compare different types?&lt;br&gt;
&lt;strong&gt;☑️Solution:&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;'5' == 5          // true
'5' === 5         // false
null == undefined // true
null === undefined // false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>interview</category>
      <category>career</category>
      <category>programming</category>
    </item>
    <item>
      <title>🚀Reusable React Input Component for Tags &amp; Colors – Built with TypeScript</title>
      <dc:creator>JAKER HOSSAIN</dc:creator>
      <pubDate>Sun, 20 Apr 2025 13:48:21 +0000</pubDate>
      <link>https://dev.to/jackfd120/reusable-react-input-component-for-tags-colors-built-with-typescript-5078</link>
      <guid>https://dev.to/jackfd120/reusable-react-input-component-for-tags-colors-built-with-typescript-5078</guid>
      <description>&lt;p&gt;Want to allow users to add and manage color names like tags—complete with a tiny preview bubble?&lt;/p&gt;

&lt;p&gt;In this post, we’ll build a reusable, responsive, and accessible color picker input field using:&lt;/p&gt;

&lt;p&gt;⚛️ React (TypeScript)&lt;br&gt;
🎨 Tailwind CSS&lt;br&gt;
💡 Keyboard support for Enter and Space to add colors&lt;br&gt;
🏷️ Inline tag-style preview with removable color bubbles&lt;/p&gt;

&lt;p&gt;Perfect for eCommerce dashboards, product editors, or any UI requiring dynamic color variants.&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Pros&lt;/strong&gt;&lt;br&gt;
⚡ Fully reusable component – Just pass variants and setVariants state.&lt;br&gt;
🎨 Color bubble preview – Visually shows added colors.&lt;br&gt;
🧠 Prevents duplicate entries – Smart check before adding.&lt;br&gt;
⌨️ Keyboard-friendly – Add colors via Enter or Space.&lt;br&gt;
🔥 Styled with Tailwind CSS – Clean, responsive design out of the box.&lt;br&gt;
🧩 TypeScript support – Strong typing for better DX.&lt;/p&gt;

&lt;p&gt;⚠️ &lt;strong&gt;Cons&lt;/strong&gt;&lt;br&gt;
❌ No color validation (you can enter invalid color names like blaaaack)&lt;br&gt;
🧪 Doesn’t use native  — it's text-based&lt;br&gt;
🗂️ Doesn’t support hex codes or color pickers (unless extended)&lt;/p&gt;

&lt;p&gt;🛠️ Tip: You can improve it by adding color name validation or integrating a color picker library like react-colorful.&lt;/p&gt;

&lt;p&gt;💡 &lt;strong&gt;Why You Should Use This&lt;/strong&gt;&lt;br&gt;
If you’re building a dashboard, admin panel, or storefront editor that needs customizable product variants (like colors), this component:&lt;/p&gt;

&lt;p&gt;1- Saves time by being ready to drop into any project.&lt;br&gt;
2- Makes UX delightful by allowing instant color tagging.&lt;br&gt;
3- Promotes code reuse with a clean, state-managed approach.&lt;br&gt;
&lt;/p&gt;

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

interface Variant {
  variantName: string;
}

interface CustomInputColorPickUpProps {
  label?: string;
  variants: Variant[];
  setVariants: (variants: Variant[]) =&amp;gt; void;
  placeholder?: string;
}

const CustomInputColorPickUp = ({
  label,
  variants,
  setVariants,
  placeholder = "Color Name",
}: CustomInputColorPickUpProps) =&amp;gt; {
  const [colorInput, setColorInput] = useState&amp;lt;string&amp;gt;("");

  const handleKeyDown = (e: KeyboardEvent&amp;lt;HTMLInputElement&amp;gt;): void =&amp;gt; {
    if ((e.key === "Enter" || e.key === " ") &amp;amp;&amp;amp; colorInput.trim()) {
      e.preventDefault();

      const normalizedInput = colorInput.trim().toLowerCase();

      const isDuplicate = variants?.some(
        (variant) =&amp;gt; variant.variantName.toLowerCase() === normalizedInput
      );

      if (!isDuplicate) {
        setVariants([...variants, { variantName: colorInput.trim() }]);
      }

      setColorInput("");
    }
  };

  const handleRemove = (variantName: string) =&amp;gt; {
    setVariants(variants.filter((v) =&amp;gt; v.variantName !== variantName));
  };

  return (
    &amp;lt;div className="flex flex-col gap-2.5 w-full"&amp;gt;
      {label &amp;amp;&amp;amp; (
        &amp;lt;label
          htmlFor={label.toLowerCase()}
          className="text-black-50 text-base"
        &amp;gt;
          {label}
        &amp;lt;/label&amp;gt;
      )}
      &amp;lt;div className="border border-black-10 rounded-md px-5 py-2 flex items-center gap-2 overflow-x-auto scrollbar-x-remove"&amp;gt;
        {variants.map((variant, index) =&amp;gt; (
          &amp;lt;div
            key={index}
            className="flex items-center rounded-sm bg-black-10 px-2"
          &amp;gt;
            &amp;lt;div
              style={{
                width: "13px",
                height: "13px",
                backgroundColor: variant.variantName,
                borderRadius: "50%",
                marginRight: "5px",
              }}
            /&amp;gt;
            &amp;lt;span className="text-[15px]"&amp;gt;
              {variant.variantName || "Not Specified"}
            &amp;lt;/span&amp;gt;
            &amp;lt;button
              type="button"
              onClick={() =&amp;gt; handleRemove(variant.variantName)}
              className="ml-2 text-lg"
            &amp;gt;
              &amp;amp;times;
            &amp;lt;/button&amp;gt;
          &amp;lt;/div&amp;gt;
        ))}
        &amp;lt;input
          type="text"
          value={colorInput}
          onChange={(e) =&amp;gt; setColorInput(e.target.value)}
          onKeyDown={handleKeyDown}
          placeholder={placeholder}
          className="outline-none border-none w-full min-w-[150px]"
        /&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};

export default CustomInputColorPickUp;

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

&lt;/div&gt;



&lt;p&gt;☑️&lt;strong&gt;Use Case:&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;"use client";
import React, { useState } from "react";
import CustomInputColorPickUp from "@/components/CustomInputColorPickUp";

const ProductColorInputSection = () =&amp;gt; {
  const [colorVariants, setColorVariants] = useState([
    { variantName: "red" },
    { variantName: "blue" },
  ]);

  return (
    &amp;lt;div className="max-w-md mx-auto mt-10"&amp;gt;
      &amp;lt;CustomInputColorPickUp
        label="Product Colors"
        variants={colorVariants}
        setVariants={setColorVariants}
        placeholder="Type a color and press Enter"
      /&amp;gt;

      &amp;lt;pre className="mt-5 bg-gray-100 p-3 rounded text-sm"&amp;gt;
        {JSON.stringify(colorVariants, null, 2)}
      &amp;lt;/pre&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};

export default ProductColorInputSection;

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

&lt;/div&gt;



&lt;p&gt;🧾 &lt;strong&gt;Conclusion (Note)&lt;/strong&gt;&lt;br&gt;
This reusable input component in React TypeScript is tailored for &lt;strong&gt;my specific use case&lt;/strong&gt; — managing and displaying color variants dynamically. However, it’s fully customizable. Whether you want to use it for color tags, general tag inputs, or even more complex data entries, feel free to tweak the logic, styling, or structure based on your needs.&lt;/p&gt;

&lt;p&gt;The goal is to give you a solid foundation for building flexible and reusable input components in modern React projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Happy coding!&lt;/strong&gt; 💻✨&lt;/p&gt;

</description>
      <category>programming</category>
      <category>react</category>
      <category>tailwindcss</category>
      <category>ui</category>
    </item>
    <item>
      <title>Build a Reusable, Flexible Modal Component in React with Portal Support</title>
      <dc:creator>JAKER HOSSAIN</dc:creator>
      <pubDate>Mon, 14 Apr 2025 12:29:08 +0000</pubDate>
      <link>https://dev.to/jackfd120/build-a-reusable-flexible-modal-component-in-react-with-portal-support-4hha</link>
      <guid>https://dev.to/jackfd120/build-a-reusable-flexible-modal-component-in-react-with-portal-support-4hha</guid>
      <description>&lt;p&gt;Would you be interested in setting up your modals in a React + Next.js project?&lt;/p&gt;

&lt;p&gt;In this post, I’ll walk you through a fully-featured and reusable Modal component that:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;1- Supports multiple entry/exit animation alignments,&lt;br&gt;
2- Handles back navigation when closed,&lt;br&gt;
3- Works across small and large devices selectively,&lt;br&gt;
4- Uses React Portals to render outside the component tree, and&lt;br&gt;
5- Is styled using Tailwind CSS for rapid development.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;No more rewriting modals from scratch every time! Let’s build one you can plug into any project. 👇&lt;/p&gt;

&lt;p&gt;✅ Why Use This Modal Component?&lt;br&gt;
This component is modular, responsive, animated, and portable — making it ideal for use in real-world web apps and dashboards.&lt;/p&gt;

&lt;p&gt;Use cases:&lt;br&gt;
1- Displaying forms, filters, or dynamic content without page reloads.&lt;br&gt;
2- Creating full-screen mobile modals.&lt;br&gt;
3- Conditionally showing modals on different screen sizes.&lt;br&gt;
4- Enhancing UX with entry/exit animations.&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, { useState, useEffect, Dispatch, SetStateAction } from "react";
import { createPortal } from "react-dom";
import { useRouter } from "next/navigation";

const Modal = ({
  show,
  setShow,
  children,
  alignment,
  className,
  isIntercepting = false,
  showCancelBtnINSmallDevice = false,
  isOnlySmallDevice = false,
  isOnlyLargeDevice = false,
}: {
  show: boolean;
  setShow: Dispatch&amp;lt;SetStateAction&amp;lt;boolean&amp;gt;&amp;gt;;
  children: React.ReactNode;
  alignment: "left" | "center" | "right" | "top" | "bottom";
  className?: string;
  isIntercepting?: boolean;
  showCancelBtnINSmallDevice?: boolean;
  isOnlySmallDevice?: boolean;
  isOnlyLargeDevice?: boolean;
}) =&amp;gt; {
  const [animate, setAnimate] = useState(false);
  const redirect = useRouter();

  let appearAnimation;
  let disappearAnimation;

  if (alignment === "left") {
    appearAnimation = "translate-x-0";
    disappearAnimation = "-translate-x-1/2";
  } else if (alignment === "center") {
    appearAnimation = "scale-1";
    disappearAnimation = "scale-0";
  } else if (alignment === "right") {
    appearAnimation = "translate-x-0";
    disappearAnimation = "translate-x-1/2";
  } else if (alignment === "top") {
    appearAnimation = "translate-y-[-227px]";
    disappearAnimation = "-translate-y-[100%]";
  } else if (alignment === "bottom") {
    appearAnimation = "translate-y-[227px]";
    disappearAnimation = "translate-y-[100%]";
  }

  useEffect(() =&amp;gt; {
    if (show) {
      setAnimate(true);
    } else {
      setAnimate(false);
    }
  }, [show]);

  const handleClose = (e: React.MouseEvent) =&amp;gt; {
    e.stopPropagation();
    setAnimate(false);
    if (isIntercepting) {
      redirect.back();
    }
    setTimeout(() =&amp;gt; setShow(false), 300);
  };

  return createPortal(
    &amp;lt;div
      className={`fixed inset-0 z-50 backdrop-blur-sm bg-black-transparent transition-opacity duration-300 ease-in-out flex items-center 
      ${animate ? "opacity-100" : "opacity-0"}
      ${alignment === "right" &amp;amp;&amp;amp; "justify-end"} 
      ${alignment === "center" &amp;amp;&amp;amp; "justify-center"} 
      ${isOnlySmallDevice &amp;amp;&amp;amp; "md:hidden"} 
      ${isOnlyLargeDevice &amp;amp;&amp;amp; "hidden md:flex"}`}
      onClick={handleClose}
    &amp;gt;
      &amp;lt;div
        className={` relative shadow-black-50 drop-shadow-2xl bg-white lg:p-5 duration-300 ease-in-out
         ${alignment !== "center" &amp;amp;&amp;amp; "h-full md:h-[calc(100%-16px)] md:m-2"}
           ${animate ? appearAnimation : disappearAnimation} ${className}`}
        onClick={(e) =&amp;gt; e.stopPropagation()}
      &amp;gt;
        {/* close handler */}
        &amp;lt;button
          className={`hover:rotate-90 transition-all duration-200 absolute top-5 right-5 lg:top-6 lg:right-6 text-black hover:text-[#ff4b4b] font-bold z-50 ${
            showCancelBtnINSmallDevice ? "block" : "hidden"
          }`}
          onClick={handleClose}
        &amp;gt;
          &amp;amp;#10005;
        &amp;lt;/button&amp;gt;
        {/* children */}
        {children}
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;,
    document.body
  );
};

export default Modal;

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

&lt;/div&gt;



&lt;p&gt;🎯 &lt;strong&gt;Key Features&lt;/strong&gt;:&lt;br&gt;
✅ Fully reusable with props for control&lt;br&gt;
✅ Device-based rendering (show only on mobile or desktop)&lt;br&gt;
✅ Multiple alignment-based animations (left, center, right, top, bottom)&lt;br&gt;
✅ Portal rendering with createPortal for proper stacking&lt;br&gt;
✅ Interceptable close behavior (router.back() support)&lt;br&gt;
✅ Tailwind CSS-based transitions &amp;amp; styling&lt;br&gt;
✅ Clean separation of logic and UI control&lt;/p&gt;

&lt;p&gt;💡 How It Works (in short):&lt;br&gt;
1- show: Boolean toggle for modal visibility.&lt;br&gt;
2- alignment: Determines the animation direction (like slide in from left, right, or scale in center).&lt;br&gt;
3- isIntercepting: Useful for routing scenarios — goes back in history on close.&lt;br&gt;
4- isOnlySmallDevice, isOnlyLargeDevice: Control modal visibility by device size.&lt;br&gt;
5- createPortal: Ensures the modal is placed outside the component tree (document.body).&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Pros&lt;/strong&gt;:&lt;br&gt;
🎨 Highly customizable&lt;br&gt;
📱 Responsive: Tailored for mobile and desktop experiences&lt;br&gt;
🚀 Lightweight and performant&lt;br&gt;
🧩 Easy to integrate in any layout&lt;br&gt;
🔁 Reusable across routes and pages&lt;br&gt;
🧠 Intuitive API for developers&lt;/p&gt;

&lt;p&gt;🧪 &lt;strong&gt;Example Usage&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;const [showModal, setShowModal] = useState(false);

&amp;lt;Modal
  show={showModal}
  setShow={setShowModal}
  alignment="right"
  isIntercepting={true}
  showCancelBtnINSmallDevice={true}
&amp;gt;
  &amp;lt;div&amp;gt;Your modal content here...&amp;lt;/div&amp;gt;
&amp;lt;/Modal&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;🔚 Final Thoughts&lt;br&gt;
Modals are everywhere — from e-commerce to admin dashboards. But building them to be smooth, responsive, and reusable is often overlooked.&lt;/p&gt;

&lt;p&gt;This Modal component gives you that flexibility out of the box, plus portal rendering and optional router integration. Add it to your component library and speed up your future builds.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>react</category>
      <category>frontend</category>
      <category>devchallenge</category>
    </item>
    <item>
      <title>Create Reusable Toaster Notifications in React with Custom Animations</title>
      <dc:creator>JAKER HOSSAIN</dc:creator>
      <pubDate>Sun, 02 Mar 2025 09:05:18 +0000</pubDate>
      <link>https://dev.to/jackfd120/create-reusable-toaster-notifications-in-react-with-custom-animations-5317</link>
      <guid>https://dev.to/jackfd120/create-reusable-toaster-notifications-in-react-with-custom-animations-5317</guid>
      <description>&lt;p&gt;Learn how to build a reusable toaster component in React that supports different notification types like success, error, and warning. It includes features like smooth fade-out animations, progress bars, and customizable positions. This is a quick and effective way to improve user experience in your web applications by providing non-intrusive notifications.&lt;/p&gt;

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

&lt;p&gt;🎉 Customizable Notification Types: Choose from success, error, warning, and info.&lt;br&gt;
🚀 Smooth Animations: Includes slide-in and fade-out animations.&lt;br&gt;
📍 Position Control: Place the notification at any corner of the screen.&lt;br&gt;
⏳ Progress Bar: Visualize the time remaining before the notification disappears.&lt;br&gt;
⏲️ Adjustable Duration: Set how long the notification stays visible.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"use client";
import { IconX } from "@tabler/icons-react";
import React, { useEffect, useState } from "react";
import styles from "./Toaster.module.css";

const Toaster = ({
  message,
  duration = 3,
  onClose,
  type = "success",
  position = "top-right",
  toasterStyle,
  progressBarStyle,
}: {
  message: string;
  duration?: number;
  onClose?: () =&amp;gt; void;
  type?: "success" | "error" | "warning" | "info";
  position?: "top-right" | "top-left" | "bottom-right" | "bottom-left";
  toasterStyle?: string;
  progressBarStyle?: string;
}) =&amp;gt; {
  const [isVisible, setIsVisible] = useState(false);
  const [isFading, setIsFading] = useState(false);

  useEffect(() =&amp;gt; {
    setIsVisible(true);

    const fadeTimer = setTimeout(() =&amp;gt; {
      setIsFading(true);
    }, (duration - 0.5) * 1000);

    const closeTimer = setTimeout(() =&amp;gt; {
      setIsVisible(false);
      if (onClose) onClose();
    }, duration * 1000);

    return () =&amp;gt; {
      clearTimeout(fadeTimer);
      clearTimeout(closeTimer);
    };
  }, [duration, onClose]);

  const handleClose = () =&amp;gt; {
    setIsFading(true);
    setTimeout(() =&amp;gt; {
      setIsVisible(false);
      if (onClose) onClose();
    }, 500);
  };

  if (!isVisible) return null;

  return (
    &amp;lt;div
      className={`${styles.toaster} ${styles[type]} ${styles[position]} ${
        isFading ? styles["fade-out"] : ""
      } fixed rounded-md px-3 py-2 flex items-center justify-between gap-x-2  ${toasterStyle}`}
    &amp;gt;
      &amp;lt;span className="text-xs md:text-sm"&amp;gt;{message}&amp;lt;/span&amp;gt;
      &amp;lt;span
        onClick={handleClose}
        className="cursor-pointer transition-opacity ease-in hover:opacity-70"
      &amp;gt;
        &amp;lt;IconX className="w-4 h-4" /&amp;gt;
      &amp;lt;/span&amp;gt;
      &amp;lt;div
        className={`${styles["progress-bar"]} ${progressBarStyle}`}
        style={{ animationDuration: `${duration - 0.5}s` }}
      &amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};

export default Toaster;

&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;.toaster {
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transform: translateX(150%);
  animation: slideIn 0.5s ease-out forwards;
  position: fixed;
  min-width: 250px;
  max-width: 400px;
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fade-out {
  animation: fadeOut 0.5s ease-in forwards;
}

.top-right {
  top: 10px;
  right: 10px;
}
.top-left {
  top: 10px;
  left: 10px;
}
.bottom-right {
  bottom: 10px;
  right: 10px;
}
.bottom-left {
  bottom: 10px;
  left: 10px;
}

.success {
  background-color: #22c55e;
  color: white;
}
.error {
  background-color: #ef4444;
  color: white;
}
.warning {
  background-color: #f59e0b;
  color: white;
}
.info {
  background-color: #3b82f6;
  color: white;
}

.progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background-color: white;
  animation: progress linear forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(150%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes progress {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

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

&lt;/div&gt;



&lt;p&gt;Toaster notifications are a great way to keep users informed without interrupting their experience. By building a customizable toaster system in React, you can easily adapt it to fit your app's design and user needs. With features like smooth animations, customizable positions, progress bars, and adjustable durations, this simple component can significantly enhance your web application's user experience. Try implementing it in your next project for non-intrusive, yet effective notifications.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>javascript</category>
      <category>typescript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>JavaScript Date Utility: Convert, Format &amp; Display Dates</title>
      <dc:creator>JAKER HOSSAIN</dc:creator>
      <pubDate>Thu, 13 Feb 2025 10:44:44 +0000</pubDate>
      <link>https://dev.to/jackfd120/javascript-date-utility-convert-format-display-dates-5go9</link>
      <guid>https://dev.to/jackfd120/javascript-date-utility-convert-format-display-dates-5go9</guid>
      <description>&lt;p&gt;The &lt;strong&gt;getFormattedDate&lt;/strong&gt; utility function simplifies date formatting in JavaScript and TypeScript applications. It ensures reliable date conversion while offering multiple format options, including &lt;strong&gt;&lt;em&gt;dd/MM/yyyy, MM/dd/yyyy, yyyy/MM/dd, and yyyy/dd/MM.&lt;/em&gt;&lt;/strong&gt; Additionally, it supports a full date style that displays the month name for improved readability (e.g., "15 October 2024").&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { allMonths } from "@/constants/months.constants";

export const getFormattedDate = (
  date: string | Date,
  format?: "dd/MM/yyyy" | "MM/dd/yyyy" | "yyyy/MM/dd" | "yyyy/dd/MM",
  fullDate: boolean = false
): string =&amp;gt; {
  // &amp;lt;= Ensure the input is a Date object =&amp;gt;
  const dateObj = typeof date === "string" ? new Date(date) : date;

  if (isNaN(dateObj.getTime())) {
    throw new Error("Invalid date");
  }

  const day = dateObj.getDate().toString().padStart(2, "0");
  const month = (dateObj.getMonth() + 1).toString().padStart(2, "0");
  const year = dateObj.getFullYear();

  // &amp;lt;= handle full date style =&amp;gt;
  if (fullDate) {
    return `${day} ${allMonths[dateObj.getMonth()]} ${year}`;
  }

  // &amp;lt;= Handle custom format =&amp;gt;
  switch (format) {
    case "dd/MM/yyyy":
      return `${day}/${month}/${year}`;
    case "MM/dd/yyyy":
      return `${month}/${day}/${year}`;
    case "yyyy/MM/dd":
      return `${year}/${month}/${day}`;
    case "yyyy/dd/MM":
      return `${year}/${day}/${month}`;
    default:
      throw new Error("Unsupported format");
  }
};

&amp;lt;== Use case ==&amp;gt;
const exampleDate = "2024-02-10T12:30:00Z"
getFormattedDate(exampleDate, "dd/MM/yyyy")

# To get full date, you can use fullDate true.

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

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;Key Features:&lt;br&gt;
*&lt;/em&gt;✅ Flexible Formatting Options – Supports various date formats to match different regional preferences.&lt;br&gt;
✅ Enhanced Readability – The fullDate option provides a user-friendly date format with the month's full name.&lt;br&gt;
✅ Reliable Date Conversion – Ensures that string inputs are properly converted into valid Date objects.&lt;br&gt;
✅ Error Handling – Prevents issues with invalid dates by throwing an explicit error message.&lt;br&gt;
✅ SEO &amp;amp; UX Improvement – Well-formatted dates enhance user experience and improve content readability, which is crucial for SEO.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Perfect for use in e-commerce platforms, booking systems, blogs, and dashboards, this utility optimizes date display while keeping code clean and efficient.&lt;/em&gt; 🚀&lt;/p&gt;

&lt;p&gt;All credit goes to &lt;strong&gt;SHARIFUL ISLAM&lt;/strong&gt; and thanks for making it, it's amazing and enhances code readability. &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>development</category>
      <category>programming</category>
    </item>
    <item>
      <title>Next.js Path Extractor: Custom Hook for URL Paths &amp; Query Parameters</title>
      <dc:creator>JAKER HOSSAIN</dc:creator>
      <pubDate>Wed, 05 Feb 2025 04:36:08 +0000</pubDate>
      <link>https://dev.to/jackfd120/nextjs-path-extractor-custom-hook-for-url-paths-query-parameters-3ic3</link>
      <guid>https://dev.to/jackfd120/nextjs-path-extractor-custom-hook-for-url-paths-query-parameters-3ic3</guid>
      <description>&lt;p&gt;Introducing &lt;strong&gt;usePathExtractor&lt;/strong&gt; – a custom React hook for Next.js that simplifies extracting and managing URL paths, query parameters, and active route states. It helps developers efficiently work with dynamic routing, making navigation handling more intuitive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"use client";

import { usePathname, useSearchParams } from "next/navigation";
import { useMemo } from "react";

export const usePathExtractor = () =&amp;gt; {
  const pathname = usePathname();
  const searchParams = useSearchParams();

  const queryParams = useMemo(() =&amp;gt; {
    const params: Record&amp;lt;string, string | string[]&amp;gt; = {};
    searchParams.forEach((value, key) =&amp;gt; {
      if (params[key]) {
        params[key] = Array.isArray(params[key])
          ? [...params[key], value]
          : [params[key], value];
      } else {
        params[key] = value;
      }
    });
    return params;
  }, [searchParams]);

  const fullUrl = useMemo(() =&amp;gt; {
    if (typeof window !== "undefined") {
      return window.location.href;
    }
    return "";
  }, []);

  const basePath = useMemo(() =&amp;gt; {
    return pathname.split("/").slice(0, 2).join("/");
  }, [pathname]);

  const isActiveRoute = (route: string) =&amp;gt; {
    return pathname.startsWith(route);
  };

  return {
    pathname,
    fullUrl,
    basePath,
    queryParams,
    isActiveRoute,
  };
};

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

&lt;/div&gt;



&lt;p&gt;Benefits:&lt;br&gt;
✅ Effortless Query Parameter Extraction – Converts search params into an easily accessible object.&lt;br&gt;
✅ Retrieve Full URL – Get the complete URL directly from the hook.&lt;br&gt;
✅ Base Path Management – Extract the main route without extra logic.&lt;br&gt;
✅ Active Route Detection – Easily check if a route is currently active.&lt;/p&gt;

&lt;p&gt;Perfect for building dynamic dashboards, filtering systems, and improving navigation handling in Next.js projects! 🚀&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>programming</category>
      <category>development</category>
      <category>developer</category>
    </item>
    <item>
      <title>Resolving npm Execution Policy Error in PowerShell: A Step-by-Step Guide for Developers</title>
      <dc:creator>JAKER HOSSAIN</dc:creator>
      <pubDate>Thu, 23 Jan 2025 15:10:31 +0000</pubDate>
      <link>https://dev.to/jackfd120/resolving-npm-execution-policy-error-in-powershell-a-step-by-step-guide-for-developers-32ip</link>
      <guid>https://dev.to/jackfd120/resolving-npm-execution-policy-error-in-powershell-a-step-by-step-guide-for-developers-32ip</guid>
      <description>&lt;p&gt;When running npm commands in PowerShell, developers might encounter an error message similar to the following:&lt;/p&gt;

&lt;p&gt;== &lt;strong&gt;PHOTO (Describe issue by photo)&lt;/strong&gt; ==&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqw98e9r4wyd48xe65eyr.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%2Fqw98e9r4wyd48xe65eyr.png" alt=" " width="700" height="185"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;== &lt;strong&gt;TEXT (Describe issue by text)&lt;/strong&gt; ==&lt;br&gt;
npm : File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:1 + npm run dev + ~~~ + CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;br&gt;
To resolve this issue, follow these steps:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Open PowerShell as Administrator:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Press Win + X and select Windows PowerShell (Admin). This ensures you have the necessary permissions to change the execution policy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Check the Current Execution Policy:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the PowerShell window, type the following command and press Enter:&lt;/p&gt;

&lt;p&gt;powershell&lt;br&gt;
&lt;strong&gt;Get-ExecutionPolicy&lt;/strong&gt;&lt;br&gt;
If the result is Restricted, it means script execution is disabled on your system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Set the Execution Policy to RemoteSigned:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To change the execution policy, type the following command and press Enter:&lt;/p&gt;

&lt;p&gt;powershell&lt;br&gt;
&lt;strong&gt;Set-ExecutionPolicy RemoteSigned&lt;/strong&gt;&lt;br&gt;
You might be prompted to confirm the change. Type Y and press Enter to confirm. The RemoteSigned policy allows scripts created on your local computer to run, and scripts downloaded from the internet must be signed by a trusted publisher.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Verify the New Execution Policy:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To ensure the new policy is set correctly, type the following command and press Enter:&lt;/p&gt;

&lt;p&gt;powershell&lt;br&gt;
&lt;strong&gt;Get-ExecutionPolicy&lt;/strong&gt;&lt;br&gt;
The result should now be &lt;strong&gt;RemoteSigned&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Run Your npm Command Again:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With the execution policy set to RemoteSigned, you can now run your npm command without encountering the execution policy error:&lt;/p&gt;

&lt;p&gt;powershell&lt;br&gt;
npm run dev&lt;/p&gt;

&lt;p&gt;_If you encounter an error about execution policies when running npm commands in PowerShell, it is likely because the script execution is disabled. To fix this, follow these steps:&lt;/p&gt;

&lt;p&gt;Open PowerShell as Administrator.&lt;/p&gt;

&lt;p&gt;Check the Current Execution Policy by typing Get-ExecutionPolicy.&lt;/p&gt;

&lt;p&gt;Set the Execution Policy to RemoteSigned by typing Set-ExecutionPolicy RemoteSigned and confirming the change.&lt;/p&gt;

&lt;p&gt;Verify the New Execution Policy by typing Get-ExecutionPolicy again.&lt;/p&gt;

&lt;p&gt;Run Your npm Command Again without encountering the error._&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>npm</category>
      <category>challenge</category>
      <category>developers</category>
    </item>
  </channel>
</rss>
