<?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: PRATYAY MUSTAFI</title>
    <description>The latest articles on DEV Community by PRATYAY MUSTAFI (@pratyay360).</description>
    <link>https://dev.to/pratyay360</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4125176%2Fc7c8f512-4591-4f50-b48e-a5a43104fe46.jpg</url>
      <title>DEV Community: PRATYAY MUSTAFI</title>
      <link>https://dev.to/pratyay360</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pratyay360"/>
    <language>en</language>
    <item>
      <title>Ensor, censorship for your codebase</title>
      <dc:creator>PRATYAY MUSTAFI</dc:creator>
      <pubDate>Tue, 15 Sep 2026 20:32:46 +0000</pubDate>
      <link>https://dev.to/pratyay360/ensor-censorship-for-your-codebase-36ip</link>
      <guid>https://dev.to/pratyay360/ensor-censorship-for-your-codebase-36ip</guid>
      <description>&lt;h1&gt;
  
  
  Ensor: Censorship for Your Codebase
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;Detect it. Redact it. Keep the code readable.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Hardcoded secrets are one of those problems that looks simple until you're dealing with a real codebase.&lt;/p&gt;

&lt;p&gt;API keys end up in HTTP collections. Tokens get copied into YAML files. Credentials sneak into examples, configuration files, test fixtures, or snippets that eventually find their way into Git.&lt;/p&gt;

&lt;p&gt;Secret scanners are excellent at telling us &lt;strong&gt;that a secret exists&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Secret managers are excellent at telling us &lt;strong&gt;where secrets should live&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;But there is an awkward step in between:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What do you actually do with the secret that is already sitting inside your code?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's the problem I built &lt;strong&gt;Ensor&lt;/strong&gt; to solve.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Ensor?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/Pratyay360/ensor" rel="noopener noreferrer"&gt;Ensor&lt;/a&gt; is a fast, interactive CLI for &lt;strong&gt;detecting and redacting secrets from your codebase&lt;/strong&gt;, while also providing tools for managing environment-variable formats.&lt;/p&gt;

&lt;p&gt;It is designed around a simple workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Codebase
   ↓
Scan for secrets
   ↓
Identify the value
   ↓
Map it to a variable
   ↓
Replace the hardcoded secret
   ↓
Keep the code readable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By default, Ensor extracts discovered secrets into an environment file and replaces the values in your project with configurable placeholders.&lt;/p&gt;

&lt;p&gt;So instead of this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;Authorization&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Bearer sk_live_xxxxxxxxxxxxxxxxx&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you can end up with something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;Authorization&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Bearer ${STRIPE_SECRET_KEY}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important part is that the surrounding file remains readable.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Missing Step in Secret Management
&lt;/h2&gt;

&lt;p&gt;There are already excellent tools for different parts of the secret-management lifecycle.&lt;/p&gt;

&lt;p&gt;Tools such as &lt;a href="https://github.com/gitleaks/gitleaks" rel="noopener noreferrer"&gt;Gitleaks&lt;/a&gt;, &lt;a href="https://github.com/trufflesecurity/trufflehog" rel="noopener noreferrer"&gt;TruffleHog&lt;/a&gt;, and &lt;a href="https://github.com/betterleaks/betterleaks" rel="noopener noreferrer"&gt;betterleaks&lt;/a&gt; can help &lt;strong&gt;detect&lt;/strong&gt; secrets.&lt;/p&gt;

&lt;p&gt;Then there are tools and systems for actually &lt;strong&gt;managing&lt;/strong&gt; secrets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SOPS&lt;/li&gt;
&lt;li&gt;Vault / OpenBao&lt;/li&gt;
&lt;li&gt;Infisical&lt;/li&gt;
&lt;li&gt;Bitwarden Secrets Manager&lt;/li&gt;
&lt;li&gt;cloud secret managers&lt;/li&gt;
&lt;li&gt;GitOps-oriented secret workflows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These solve different problems.&lt;/p&gt;

&lt;p&gt;But detection often leaves you with a very manual task:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Okay, we found the secret. Now go through the project and replace it everywhere."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's the part Ensor focuses on.&lt;/p&gt;

&lt;p&gt;It sits between &lt;strong&gt;secret detection&lt;/strong&gt; and &lt;strong&gt;secret management&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Problem That Started It
&lt;/h1&gt;

&lt;p&gt;I wanted to keep my API requests and development configuration in Git.&lt;/p&gt;

&lt;p&gt;For example, Bruno stores requests as &lt;code&gt;.bru&lt;/code&gt; files, while many other API clients and development tools use YAML, JSON, TOML, or similar formats.&lt;/p&gt;

&lt;p&gt;I wanted those files to remain useful when I wasn't sitting at my main machine.&lt;/p&gt;

&lt;p&gt;That created an annoying choice.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 1: Encrypt everything
&lt;/h3&gt;

&lt;p&gt;Using something like SOPS is great when you need encrypted files.&lt;/p&gt;

&lt;p&gt;But encryption also means the file is no longer immediately readable.&lt;/p&gt;

&lt;p&gt;Instead of opening a request and seeing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;GET&lt;/span&gt;
&lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://api.example.com/users&lt;/span&gt;
&lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;Authorization&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Bearer ...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you might first have to decrypt it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 2: Manually remove the secrets
&lt;/h3&gt;

&lt;p&gt;This works.&lt;/p&gt;

&lt;p&gt;It is also exactly the kind of repetitive task people eventually forget to do.&lt;/p&gt;

&lt;p&gt;And secrets don't only live in &lt;code&gt;.env&lt;/code&gt; files.&lt;/p&gt;

&lt;p&gt;They can appear inside:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API request collections&lt;/li&gt;
&lt;li&gt;YAML configuration&lt;/li&gt;
&lt;li&gt;JSON files&lt;/li&gt;
&lt;li&gt;example code&lt;/li&gt;
&lt;li&gt;shell scripts&lt;/li&gt;
&lt;li&gt;test fixtures&lt;/li&gt;
&lt;li&gt;documentation&lt;/li&gt;
&lt;li&gt;generated files&lt;/li&gt;
&lt;li&gt;random configuration files&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is where automation becomes useful.&lt;/p&gt;




&lt;h1&gt;
  
  
  How Ensor Works
&lt;/h1&gt;

&lt;p&gt;Ensor is built around three main capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Scan and redact secrets
&lt;/h2&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ensor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ensor scans the current project for potential secrets and helps redact them.&lt;/p&gt;

&lt;p&gt;The scanner is powered by the &lt;a href="https://github.com/betterleaks/betterleaks" rel="noopener noreferrer"&gt;betterleaks&lt;/a&gt; detection engine.&lt;/p&gt;

&lt;p&gt;Rather than simply reporting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SECRET FOUND
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ensor turns the finding into an actionable workflow.&lt;/p&gt;

&lt;p&gt;You can associate the detected value with a meaningful environment-variable name and replace the hardcoded value in the codebase.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Map existing environment variables
&lt;/h2&gt;

&lt;p&gt;Suppose you already have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;STRIPE_SECRET_KEY=sk_live_xxxxxxxxx
DATABASE_URL=postgres://...
GITHUB_TOKEN=ghp_xxxxxxxxx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ensor can use those values as a source of truth and find where they appear in your project.&lt;/p&gt;

&lt;p&gt;Instead of manually searching for the raw values, Ensor can replace them with their corresponding variable names.&lt;/p&gt;

&lt;p&gt;So this:&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;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ghp_xxxxxxxxx&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;can become:&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;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The exact replacement depends on the file and workflow, but the goal is the same:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;remove the secret while keeping the code useful.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Convert environment files
&lt;/h2&gt;

&lt;p&gt;Ensor is not only a redaction tool.&lt;/p&gt;

&lt;p&gt;It also includes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ensor convert
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;for converting environment configurations between common formats.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.env
 ↓
JSON
 ↓
YAML
 ↓
TOML
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is useful when different tools expect different configuration formats.&lt;/p&gt;

&lt;p&gt;You can keep one set of environment values and translate it when needed rather than manually rewriting the same configuration.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why an Interactive CLI?
&lt;/h1&gt;

&lt;p&gt;I deliberately didn't want Ensor to behave like another silent black-box scanner.&lt;/p&gt;

&lt;p&gt;Secret remediation can be destructive.&lt;/p&gt;

&lt;p&gt;A tool replacing values throughout a project should make it obvious what is happening.&lt;/p&gt;

&lt;p&gt;That's why Ensor uses an interactive terminal interface.&lt;/p&gt;

&lt;p&gt;It is built with &lt;a href="https://github.com/charmbracelet/huh" rel="noopener noreferrer"&gt;Huh&lt;/a&gt;, &lt;a href="https://github.com/charmbracelet/bubbletea" rel="noopener noreferrer"&gt;Bubble Tea&lt;/a&gt;, and &lt;a href="https://github.com/charmbracelet/lipgloss" rel="noopener noreferrer"&gt;Lip Gloss&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The result is a workflow that lives in the terminal but still provides enough interaction to review what the tool is doing.&lt;/p&gt;




&lt;h1&gt;
  
  
  A Practical Workflow
&lt;/h1&gt;

&lt;p&gt;A typical workflow might look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;my-project

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

&lt;/div&gt;



&lt;p&gt;Ensor scans the project and identifies potential secrets.&lt;/p&gt;

&lt;p&gt;You can then map the discovered values to environment-variable names and let Ensor replace them in the relevant files.&lt;/p&gt;

&lt;p&gt;Your Git diff becomes something closer to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;- Authorization: Bearer sk_live_xxxxxxxxx
&lt;/span&gt;&lt;span class="gi"&gt;+ Authorization: Bearer ${STRIPE_SECRET_KEY}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important thing isn't the exact placeholder syntax.&lt;/p&gt;

&lt;p&gt;It's that the &lt;strong&gt;source code remains understandable without embedding the credential itself&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  Install Ensor
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Using mise
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mise use github:pratyay360/ensor@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Using Go
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;go &lt;span class="nb"&gt;install &lt;/span&gt;github.com/Pratyay360/ensor@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Using the install script
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-sSL&lt;/span&gt; https://raw.githubusercontent.com/Pratyay360/ensor/main/install.sh | sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Prebuilt binaries and packages are also available for Linux, macOS, Windows, and FreeBSD in the &lt;a href="https://github.com/Pratyay360/ensor/releases" rel="noopener noreferrer"&gt;GitHub Releases&lt;/a&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  See It in Action
&lt;/h1&gt;

&lt;p&gt;Here's a short video demonstrating the CLI:&lt;/p&gt;

&lt;p&gt;There are also interactive terminal demos:&lt;/p&gt;

&lt;p&gt;And for environment conversion:&lt;/p&gt;




&lt;p&gt;&lt;a href="https://asciinema.org/a/1264776" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fasciinema.org%2Fa%2F1264776.svg" alt="asciicast" width="1608" height="559"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  What Ensor Is — and Isn't
&lt;/h1&gt;

&lt;p&gt;Ensor isn't intended to replace a proper secrets manager.&lt;/p&gt;

&lt;p&gt;It also isn't a substitute for secret rotation after a credential has been exposed.&lt;/p&gt;

&lt;p&gt;If a real credential has already been committed to a repository, the correct response is still to treat that credential as compromised and rotate or revoke it as appropriate.&lt;/p&gt;

&lt;p&gt;Ensor addresses a different part of the workflow:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;How do I remove secrets from the codebase without turning the code itself into an unreadable mess?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's the gap I'm trying to fill.&lt;/p&gt;




&lt;h1&gt;
  
  
  What's Next?
&lt;/h1&gt;

&lt;p&gt;Ensor is still evolving.&lt;/p&gt;

&lt;p&gt;There are plenty of places where secret redaction can become smarter: better mappings, more file formats, improved replacement strategies, stronger integrations, and tighter development workflows.&lt;/p&gt;

&lt;p&gt;The project is open source, so contributions, issues, and ideas are welcome.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/Pratyay360/ensor" rel="noopener noreferrer"&gt;https://github.com/Pratyay360/ensor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;License:&lt;/strong&gt; Apache-2.0&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thought
&lt;/h1&gt;

&lt;p&gt;Secret management is often presented as a binary problem:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;secret or no secret.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In practice, there is a whole workflow around that secret.&lt;/p&gt;

&lt;p&gt;You need to detect it.&lt;/p&gt;

&lt;p&gt;You need to identify what it belongs to.&lt;/p&gt;

&lt;p&gt;You need to remove it from the code.&lt;/p&gt;

&lt;p&gt;And you need to keep the code usable afterwards.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ensor is built for that middle step.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Censorship for your codebase.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>go</category>
      <category>secret</category>
      <category>gitops</category>
    </item>
    <item>
      <title>setting up redirect rules in dns</title>
      <dc:creator>PRATYAY MUSTAFI</dc:creator>
      <pubDate>Tue, 15 Sep 2026 11:35:00 +0000</pubDate>
      <link>https://dev.to/pratyay360/setting-up-redirect-rules-in-dns-2b0j</link>
      <guid>https://dev.to/pratyay360/setting-up-redirect-rules-in-dns-2b0j</guid>
      <description>&lt;h1&gt;
  
  
  How Google and Microsoft Handle Redirects
&lt;/h1&gt;

&lt;h2&gt;
  
  
  So how do Google/Microsoft-like companies handle the redirects we see and use on a daily basis?
&lt;/h2&gt;

&lt;p&gt;The most notable one I can remember was &lt;a href="https://perplexity.in" rel="noopener noreferrer"&gt;Perplexity.in&lt;/a&gt; → redirecting users to Gemini. From a technical standpoint, how do you redirect to a completely separate DNS zone without any control over that zone? + How are TLS certs served in such a way?&lt;/p&gt;

&lt;p&gt;Google’s domain resolves securely; parameters remain intact; browsers show no warnings.&lt;br&gt;&lt;br&gt;
All common HTTP request methods, such as GET, POST, DELETE, and PUT, can function correctly through proper redirection. However, to ensure that methods other than GET (such as POST, PUT, or DELETE) are preserved during a redirect, it is necessary to use HTTP status codes &lt;strong&gt;307 (Temporary Redirect)&lt;/strong&gt; or &lt;strong&gt;308 (Permanent Redirect)&lt;/strong&gt;. These status codes instruct clients to repeat the original request method and body at the new location, thereby maintaining the integrity of the operation.&lt;/p&gt;

&lt;p&gt;So how are they served? How is HTTPS/TLS handled? How do search engines handle these redirects, and how do they know that a domain is valid or an alternate destination for the original domain?&lt;/p&gt;

&lt;p&gt;Don’t we need to tell the server, “Hey, this is your domain,” and store an A, AAAA, or CNAME record for it? How does the server know that this is a valid domain?&lt;/p&gt;

&lt;p&gt;So here comes the role of your DNS provider and the way they handle redirections.&lt;/p&gt;

&lt;p&gt;Setting up redirection via a DNS provider is straightforward: you point your subdomain to a local server range Cloudflare, for example, suggests using 192.0.2.1 paired with their proxy—and then create a rule within the provider’s dashboard to redirect all requests to the target domain.&lt;/p&gt;

&lt;p&gt;When a user visits the subdomain, the request is routed to the local server, which then triggers the redirect to the destination. Note that this must be done using a subdomain because CNAME records cannot be assigned to an apex domain. Consequently, you can only redirect subdomains, such as “www” or any other custom prefix within that zone.&lt;/p&gt;

&lt;p&gt;Types of redirections&lt;/p&gt;

&lt;p&gt;google suggests some codes for redirections like 30* series.&lt;/p&gt;

&lt;p&gt;301 Moved Permanently&lt;/p&gt;

&lt;p&gt;302 Found&lt;/p&gt;

&lt;p&gt;303 See Other&lt;/p&gt;

&lt;p&gt;304 Not Modified&lt;/p&gt;

&lt;p&gt;305 Use Proxy&lt;/p&gt;

&lt;p&gt;306 Unused&lt;/p&gt;

&lt;p&gt;307 Temporary Redirect&lt;/p&gt;

&lt;p&gt;308 Permanent Redirect&lt;/p&gt;

&lt;p&gt;This ensures that search engines understand how to handle the redirection and how to process the old URL.&lt;/p&gt;

&lt;p&gt;The approach is straightforward: configure your DNS records to point to the DNS server itself, then establish a rule with your DNS provider to redirect all requests to the target domain. Consequently, when a user visits your subdomain, the request is handled by the provider’s local server, which then issues a redirect to the target destination.&lt;/p&gt;

&lt;p&gt;Cloudflare suggests utilizing their proxy feature to route requests through their servers, allowing them to handle redirections more effectively. I previously implemented a similar setup using freedns.afraid.org via their “web forward” feature, which successfully redirected traffic but only supported HTTP no HTTPS. In contrast, Cloudflare routes traffic through their extensive proxy network, they can issue TLS certificates and serve content securely over HTTPS.&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>infrastructure</category>
      <category>networking</category>
    </item>
    <item>
      <title>Using chezmoi to manage dotfiles</title>
      <dc:creator>PRATYAY MUSTAFI</dc:creator>
      <pubDate>Thu, 10 Sep 2026 20:45:00 +0000</pubDate>
      <link>https://dev.to/pratyay360/using-chezmoi-to-manage-dotfiles-48p5</link>
      <guid>https://dev.to/pratyay360/using-chezmoi-to-manage-dotfiles-48p5</guid>
      <description>&lt;p&gt;&lt;a href="https://www.chezmoi.io/" rel="noopener noreferrer"&gt;CHEZMOI&lt;/a&gt;  is a nice, modern, secure dotfiles manager with built-in support for handling secrets and provides a nice configurable/hackable ecosystem to tinker with. Chezmoi is a batteries-included dotfiles manager .&lt;/p&gt;

&lt;p&gt;Unlike yadm, chezmoi doesn’t just create a git repo of your user space .  Also, chezmoi supports integration with multiple password managers&lt;/p&gt;

&lt;p&gt;Also, chezmoi is super nice with dotfiles. For example, .bashrc will be named as &lt;code&gt;dot_bashrc&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And if encrypted with chezmoi, it will be stored as &lt;code&gt;encrypted_dot_bashrc.age&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;How to use age with chezmoi?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;chezmoi age-keygen &lt;span class="nt"&gt;-o&lt;/span&gt; key.txt

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

&lt;/div&gt;



&lt;p&gt;chezmoi comes prepackaged with age. you just can run any age related command with just a chezmoi prefix&lt;/p&gt;

&lt;p&gt;age ==&amp;gt; chezmoi age&lt;/p&gt;

&lt;p&gt;and everything stays the same.&lt;/p&gt;

&lt;p&gt;You can use chezmoi with age encryption with ssh, pgp, passphrase for recipient ..&lt;/p&gt;

&lt;p&gt;I don’t recommend using a remote password manager to store secret values cz I have faced delay in shell startup due to slow internet or dns related issues.&lt;/p&gt;

&lt;p&gt;$callout💡 Always remember AGE_ (in caps) is your private key and should be stored safely ..and the one age.. (in small) is your public key and we will be encrypting this to this public key as an recipient $&lt;/p&gt;

&lt;h1&gt;
  
  
  So, I am storing my secrets in plain text in my dot files isn’t that bad and will not chezmoi mess by leaking my secrets.
&lt;/h1&gt;

&lt;h2&gt;
  
  
  answer is yes and no .
&lt;/h2&gt;

&lt;p&gt;1st you need to configure a chezmoi config&lt;/p&gt;

&lt;p&gt;something like this:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="py"&gt;encryption&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"age"&lt;/span&gt;
&lt;span class="nn"&gt;[git]&lt;/span&gt;
&lt;span class="py"&gt;autoCommit&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="py"&gt;autoPush&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="nn"&gt;[delta]&lt;/span&gt;
&lt;span class="py"&gt;by-side&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="py"&gt;numbers&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="nn"&gt;[age]&lt;/span&gt;
&lt;span class="py"&gt;identity&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"/home/&amp;lt;username&amp;gt;/.config/chezmoi/keys.txt"&lt;/span&gt;
&lt;span class="py"&gt;recipient&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"public age key here"&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;If you have added a file as encrypted chezmoi will remember that and always keep that encrypted remotely.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;chezmoi add &lt;span class="nt"&gt;--encrypt&lt;/span&gt; ~/.profile

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

&lt;/div&gt;



&lt;p&gt;will be stored as encrypted_dot_profile.age&lt;/p&gt;

&lt;p&gt;Re-tracking a file after manual edits&lt;/p&gt;

&lt;p&gt;If you edited a file directly (instead of using &lt;code&gt;chezmoi edit&lt;/code&gt;), that’s fine.&lt;/p&gt;

&lt;p&gt;If you want, chezmoi to re track the file from your home directory into the source state, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;chezmoi re-add

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

&lt;/div&gt;



&lt;p&gt;This will re-add the file according to your current config (including encryption rules), so the repo still only stores the encrypted version when applicable.&lt;/p&gt;

</description>
      <category>cli</category>
      <category>devops</category>
      <category>productivity</category>
      <category>tools</category>
    </item>
    <item>
      <title>Doing ci/cd the easy way.</title>
      <dc:creator>PRATYAY MUSTAFI</dc:creator>
      <pubDate>Wed, 02 Sep 2026 19:24:00 +0000</pubDate>
      <link>https://dev.to/pratyay360/doing-cicd-the-easy-way-3b7k</link>
      <guid>https://dev.to/pratyay360/doing-cicd-the-easy-way-3b7k</guid>
      <description>&lt;h1&gt;
  
  
  To Begin with I Would Love to reIntroduce You to My Favourite Cli Tool Mise
&lt;/h1&gt;

&lt;p&gt;Mise is a version manager for dev tools &amp;amp; dependencies, a task runner, an environment variables manager all in one place. Mise ensures that every collaborator is working on the same environment and each every stage is reproducible.&lt;/p&gt;

&lt;p&gt;In an earlier post, I have discussed, managing environment variables with mise . Today I will be discussing mise’s task runner feature.&lt;/p&gt;

&lt;p&gt;For example, if you are using mise, then you can write task recipes to execute a particular job. One mise task can have multiple child subtasks.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[tasks.install]&lt;/span&gt;
&lt;span class="py"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Install JS dependencies"&lt;/span&gt;
&lt;span class="py"&gt;run&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"nub install"&lt;/span&gt;

&lt;span class="nn"&gt;[tasks.build]&lt;/span&gt;
&lt;span class="py"&gt;description&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"build project"&lt;/span&gt;
&lt;span class="py"&gt;run&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"nub run build"&lt;/span&gt;

&lt;span class="nn"&gt;[tasks.start]&lt;/span&gt;
&lt;span class="py"&gt;description&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"start project in production env"&lt;/span&gt;
&lt;span class="py"&gt;run&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"nub run start"&lt;/span&gt;

&lt;span class="nn"&gt;[tasks.upload]&lt;/span&gt;
&lt;span class="py"&gt;run&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"surge ./dist test69.surge.sh"&lt;/span&gt;
&lt;span class="py"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"deploy the built dir on surge"&lt;/span&gt;

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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Btw surge is an awesome tool that deploys your static site for free on their CDN.&lt;/p&gt;

&lt;p&gt;you can check them out: &lt;a href="https://surge.sh/" rel="noopener noreferrer"&gt;https://surge.sh&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can see basic tasks for a simple Node.js application. But you might ask, “How do I use this in CI/CD?”&lt;/p&gt;

&lt;p&gt;The simple answer is:&lt;/p&gt;

&lt;p&gt;With the help of mise as a task runner and with subtasks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[tasks.ci]&lt;/span&gt;
&lt;span class="py"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"production build"&lt;/span&gt;
&lt;span class="py"&gt;run&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="err"&gt;mise&lt;/span&gt; &lt;span class="err"&gt;run&lt;/span&gt; &lt;span class="err"&gt;install&lt;/span&gt;
    &lt;span class="err"&gt;mise&lt;/span&gt; &lt;span class="err"&gt;run&lt;/span&gt; &lt;span class="err"&gt;build&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="nn"&gt;[tasks.deploy]&lt;/span&gt;
&lt;span class="py"&gt;description&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"deploy project"&lt;/span&gt;
&lt;span class="py"&gt;run&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="err"&gt;mise&lt;/span&gt; &lt;span class="err"&gt;run&lt;/span&gt; &lt;span class="err"&gt;ci&lt;/span&gt;
    &lt;span class="err"&gt;mise&lt;/span&gt; &lt;span class="err"&gt;run&lt;/span&gt; &lt;span class="err"&gt;upload&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Whenever someone runs &lt;code&gt;mise run ci&lt;/code&gt;, the output always stays deterministic, which you can test on your own machine. before pushing.&lt;/p&gt;

&lt;h2&gt;
  
  
  And Now a Question Arises: What If?
&lt;/h2&gt;

&lt;p&gt;I’ve Written Something Wrong in Tasks Then Isn’t It the Same as Writing the Entire Pipeline?&lt;/p&gt;

&lt;p&gt;The simple answer is no. Mise never allows you to ship an invalid configuration, plus you can always debug your tasks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mise doctor

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Safety?
&lt;/h3&gt;

&lt;p&gt;Mise always checks and matches check-sums (SLSA) for each package downloaded. It’s generally suggested to not use “latest”, but to pin versions for example, &lt;a href="mailto:node@24.03"&gt;node@24.03&lt;/a&gt; or &lt;a href="mailto:node@24.04"&gt;node@24.04&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And if you want to containerize the app before running it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mise oci run

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

&lt;/div&gt;



&lt;p&gt;This will spin up a container for you containing the application. (This is not suggested for chunk blobs) you can move those build artifacts to some alpine linux or distroless container.&lt;/p&gt;

&lt;p&gt;Want to Spin up a Devcontainer ?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mise gen devcontainer &lt;span class="nt"&gt;--write&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Mise handles most of the things for you.&lt;/p&gt;

&lt;p&gt;It’s up to you and your creativity on, how well you write task recipes. Personally, I prefer writing atomic tasks so each task stays debug able, manageable and reproducible.&lt;/p&gt;

&lt;p&gt;Mise can handle shell scripts as tasks too, and you can use virtually any CLI tool thanks to its nice plugin ecosystem.&lt;/p&gt;

&lt;p&gt;Let’s Stay on Our Main Topic: CI.&lt;/p&gt;

&lt;p&gt;In any CI platform like GitHub Actions, GitLab Pipelines, Bitbucket Pipelines, Forgejo CI, or any custom CI one thing is always common in all, your ability to run containers and running commands inside it.&lt;/p&gt;

&lt;p&gt;Want to write a GitHub Action?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;mise gen github-action —write&lt;/span&gt;


&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ci&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;workflow_dispatch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

&lt;span class="na"&gt;concurrency&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;group&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ github.workflow }}-${{ github.ref }}&lt;/span&gt;
  &lt;span class="na"&gt;cancel-in-progress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

&lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;MISE_EXPERIMENTAL&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;ci&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;timeout-minutes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v6&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;jdx/mise-action@v3&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mise run ci&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;But our goal isn’t to understand yaml for doing CI, but to simplify the process of writing CI pipelines. The goal is to simplify the process:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ci&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;workflow_dispatch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;pull&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;contents&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;read&lt;/span&gt;
  &lt;span class="na"&gt;pages&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;
  &lt;span class="na"&gt;id-token&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;ci&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ghcr.io/jdx/mise:latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;checkout code&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@main&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Install dependencies &amp;amp; building&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
            &lt;span class="s"&gt;mise deps&lt;/span&gt;
            &lt;span class="s"&gt;mise run fetch&lt;/span&gt;
            &lt;span class="s"&gt;mise run build&lt;/span&gt;

        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;SOME_ENV&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.SOME_ENV }}&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Upload artifact&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/upload-pages-artifact@main&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./public&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy to GitHub Pages&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;deployment&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/deploy-pages@main&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;For you, the basic structure of the pipeline stays the same always like some kind of like a boilerplate and the quest of one tab vs 4 spaces somehow becomes irrelevant. You can now focus on writing tasks and let mise handle the rest.&lt;/p&gt;

&lt;p&gt;The fun part is that you can now run the same on any CI platform,&lt;/p&gt;

&lt;p&gt;each will be giving you a predictable result&lt;/p&gt;

&lt;p&gt;See a sample workflow for Forgejo Actions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;CI&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;workflow_dispatch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

&lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;MISE_EXPERIMENTAL&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;check&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Check&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;codeberg-medium-lazy&lt;/span&gt;
    &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ghcr.io/jdx/mise:latest&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Check out source code&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v7.0.0&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;install dependencies&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
            &lt;span class="s"&gt;mise deps&lt;/span&gt;
            &lt;span class="s"&gt;mise run deploy&lt;/span&gt;
        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;SOME_ENV&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.SOME_ENV }}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;And the same for GitLab Actions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ghcr.io/jdx/mise:latest&lt;/span&gt;

&lt;span class="na"&gt;stages&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;build&lt;/span&gt;

&lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;stage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;build&lt;/span&gt;
  &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;mise deps&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;mise run deploy&lt;/span&gt;

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

&lt;/div&gt;



</description>
      <category>automation</category>
      <category>cicd</category>
      <category>cli</category>
      <category>devops</category>
    </item>
    <item>
      <title>Using sops &amp; age to manage environment variables</title>
      <dc:creator>PRATYAY MUSTAFI</dc:creator>
      <pubDate>Mon, 31 Aug 2026 17:35:00 +0000</pubDate>
      <link>https://dev.to/pratyay360/using-sops-age-to-manage-environment-variables-3gg4</link>
      <guid>https://dev.to/pratyay360/using-sops-age-to-manage-environment-variables-3gg4</guid>
      <description>&lt;p&gt;Managing &lt;code&gt;env&lt;/code&gt; variables without a secret management mechanism specially for devs working on 10’s of different things and multiple repos. Once committed into any remote git forge it becomes a hurdle to remember which &lt;code&gt;.env&lt;/code&gt; is of which project even after using password manager just a week later. So here comes the role of secrets management and the better way is to manage secrets in my view / the easiest way to let them live with your code. Thanks to time tested algorithms like AES256 and pgp which are not so easy to crack . Read what nist has to &lt;a href="https://csrc.nist.gov/csrc/media/Events/2024/fifth-pqc-standardization-conference/documents/papers/on-practical-cost-of-grover.pdf" rel="noopener noreferrer"&gt;say about this.&lt;/a&gt; Tbh there is no one using something like pgp/gpg for encryption it’s more or less a paper tiger because of it’s hardness and no one barely knows how to use pgp. And to make pgp work you need the recipient to be able to decrypt the message. I doubt 99% of the people can’t even decrypt their own file after a week. So using pgp is a big no. It’s similar to loosing &lt;code&gt;.env&lt;/code&gt; . There comes age as an encryption, it’s modern, robust easy to use and manageable asymmetric keys also age can even be used with your existing credentials like, ssh, Pgp type keys for encryption.&lt;/p&gt;

&lt;h1&gt;
  
  
  I am assuming that you are using some sort of *nix based operating system if not then at least use WSL(windows subsystem for Linux) to follow along.
&lt;/h1&gt;

&lt;p&gt;Here we will be using a tool like &lt;a href="https://getsops.io" rel="noopener noreferrer"&gt;sops(secret operations)&lt;/a&gt; .Sops is now a CNCF sandbox project and historically it’s been a project of people working at Mozilla, and later donated the project.&lt;/p&gt;

&lt;p&gt;Sops can manage Yaml, Toml, dotenv, env.json.&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%2Fs6.imgcdn.dev%2FY8IpEH.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%2Fs6.imgcdn.dev%2FY8IpEH.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But writing yaml files for config is something no one should be doing.&lt;/p&gt;

&lt;p&gt;Why doing Gitops the hard way, also by not commiting enviornment variables you are not creating a reference so that others can collaborate on the project, SOPs is very selective at encryption it just encrypts the values not the keys.&lt;/p&gt;

&lt;p&gt;So introducing &lt;a href="https://mise.jdx.dev/" rel="noopener noreferrer"&gt;mise&lt;/a&gt; my favourite tool nowadays to manage dev tools, tasks, handling environment variables, Generally it’s not recommended to pin “latest“ but i am doing so :(.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 To generate a mise.toml run &lt;code&gt;mise gen config&lt;/code&gt; and choose tools you need from the Tui (terminal user interface)&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[tools]&lt;/span&gt;
&lt;span class="py"&gt;age&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"latest"&lt;/span&gt;
&lt;span class="py"&gt;sops&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"latest"&lt;/span&gt;

&lt;span class="nn"&gt;[env]&lt;/span&gt;
&lt;span class="py"&gt;SOPS_AGE_RECIPIENTS&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"{your age recipients here}, {yet another recipient}"&lt;/span&gt;
&lt;span class="py"&gt;_&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="py"&gt;file&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"{ path = .env }"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nn"&gt;[tasks]&lt;/span&gt;
&lt;span class="py"&gt;encrypt&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"sops -e -i .env &amp;amp;&amp;amp; mv .env .env.example"&lt;/span&gt;
&lt;span class="py"&gt;decrypt&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"mv .env.example .env &amp;amp;&amp;amp; sops -d -i .env"&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;This is generally my overall workflow regarding secrets. BTW, the public key is shareable as it’s name, public,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;SOPS_AGE_KEYS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"AGE_PRIVATE_KEY_HERE"&lt;/span&gt; 

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

&lt;/div&gt;



&lt;p&gt;or, you can use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;SOPS_AGE_KEY_FILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.sops/age/keys.txt"&lt;/span&gt;
or 
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;SOPS_AGE_KEY_FILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.config/sops/age/keys.txt"&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;keep the contents of keys.txt safe in some password manager only .&lt;/p&gt;

&lt;p&gt;AGE supports YubiKey, ssh-agent as a helpers too.&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%2Fasciinema.org%2Fa%2F1130380.svg" 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%2Fasciinema.org%2Fa%2F1130380.svg" width="665" height="298"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;asciicast&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This is the workflow with sops configuration.&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%2Fasciinema.org%2Fa%2FDByfEGsk6UQPSzmD.svg" 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%2Fasciinema.org%2Fa%2FDByfEGsk6UQPSzmD.svg" width="1608" height="541"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;asciicast&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Using mise makes the process effortless notice the difference for yourself.&lt;/p&gt;

&lt;p&gt;BTW, Congratulations on getting started with GitOps. Happy coding!&lt;/p&gt;

</description>
      <category>devops</category>
      <category>security</category>
      <category>tooling</category>
    </item>
    <item>
      <title>Hello World</title>
      <dc:creator>PRATYAY MUSTAFI</dc:creator>
      <pubDate>Sat, 22 Aug 2026 21:13:00 +0000</pubDate>
      <link>https://dev.to/pratyay360/hello-world-58i6</link>
      <guid>https://dev.to/pratyay360/hello-world-58i6</guid>
      <description>&lt;p&gt;This is my small corner in the internet will be sharing ideas and thoughts maybe no one will be reading this but who cares. If only me and google spider reads this that’s perfectly fine. I will be writing stuff here sharing my views, opinions, and experience i gathered over the years.&lt;/p&gt;

&lt;p&gt;From the very early age computers, electronics and internet excited me a lot.&lt;/p&gt;

&lt;p&gt;Btw I am a Linux user for the past 5 6 years, so I can claim that I have learned a little bit about UNIX and Linux, and I think I am self entitled to share some of my experiences here Btw, now days i boot an atomic/immutable bootc based distro (which is heavily customized by me)&lt;/p&gt;

&lt;p&gt;Most of the stuff I do is just to explore. Not afraid of trying anything new or unknown I am still equally open and curious about learning new things.&lt;/p&gt;

&lt;p&gt;By the way, I had a childhood dream of becoming a lawyer because I tend to defend any side in any debate &lt;del&gt;though that usually stays within my social bubble.&lt;/del&gt; However, with age I have realized that I am too introverted for that profession.&lt;/p&gt;

&lt;p&gt;I have got some hot takes too, but won’t be sharing everything in one post.&lt;/p&gt;

&lt;h1&gt;
  
  
  So, see you later dear anon
&lt;/h1&gt;

</description>
      <category>learning</category>
      <category>linux</category>
    </item>
    <item>
      <title>my Linux journey so far</title>
      <dc:creator>PRATYAY MUSTAFI</dc:creator>
      <pubDate>Mon, 16 Dec 2024 14:55:00 +0000</pubDate>
      <link>https://dev.to/pratyay360/my-linux-journey-so-far-30cf</link>
      <guid>https://dev.to/pratyay360/my-linux-journey-so-far-30cf</guid>
      <description>&lt;h1&gt;
  
  
  Beginning story
&lt;/h1&gt;

&lt;p&gt;It was during covid Lockdown my school was off and I was binge watching some YouTube videos on my windows desktop sitting and suddenly I had encountered with a video about Linux and riced ui stuff I was very much amused about how good looking, minimalistic that was then I decided to switch the os of my desktop and was little bit scared about my ability to use Linux stuff that’s why i have downloaded a Ubuntu Iso as ubuntu comes 1st when searching for something about Linux and I installed virtual box and tried it out by following some youtube tutorials it was good and most of the software I used to use were Pirated Proprietary ones like photoshop, microsoft office etc. Also being good with terminal was important so that if I messed something I am capable of repairing it with some google search and some youtube videos. So I had installed ubuntu wsl on my windows machine and started learning little commands used in the unix world. Tbh, I loved spending time on terminal and Vs code at that time like crazy. I was just coding learning new stuff from youtube and sitting in front of the monitor all day after using Wsl for 1-1.5 months and using Ubuntu on Virtual Box my love for linux just grew surprisingly. My desktop at home used to have less ram so virtual Box experience was not that good for me.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1o24reijvcoky4a97fxn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1o24reijvcoky4a97fxn.png" width="800" height="402"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Windows Subsystem for Linux - Wikipedia&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;(This is a visual representation of Wsl Obv copied from internet not mine as i don’t use windows any more)&lt;/p&gt;

&lt;h1&gt;
  
  
  Installing Linux along side Windows
&lt;/h1&gt;

&lt;p&gt;So, after trying linux for 1-1.5 months on my computer(wsl) and thanks to low ram my experience with Virtualbox was not that good I had decided to install linux along side windows (dual boot). I was noob at that time at doing stuffs, installing a simple operating system was a trouble some job for me I deleted one partition from windows and installed ubuntu in that space it was not installed in the ssd even so I used to manually switch os from the bios. Even being installed on the hdd the ubuntu version was faster compared to the windows 10, I started small tinkering and exploring linux at that time that I was spending like 2/3rd of my time on linux and was booting on windows just to play some games. Once I was fully convinced about my linux skills I installed ubuntu permanently on the ssd part and also formatted my hdd drive from NTFS to ext4. Now I was officially a Linux user.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fje8cy0e9dm946qs0zf2h.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fje8cy0e9dm946qs0zf2h.jpg" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Ubuntu Desktop&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;(Representation of ubuntu desktop)&lt;/p&gt;

&lt;h1&gt;
  
  
  Distro Hopping
&lt;/h1&gt;

&lt;p&gt;After installing linux permanently on my desktop there was no looking back terminal was great, I have found suitable Foss or web based alternatives to whatever I used to do. Installing/ uninstalling apps was easier than ever and after installing linux I started following multiple foss advocates and linux channels on youtube. Ricing desktop changing themes customizing is what i used to do all day . But sadly there isn’t enough option for customization on Gnome. Also I started learning about multiple distros like elementry os, manjaro, endeavour os, fedora etc etc. Some I used to love some don’t and some actually haven’t worked properly with my computer may be due to some driver compatibility or I may have broken them. The Distro I used to love the most as a beginner was PopOS it was similar to Ubuntu and it’s cosmic desktop used to be good by default. After distro hopping multiple times i realised it’s window manager and desktop environment what changes looks not the distro itself. Using PopOs for about 4 5 months I had shifted to Manjaro Kde, it was my 1st time using kde plasma and some arch derivative with kde plasma there is unlimited possibilities of customization and it’s the best desktop environment for normal users like me. Resource consumption was far lesser than gnome also loved the krunner thing which is very similar to the spotlight. I remember showing my desktop to my friends which I have modified watching Linux Experiment youtube channel, it was dope. Thanks to manjaro I got introduced to AUR(Arch user repository) It is a repository which holds shell scripts so that any one can install a app with minimum effort natively without any sandbox like flatpak or snap.&lt;/p&gt;

&lt;h1&gt;
  
  
  Ditching Manjaro
&lt;/h1&gt;

&lt;p&gt;I personally felt some apps broke and my os broke. It was due to manjaro holds arch packages itself for testing purposes it broke apps installed through aur. Then after ditching manjaro I tried Garuda linux kde plasma edition it looked good tailored animations were great but it was resource intensive and my pc was having problems with it. So I ditched Garuda after trying for 2 3 days and installed Endeavour Os, Endeavour Os community on telegram specifically very helpful and they are very active I have communicated them with problems many times and they have solved things for me multiple time. Generally linux community is considered rude etc. After Using Endeavour os my distro hopping journey surprisingly stopped for years I have used it for continuous 2-3 years and I settled down.&lt;/p&gt;

&lt;h1&gt;
  
  
  Exploring Cyber Security
&lt;/h1&gt;

&lt;p&gt;Have watched multiple movies, web series during lock down and I got very much motivated by Robot web series to explore cyber security. I have watched videos of hackersploit on youtube and explored my cyber security journey but most of the videos were based on concepts direct practical videos were not that much available on youtube so I tried udemy and telegram to get some videos on the topic I used my desktop to install Kali Linux and parrot Os on virtual box have also tried wifi password cracking, exploiting some old versions of wordpress etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffa0yze94i8e467hjov98.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffa0yze94i8e467hjov98.jpg" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Kali Linux | Penetration Testing and Ethical Hacking Linux&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;(visual representation of kali linux desktop)&lt;/p&gt;

&lt;h1&gt;
  
  
  Current Os
&lt;/h1&gt;

&lt;p&gt;Have purchased a powerful hp laptop with good processor and I had installed Endeavour os on it. The laptop was working well but after kernel v 5.8 bluetooth audio used to stutter a lot and wifi 5 ghz was not stable on my laptop may be due to some driver related issue so I switched my distro once again to the distro which creator of linux Linux Torvalds himself uses Fedora. After years of using Arch based distros i realized that they were not that stable for using them on the primary machine.&lt;/p&gt;

&lt;p&gt;I personally boot Kde plasma flavour of fedora linux it’s been 6 months and it’s running fine for me rolling release and stable flatpack updated on top of it are good. Now, I don’t distrohop any more I have found my sweet spot.&lt;/p&gt;

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

&lt;p&gt;(Fast Fetch of my personal laptop)&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Freedom&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;One of the biggest reasons I fell in love with Linux is the sense of &lt;strong&gt;freedom&lt;/strong&gt; it offers. Unlike proprietary operating systems like Windows or macOS, Linux doesn’t limit you to a particular way of doing things. You’re free to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Choose from hundreds of distributions that suit your needs, whether it’s a beginner-friendly distro like Ubuntu or a cutting-edge rolling release like Arch Linux.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Customize your system to work the way you want, from changing the desktop environment to tweaking even the smallest settings.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use your computer without worrying about invasive tracking or forced updates.&lt;br&gt;&lt;br&gt;
This freedom extends to how you use your hardware as well. Linux runs smoothly even on older machines, letting you breathe new life into aging systems. For someone like me, who loves tinkering and optimizing, this level of control felt liberating.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;The &lt;strong&gt;customization&lt;/strong&gt; capabilities of Linux are what initially drew me in—and they’re what kept me hooked. With Linux, you’re not stuck with a standard, unchangeable interface. Instead, you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Switch between desktop environments like GNOME, KDE Plasma, or XFCE, depending on your preferences.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“Rice” your desktop to create stunning and minimalistic designs, tailoring everything from the color schemes to the window manager.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Modify the terminal to look and behave exactly how you want, using themes, plugins, and tools like Zsh or Oh My Zsh.&lt;br&gt;&lt;br&gt;
For me, experimenting with different configurations felt like a creative outlet. The ability to design a workspace that was both visually pleasing and incredibly functional was empowering. Unlike closed systems, Linux encouraged me to make my computer an extension of my personality.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Open-Source Philosophy&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;At the heart of Linux is its &lt;strong&gt;open-source philosophy&lt;/strong&gt; , which fundamentally changed the way I view technology. Open-source software isn’t just about using free tools—it’s about being part of a community where collaboration and transparency take precedence.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;With Linux, I realized I wasn’t just a passive consumer; I was part of a larger movement that values sharing knowledge and empowering others.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I could access the source code of the operating system and understand how it worked.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;While I wasn’t skilled enough to contribute back then, knowing that I could learn from it or even modify it if needed was inspiring.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Most of the apps I used were open-source, from LibreOffice to GIMP, which helped me move away from pirated proprietary software. The open-source philosophy also made me appreciate how Linux thrives because of its community. Whether it was asking for help on forums, following FOSS advocates on YouTube, or contributing bug reports, I felt like I was part of something bigger.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  ostree
&lt;/h1&gt;

&lt;p&gt;ostree based distros like kinoite and bazzite are my new preference. have started with Ublue’s aurora and have loved immutable distributions. So installed kinoite on my laptop and have been using it for past 6 7 months. and it feels so complete as a distro and the way it handles updates and rollbacks is just amazing. I have rebased from kinoite base to my own &lt;a href="https://github.com/Pratyay360/blueee-os" rel="noopener noreferrer"&gt;recepie&lt;/a&gt;. Images are available at &lt;a href="https://quay.io/organization/pratyay360" rel="noopener noreferrer"&gt;quay.io&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Switching to Linux taught me more than just technical skills—it gave me a new perspective on &lt;strong&gt;freedom, creativity, and community&lt;/strong&gt;. The ability to customize my system, use free and open-source software, and break away from proprietary restrictions made my journey rewarding. Linux isn’t just an operating system; it’s a way to embrace technology with curiosity and empowerment.&lt;/p&gt;

&lt;h1&gt;
  
  
  Continuation
&lt;/h1&gt;

&lt;p&gt;Using linux is like a journey and the path is full of learning. I will be updating this post as my workflow changes.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>learning</category>
      <category>linux</category>
    </item>
    <item>
      <title>Deploying nextjs app on cloudflare pages</title>
      <dc:creator>PRATYAY MUSTAFI</dc:creator>
      <pubDate>Wed, 14 Feb 2024 14:55:00 +0000</pubDate>
      <link>https://dev.to/pratyay360/deploying-nextjs-app-on-cloudflare-pages-3agp</link>
      <guid>https://dev.to/pratyay360/deploying-nextjs-app-on-cloudflare-pages-3agp</guid>
      <description>&lt;p&gt;Cloudflare pages is the best alternative when it comes to serverless platforms like Vercel or Netlify . Because cloudflare pages is virtually free and unlimited where others are limited for 100Gb bandwidth. Also there is no limitation like no commercial use on free version like Vercel.&lt;/p&gt;

&lt;p&gt;You can compare the pricing of &lt;a href="https://vercel.com/pricing" rel="noopener noreferrer"&gt;vercel&lt;/a&gt;, &lt;a href="https://www.netlify.com/pricing" rel="noopener noreferrer"&gt;netlify&lt;/a&gt;, &lt;a href="https://www.cloudflare.com/en-in/plans/developer-platform/" rel="noopener noreferrer"&gt;cloudflare pages&lt;/a&gt; .&lt;/p&gt;

&lt;p&gt;To be honest though cloudflare pages is free and unlimited but SSR (Server Side Rendering) is not supported by it which is the only visible downside of using cloudflare pages all pages are statically rendered on client machine. Cloudflare pages has unlimited bandwidth and requests for free which is great for some serious apps to casual side projects. It’s better compared to paying $20 for some server side rendering and proprietary Vercel optimization.&lt;/p&gt;

&lt;p&gt;Now let’s see how to use cloudflare pages along with NEXT.JS,&lt;/p&gt;

&lt;h1&gt;
  
  
  Create a &lt;a href="https://nextjs.org/docs" rel="noopener noreferrer"&gt;next&lt;/a&gt; project with
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;npx create-next-app@latest&lt;/code&gt;&lt;/p&gt;

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

&lt;p&gt;upload project to &lt;a href="https://github.com/Pratyay360/test-app" rel="noopener noreferrer"&gt;github&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Open &lt;a href="https://www.cloudflare.com/" rel="noopener noreferrer"&gt;cloudflare homepage&lt;/a&gt; login and in dashboard go to workers and pages&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F88u2x8q2purv191fb94f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F88u2x8q2purv191fb94f.png" width="532" height="1005"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;cloudflare dashoard&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;click on create application&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F73w3aixcqi5zl5m0utj7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F73w3aixcqi5zl5m0utj7.png" width="799" height="268"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;workers and pages&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;click on pages and on connect to git&lt;/p&gt;

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

&lt;p&gt;Link your git repository and begin setup and choose Next.Js in the framework section&lt;/p&gt;

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

&lt;p&gt;leave everything as it is if you are not using environment variables. If you are using environment variables then click on the option and add your environment variables.&lt;/p&gt;

&lt;p&gt;Hit the &lt;code&gt;Save and Deploy&lt;/code&gt; button.&lt;/p&gt;

&lt;p&gt;There will be a error while opening the generated site like&lt;/p&gt;

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

&lt;p&gt;you have to copy the flag &lt;code&gt;nodejs_compat&lt;/code&gt; and go to settings of the deployment and open functions window in it.&lt;/p&gt;

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

&lt;p&gt;In functions window there is a option to add compatibility flags add the copied text in both Production and Preview Options.&lt;/p&gt;

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

&lt;p&gt;Also change the Compatibility date to the nearest one (if not configured automatically)&lt;/p&gt;

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

&lt;p&gt;After Doing everything thoroughly you have to re deploy the app by clicking on retry deployment.&lt;/p&gt;

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

&lt;p&gt;After doing all the steps correctly the Next.Js app will be deployed in Cloudflare Pages &lt;a href="https://test-app-kjx.pages.dev/" rel="noopener noreferrer"&gt;link&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Result
&lt;/h1&gt;

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

&lt;p&gt;Feel free to comment if you are facing any problem.&lt;/p&gt;

&lt;p&gt;Happy coding &lt;code&gt;:)&lt;/code&gt;&lt;/p&gt;

</description>
      <category>deployment</category>
      <category>nextjs</category>
      <category>serverless</category>
    </item>
    <item>
      <title>Using Google Sheets as a Database</title>
      <dc:creator>PRATYAY MUSTAFI</dc:creator>
      <pubDate>Fri, 29 Dec 2023 14:55:00 +0000</pubDate>
      <link>https://dev.to/pratyay360/using-google-sheets-as-a-database-2mm0</link>
      <guid>https://dev.to/pratyay360/using-google-sheets-as-a-database-2mm0</guid>
      <description>&lt;h1&gt;
  
  
  How to Use Google Sheets as a Database: A Complete Guide
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Introduction :-
&lt;/h1&gt;

&lt;p&gt;Now you can use Google Sheets as a basic database to make your project work and prototype your project using google’s inbuilt free api &lt;code&gt;Apps Script&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Google’s spreadsheet can store text, number etc. and you can receive data in json format and use in your project in this blog I am going to show you how to store collected from customized form. One can follow this code with moderate level of coding knowledge in Javascript / React js.&lt;/p&gt;

&lt;h1&gt;
  
  
  1st step to start the project is to create a spreadsheet in Google Sheet
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdcle6iljz0dnun4gqwh1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdcle6iljz0dnun4gqwh1.png" width="799" height="199"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;sheet home page&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Click on the &lt;code&gt;+&lt;/code&gt; icon and rename the spreadsheet name.&lt;/p&gt;

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

&lt;p&gt;here I am naming the sheet as &lt;code&gt;form data&lt;/code&gt;&lt;/p&gt;

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

&lt;p&gt;I am creating 3 columns &lt;code&gt;Name&lt;/code&gt; , &lt;code&gt;Email&lt;/code&gt; and &lt;code&gt;Message&lt;/code&gt;&lt;/p&gt;

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

&lt;p&gt;I have given my sheet name as &lt;code&gt;data&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now to generate a restful api for the given sheet we have to click on Extensions -&amp;gt; Apps Script&lt;/p&gt;

&lt;p&gt;If you are following me step by step then your sheet should be like&lt;/p&gt;

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

&lt;p&gt;After opening &lt;strong&gt;Apps Script&lt;/strong&gt; you should change the code with&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;sheets&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;SpreadsheetApp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;openByUrl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;Enter Spreadsheet url&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;like&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// const sheets = SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/1RJNF_42I9p3MTBPBM8aEVe0ZWLRzccojNNoKxGT7EHw/edit#gid=0");&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sheet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;sheets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getSheetByName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;data&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;doPost&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parameter&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;sheet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendRow&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Message&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;ContentService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createTextOutput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Message Sent!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Now click on deploy&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2tzzsa1g5vtl3zqyauki.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2tzzsa1g5vtl3zqyauki.png" width="799" height="311"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;apps script page&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;New Deployment -&amp;gt; Select Type (Web App) -&amp;gt; Then click Deploy&lt;/p&gt;

&lt;p&gt;Make Sure to change access to anyone.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Don’t forget to copy the web app link We will be using it as the&lt;/strong&gt; &lt;code&gt;api&lt;/code&gt; &lt;strong&gt;Now open your html project and add use the following syntax&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;use client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;hydrateRoot&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-dom/client&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;FormEvent&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;buildCustomRoute&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next/dist/build&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Home&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;isClient&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setIsClient&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Submit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;FormEvent&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;HTMLFormElement&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;formData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FormData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;currentTarget&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;formData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;formData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Email&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;formData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Message&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Please fill all the fields&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="c1"&gt;// Enter your link here&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://script.google.com/macros/s/S2$e@vgjgK5hpeS%6C7PS^LDJ8^6J9nV3nW7%ysPsPADhwYaA!kQMngE*EP%SZD*SbS3^g/exec&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;formData&lt;/span&gt;
                &lt;span class="p"&gt;})&lt;/span&gt;
                &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;formElement&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;form&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;HTMLFormElement&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;formElement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                            &lt;span class="nx"&gt;formElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reset&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
                        &lt;span class="p"&gt;}&lt;/span&gt;
                    &lt;span class="p"&gt;}&lt;/span&gt;
                    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                        &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Something went wrong&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                    &lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="p"&gt;})&lt;/span&gt;
                &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Error:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;setIsClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;

    &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"text-center items-center justify-center p-5 mt-7 top-36 tracking-[20px] text-gray-500 text-2xl lg:text-4xl font-bold"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Message Me&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;section&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"text-gray-300 body-font"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"container px-5 py-24 mx-auto"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"flex flex-wrap -m-10 justify-center whitespace-break-spaces"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* Form Start Here */&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
                        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;isClient&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
                            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"form"&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"flex flex-col space-y-5"&lt;/span&gt; &lt;span class="na"&gt;onSubmit&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;Submit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
                                &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"font-bold text-lg text-white "&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Name&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
                                &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Name"&lt;/span&gt; &lt;span class="na"&gt;placeholder&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Enter Name"&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"border rounded-lg py-3 px-3 mt-2 bg-black border-indigo-600 placeholder-white-500 text-white"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
                                &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"font-bold text-lg text-white"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Email&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
                                &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"email"&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Email"&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"email"&lt;/span&gt; &lt;span class="na"&gt;placeholder&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"example@email.com"&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"border rounded-lg py-3 px-3 mt-2 bg-black border-indigo-600 placeholder-white-500 text-white"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
                                &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"font-bold text-lg text-white "&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Message&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
                                &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Message"&lt;/span&gt; &lt;span class="na"&gt;placeholder&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Enter Your Message"&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"border rounded-lg py-3 px-3 mt-2 bg-black border-indigo-600 placeholder-white-500 text-white"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
                                &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"border border-indigo-600 hover:bg-indigo-600 bg-black text-white rounded-lg py-3 )font-semibold px-2"&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"submit"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Send Message&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
                            &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;
                            &lt;span class="p"&gt;(&lt;/span&gt;
                                &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Form not working properly Please report to pratyaymustafi@outlook.com&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
                            &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
                        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* Form End */&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
                    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;section&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;

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

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Here I am using next.js you can use the same code with react
&lt;/h2&gt;

&lt;p&gt;Here is the output of the code&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg9dmjx9zpg1m65fv96eq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg9dmjx9zpg1m65fv96eq.png" width="800" height="372"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;message me page blank&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here I am sending a dummy message just as an example&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxc5jjjnwkhtefpogr6zx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxc5jjjnwkhtefpogr6zx.png" width="800" height="372"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;message me page filled&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;As you can see the in the form is inserted into the spread sheet.&lt;/p&gt;

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

&lt;h1&gt;
  
  
  Cons of using spreadsheet as database
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Increased Dependency on google’s api&lt;/li&gt;
&lt;li&gt;Less Scalability&lt;/li&gt;
&lt;li&gt;Not so professional as it’s no so safe to store users data in just a spreadsheet.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Pros
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Easy prototyping&lt;/li&gt;
&lt;li&gt;Can be used to make customized survey form&lt;/li&gt;
&lt;li&gt;Cost Effective&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Have used codes of &lt;a href="https://www.youtube.com/watch?v=ZA6j2PhXSUg" rel="noopener noreferrer"&gt;Anatu Tech&lt;/a&gt; partly here.&lt;/p&gt;

&lt;p&gt;Happy coding &lt;code&gt;:)&lt;/code&gt;&lt;/p&gt;

</description>
      <category>database</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
    <item>
      <title>A Beginner's Guide to Using the 'UpiQRCode' Package</title>
      <dc:creator>PRATYAY MUSTAFI</dc:creator>
      <pubDate>Mon, 28 Aug 2023 07:59:53 +0000</pubDate>
      <link>https://dev.to/pratyay360/a-beginners-guide-to-using-the-upiqrcode-package-e5</link>
      <guid>https://dev.to/pratyay360/a-beginners-guide-to-using-the-upiqrcode-package-e5</guid>
      <description>&lt;h2&gt;
  
  
  What is &lt;code&gt;upiqrcode&lt;/code&gt; ?
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;upiqrcode&lt;/code&gt; is a npm package for generating custom NPCI-compliant BASE64 QR codes with UPI intent links by generating UPI QR codes with this package it's possible to scan these QR codes with all standard UPI payment apps.&lt;/p&gt;

&lt;h3&gt;
  
  
  Let's see how to use this package.
&lt;/h3&gt;

&lt;p&gt;To use this &lt;code&gt;upiqrcode&lt;/code&gt; package you have to first install &lt;a href="https://www.npmjs.com/package/upiqrcode" rel="noopener noreferrer"&gt;upiqrcode&lt;/a&gt; package into your Node Js project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i upiqrcode

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

&lt;/div&gt;



&lt;p&gt;then import into the file where you want to generate the NPCI-compliant UPI qrcode which can be scanned by all UPI apps.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;upiqrcode&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;upiqrcode&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;There are two mandatory parameters in the default &lt;code&gt;upiqrcode&lt;/code&gt; method which are &lt;code&gt;payeeVPA&lt;/code&gt; &amp;amp; &lt;code&gt;payeeName&lt;/code&gt;. other fields are not mandatory .&lt;/p&gt;

&lt;p&gt;To check how to use this package properly let's refer to the project &lt;a href="https://github.com/Pratyay360/upi-pay" rel="noopener noreferrer"&gt;upi-pay&lt;/a&gt; which I have built using Next Js and Typescript.&lt;/p&gt;

&lt;p&gt;Let's see how to use the package.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Image&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next/image&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;upiqrcode&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;upiqrcode&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Qr&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;qrCode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setQrCode&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;upiqrcode&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="na"&gt;payeeVPA&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pratyaymustafi@paytm&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;payeeName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Pratyay Mustafi&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="na"&gt;upi&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;qr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;intent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nf"&gt;setQrCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;upi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;qr&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;})&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="na"&gt;err&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;

    &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Image&lt;/span&gt;
                &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;qrCode&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
                &lt;span class="na"&gt;alt&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"QR Code"&lt;/span&gt;
                &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
                &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
                &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;| Fields | Description | Required |&lt;br&gt;
| payeeVPA | VPA address from UPI payment account | Mandatory |&lt;br&gt;
| payeeName | Merchant Name registered in UPI payment account | Mandatory |&lt;br&gt;
| payeeMerchantCode | Merchant Code from UPI payment account | Optional |&lt;br&gt;
| transactionId | Unique transactionid for merchant's reference | Optional |&lt;br&gt;
| transactionRef | Unique transactionid for merchant's reference | Optional |&lt;br&gt;
| transactionNote | A note will appear in the payment app while the transaction | Optional |&lt;br&gt;
| amount | Amount | Optional |&lt;br&gt;
| minimumAmount | The minimum amount that has to be transferred | Optional |&lt;br&gt;
| currency | Currency of amount (default: INR) | Optional |&lt;br&gt;
| transactionRefUrl | URL for the order | Optional |&lt;/p&gt;

&lt;p&gt;You can also use the above methods according to your use cases. It's better to create a JSON file and use its data in the production code for proper code readability.&lt;/p&gt;

&lt;p&gt;This is how you can generate an image with upiqrcode package in short report bugs and play with this package Also don't forget to contribute or suggest any ideas in &lt;a href="https://github.com/Pratyay360/upiqrcode" rel="noopener noreferrer"&gt;Github&lt;/a&gt;, please make sure to 🌟 the GitHub repository &lt;a href="https://github.com/Pratyay360/upiqrcode" rel="noopener noreferrer"&gt;upiqrcode&lt;/a&gt; if you are using this package for your project and like it. This motivates to maintain this package.&lt;/p&gt;

&lt;p&gt;Happy coding :)&lt;/p&gt;




&lt;h1&gt;
  
  
  Want to support my work
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://pratyayupi.pages.dev/" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9r36ikpq2cd50d15irf0.png" width="799" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://paypal.me/pmustafi" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3sy4npls0liwcgnstfhf.png" width="798" height="152"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>useupiqrcode</category>
      <category>upi</category>
      <category>node</category>
      <category>npm</category>
    </item>
    <item>
      <title>How to Build a PWA Using Next.js and Million.js</title>
      <dc:creator>PRATYAY MUSTAFI</dc:creator>
      <pubDate>Thu, 17 Aug 2023 09:46:14 +0000</pubDate>
      <link>https://dev.to/pratyay360/how-to-build-a-pwa-using-nextjs-and-millionjs-cok</link>
      <guid>https://dev.to/pratyay360/how-to-build-a-pwa-using-nextjs-and-millionjs-cok</guid>
      <description>&lt;h3&gt;
  
  
  What is PWA (Progressive Web App)?
&lt;/h3&gt;

&lt;p&gt;A Progressive Web App (PWA) is a type of web application that leverages modern web technologies to provide a user experience similar to native mobile apps. PWAs aim to combine the best of both worlds – the reach and accessibility of the web with the capabilities and performance of native apps.&lt;/p&gt;

&lt;h3&gt;
  
  
  Benefits of pwa:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Faster loading times:&lt;/strong&gt; PWAs are cached on the user's device, so they load much faster than traditional web apps. This is especially beneficial for users with slow internet connections.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Offline access:&lt;/strong&gt; PWAs can be used even when the user is offline. This is because the app's resources are cached on the device.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Push notifications:&lt;/strong&gt; PWAs can send push notifications to users, even when the app is not open. This can be used to notify users of new content, updates, or other important information.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Native app-like experience:&lt;/strong&gt; PWAs can be installed on the user's home screen and launched like a native app. This gives users a more familiar and convenient experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Security and reliability:&lt;/strong&gt; PWAs are subject to the same security and reliability standards as native apps. This makes them a more secure and reliable option for users.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to make my next js app into a pwa?
&lt;/h3&gt;

&lt;p&gt;To make a progressive web app(PWA) with next.js we need to install some packages for this '&lt;a class="mentioned-user" href="https://dev.to/next"&gt;@next&lt;/a&gt;/mdx', '@mdx-js/loader', '@mdx-js/react', next-pwa&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i @next/mdx @mdx-js/loader @mdx-js/react next-pwa

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

&lt;/div&gt;



&lt;p&gt;We also have to create a file &lt;code&gt;manifest.webmanifest&lt;/code&gt; in the public folder and generate a JSON file for this you can easily generate one from &lt;a href="https://www.simicart.com/manifest-generator.html/" rel="noopener noreferrer"&gt;Simicart&lt;/a&gt;. Here is a sample metadata file.&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;"theme_color"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"#000000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"background_color"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"#00000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"display"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"standalone"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"scope"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"start_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"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;"abcdefgh"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"short_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;"abc"&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;"lorem ipsum"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"icons"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"src"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"img-192.webp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"sizes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"192x192"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"image/webp"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"src"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"img-256.webp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"sizes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"256x256"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"image/webp"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"src"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"img-384.webp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"sizes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"384x384"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"image/webp"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"src"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"img-512.webp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"sizes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"512x512"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"image/webp"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

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

&lt;/div&gt;



&lt;p&gt;After generating the JSON you just have to copy-paste the content. After this, you have to point the metadata JSON file at &lt;code&gt;layout.tsx / layout.ts / layout.js&lt;/code&gt; file. And add &lt;code&gt;manifest: '/manifest.webmanifest'&lt;/code&gt; in the &lt;code&gt;Metadata&lt;/code&gt; function. Here is the sample content of &lt;code&gt;layout.tsx&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./globals.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Metadata&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Inter&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next/font/google&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;inter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Inter&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;subsets&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;latin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Metadata&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;abcd&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;lorem ipsum&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;manifest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/manifest.webmanifest&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;RootLayout&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;children&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ReactNode&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;html&lt;/span&gt; &lt;span class="na"&gt;lang&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;inter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;html&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;After doing all of this we have to edit the &lt;code&gt;next.config.mjs&lt;/code&gt; file. If you don't know how to add million.js to your project you can follow my &lt;a href="https://pratyaywrites.hashnode.dev/millionjs" rel="noopener noreferrer"&gt;previous article&lt;/a&gt;. We have to import &lt;a class="mentioned-user" href="https://dev.to/next"&gt;@next&lt;/a&gt;/mdx, next-pwa, next-pwa/cache.js like.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;nextMDX&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@next/mdx&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;withPWA&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next-pwa&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;runtimeCaching&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next-pwa/cache.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;And create a variable &lt;code&gt;isProduction&lt;/code&gt; for marking if the project is in production or not.&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;isProduction&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NODE_ENV&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;production&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Create a variable &lt;code&gt;withMDX&lt;/code&gt; which has &lt;code&gt;remarkPlugins&lt;/code&gt; and &lt;code&gt;rehypePlugins&lt;/code&gt; as options&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;withMDX&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;nextMDX&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;remarkPlugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
    &lt;span class="na"&gt;rehypePlugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Create another variable &lt;code&gt;nextMdxConfig&lt;/code&gt; and export &lt;code&gt;nextConfig&lt;/code&gt; with it.&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;nextMdxConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;withMDX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nf"&gt;withPWA&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;dest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;public&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;disable&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;isProduction&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;runtimeCaching&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;})(&lt;/span&gt;&lt;span class="nx"&gt;nextConfig&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;And Finally, export the &lt;code&gt;nextMdxConfig&lt;/code&gt; with million.js.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;million&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;nextMdxConfig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;millionConfig&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  The final &lt;code&gt;next.config.mjs&lt;/code&gt; will look something like
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;million&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;million/compiler&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;nextMDX&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@next/mdx&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;withPWA&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next-pwa&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;runtimeCaching&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next-pwa/cache.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;isProduction&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NODE_ENV&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;production&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;withMDX&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;nextMDX&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;remarkPlugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
    &lt;span class="na"&gt;rehypePlugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="cm"&gt;/** @type {import('next').NextConfig} */&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;nextConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;reactStrictMode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;images&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;domains&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;raw.githubusercontent.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;github.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;nextMdxConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;withMDX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nf"&gt;withPWA&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;dest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;public&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;disable&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;isProduction&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;runtimeCaching&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;})(&lt;/span&gt;&lt;span class="nx"&gt;nextConfig&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;millionConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;million&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;nextMdxConfig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;millionConfig&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  How to test?
&lt;/h3&gt;

&lt;p&gt;Make sure to host the application somewhere like Vercel/netlify . And open the website and open lighthouse. Analyze the website with lighthouse if it's showing something like this then you have successfully created a Progressive web app.&lt;/p&gt;

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

&lt;p&gt;Remember this feature will only show at production not while in the development stage(localhost). If you are facing any problem feel free to comment down below.&lt;/p&gt;

&lt;p&gt;Wish this article helped you.&lt;/p&gt;

&lt;p&gt;Happy coding :)&lt;/p&gt;




&lt;h1&gt;
  
  
  Want to support my work
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://pratyayupi.pages.dev/" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9r36ikpq2cd50d15irf0.png" width="799" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://paypal.me/pmustafi" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3sy4npls0liwcgnstfhf.png" width="798" height="152"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programmingblogs</category>
      <category>progressivewebapps</category>
      <category>nextjs</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Speed Up Compilation of React.js and Next.js Apps</title>
      <dc:creator>PRATYAY MUSTAFI</dc:creator>
      <pubDate>Mon, 17 Jul 2023 00:00:00 +0000</pubDate>
      <link>https://dev.to/pratyay360/speed-up-compilation-of-reactjs-and-nextjs-apps-3gnm</link>
      <guid>https://dev.to/pratyay360/speed-up-compilation-of-reactjs-and-nextjs-apps-3gnm</guid>
      <description>&lt;h1&gt;
  
  
  &lt;strong&gt;Introduction:&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Million js is a library that can be used to speed up the compilation of React and Next js apps. It does this by using a custom compiler that is optimized for performance. Million js also uses a custom virtual DOM that is more efficient than the default React virtual DOM Million js enhances React / Next js performance up to 70%.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;How to use Million js:&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;To use Million js, you need to install it and then add the &lt;code&gt;block()&lt;/code&gt; function to your React code. The &lt;code&gt;block()&lt;/code&gt; function takes a React component as its input and returns a new component that is optimized for performance.&lt;/p&gt;

&lt;p&gt;Here is an example of how to use Million.js:&lt;/p&gt;

&lt;h1&gt;
  
  
  Normal react snippet
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hello&lt;/span&gt; &lt;span class="nx"&gt;world&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;h1&gt;
  
  
  Same code snippet with Million.js
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;block&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;million/react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;block&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hello&lt;/span&gt; &lt;span class="nx"&gt;world&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;block()&lt;/code&gt; function will optimize the &lt;code&gt;App&lt;/code&gt; component for performance. This will make the compilation of the React app faster.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;How Million.js works:&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Million.js works by using a custom compiler that is optimized for performance. The compiler uses several techniques to speed up the compilation of React code, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using a custom virtual DOM that is more efficient than the default React virtual DOM.&lt;/li&gt;
&lt;li&gt;Optimizing the code for specific browsers and devices.&lt;/li&gt;
&lt;li&gt;Reducing the amount of code that needs to be compiled.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Installing Million.js:&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;You can install Million.js using the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm&lt;/code&gt;&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;install &lt;/span&gt;million

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

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;pnpm&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pnpm &lt;span class="nb"&gt;install &lt;/span&gt;million

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

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;yarn&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn add million

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

&lt;/div&gt;



&lt;h1&gt;
  
  
  &lt;strong&gt;Using Million.js with Next.js:&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;If you are using Next.js, you need to rename your &lt;code&gt;Next.config.js&lt;/code&gt; file to &lt;code&gt;Next.config.mjs&lt;/code&gt; and then add the following code to the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;million&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;million/compiler&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;nextConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;reactStrictMode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;million&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;nextConfig&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;This will make Next js use the Million js compiler and you can easily compile react code up to 70% faster.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://million.dev/" rel="noopener noreferrer"&gt;For more information visit the official Million Js website&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy coding &lt;code&gt;:)&lt;/code&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>nextjs</category>
      <category>performance</category>
      <category>react</category>
    </item>
  </channel>
</rss>
