<?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: Tuna </title>
    <description>The latest articles on DEV Community by Tuna  (@tuna_dev).</description>
    <link>https://dev.to/tuna_dev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3476586%2Fd0bd7df0-3c00-4929-9e7c-b90a5aa9318a.png</url>
      <title>DEV Community: Tuna </title>
      <link>https://dev.to/tuna_dev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tuna_dev"/>
    <language>en</language>
    <item>
      <title>🤖 React + Next.js Pipelines: Best Practices for Modern Projects</title>
      <dc:creator>Tuna </dc:creator>
      <pubDate>Sun, 07 Sep 2025 18:54:42 +0000</pubDate>
      <link>https://dev.to/tuna_dev/react-nextjs-pipelines-best-practices-for-modern-projects-hb</link>
      <guid>https://dev.to/tuna_dev/react-nextjs-pipelines-best-practices-for-modern-projects-hb</guid>
      <description>&lt;p&gt;Recently, I contributed to &lt;a href="https://github.com/reactjs/react.dev" rel="noopener noreferrer"&gt;react.dev&lt;/a&gt; repo and noticed how their CI/CD pipeline was structured. Clean, automated, and resilient. It made me think: what are the essentials every React/Next.js project should have in its pipeline?&lt;/p&gt;

&lt;p&gt;Let’s explore the &lt;strong&gt;best practices&lt;/strong&gt; 🚀.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 The problem with "Basic pipelines"
&lt;/h2&gt;

&lt;p&gt;Many teams set up basic commands&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install dependencies&lt;/li&gt;
&lt;li&gt;Build project&lt;/li&gt;
&lt;li&gt;Deploy&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sounds fine right? You are missing many critical points.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bundle size related issues&lt;/li&gt;
&lt;li&gt;Broken builds&lt;/li&gt;
&lt;li&gt;Inconsistent environments&lt;/li&gt;
&lt;li&gt;Slow feedbacks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The list doesn't end here. &lt;/p&gt;

&lt;p&gt;The point is: &lt;strong&gt;a fragile pipeline leads to fragile releases.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🧬 Essential Steps in a Pipeline
&lt;/h2&gt;

&lt;p&gt;A solid React/Next.js pipeline should go beyond just install, lint, test, build.&lt;br&gt;
Here’s an extended GitHub Actions workflow you can adapt to your projects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: CI

on:
  push:
    branches: [ main ]
  pull_request:

jobs:
  build-and-test:
    runs-on: ubuntu-latest
    steps:
      # Checkout the repo
      - uses: actions/checkout@v3

      # Setup Node.js
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: 'npm'

      # Clean install dependencies
      - run: npm ci

      # Lint checks (fail fast)
      - run: npm run lint

      # Type checking with TypeScript
      - run: npm run type-check

      # Unit tests with coverage
      - run: npm run test -- --ci --coverage

      # End-to-End tests (optional: Cypress/Playwright)
      - run: npm run e2e

      # Build the Next.js app
      - run: npm run build

      # Run Next.js static analysis
      - run: npm run analyze

      # Check bundle size (with e.g. size-limit)
      - run: npm run size

      # Lint commit messages (Conventional Commits)
      - run: npx commitlint --from=HEAD~1 --to=HEAD

      # Upload build artifacts (optional)
      - uses: actions/upload-artifact@v4
        with:
          name: next-build
          path: .next
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






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

&lt;ul&gt;
&lt;li&gt;Use npm ci over npm install → reproducible, clean installs.&lt;/li&gt;
&lt;li&gt;Linting as a first step → fail fast on code style issues.&lt;/li&gt;
&lt;li&gt;Unit + integration tests with coverage → reliability guaranteed prior to merging.&lt;/li&gt;
&lt;li&gt;Preview deployments (e.g., Vercel, Netlify) → every PR receives a live environment.&lt;/li&gt;
&lt;li&gt;Cache dependencies between runs → faster pipelines.&lt;/li&gt;
&lt;li&gt;Secrets management → use environment variables safely (no .env leaks!).&lt;/li&gt;
&lt;li&gt;Bundle analysis → track performance are monitored in PRs.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🙋 Bonus Steps Worth Adding
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Type checking (tsc --noEmit) → prevents runtime bugs.&lt;/li&gt;
&lt;li&gt;Playwright / Cypress e2e tests → simulate real user flows.&lt;/li&gt;
&lt;li&gt;Accessibility checks (axe-core, Lighthouse CI) → catch issues early.&lt;/li&gt;
&lt;li&gt;Storybook build → visual regression testing for UI components..&lt;/li&gt;
&lt;/ul&gt;




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

&lt;p&gt;A bad or poor CI/CD is no more tolerated. Is a powerful tool to leverage the development process.&lt;br&gt;
A solid pipeline should be your &lt;strong&gt;safety net&lt;/strong&gt;&lt;br&gt;
Good pipelines include: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fast feedback&lt;/li&gt;
&lt;li&gt;Error prevention&lt;/li&gt;
&lt;li&gt;Consistent environments&lt;/li&gt;
&lt;li&gt;Bundle monitoring 
Of course, pipelines evolve daily, but that's not an excuse to ignore.
👉 The goal isn't perfection, is &lt;strong&gt;continuous improvement&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;👏 Thank you for reading.&lt;br&gt;
This is my first article.&lt;br&gt;
If you found this useful let me know and share it.&lt;br&gt;
See you around!&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>cicd</category>
      <category>react</category>
      <category>devops</category>
    </item>
    <item>
      <title>🤖 WebOTP API: State of art and UX improvements</title>
      <dc:creator>Tuna </dc:creator>
      <pubDate>Wed, 03 Sep 2025 23:34:09 +0000</pubDate>
      <link>https://dev.to/tuna_dev/webotp-api-state-of-art-and-ux-improvements-3m61</link>
      <guid>https://dev.to/tuna_dev/webotp-api-state-of-art-and-ux-improvements-3m61</guid>
      <description>&lt;p&gt;Phone number verification via &lt;strong&gt;OTP via SMS&lt;/strong&gt; is everyday practice these days: we use it for two-factor authentication, for recovering accounts, and for payment verification. But &lt;strong&gt;how secure is it actually?&lt;/strong&gt; And most importantly — how can we &lt;strong&gt;improve user experience without sacrificing security?&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;🎯 The Problem with Traditional OTPs&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Looking back, especially with slower smartphones, OTPs always felt clunky.&lt;br&gt;
You’re browsing a website when the SMS arrives. You switch apps, but your phone lags. You try to copy just the code, but end up selecting the entire message. Frustrated, you decide to type it manually — only to mistype a digit with your thumbs. Meanwhile, the phone keeps freezing and your patience is running out.&lt;/p&gt;

&lt;p&gt;The point is clear: &lt;strong&gt;a slow, error-prone, and frustrating process.&lt;/strong&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  &lt;strong&gt;💿 Support&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;WebOTP API&lt;/strong&gt; remains an &lt;strong&gt;experimental&lt;/strong&gt; extension of the &lt;strong&gt;Credential Management API&lt;/strong&gt;. It’s designed to streamline SMS-based OTP entry by letting browsers auto-fill codes—once the user consents. However, &lt;strong&gt;it's not fully production-ready&lt;/strong&gt; across all browsers.&lt;/p&gt;

&lt;p&gt;If it's not fully supported yet, why is it so popular?&lt;/p&gt;

&lt;p&gt;Despite its limited browser support, the popularity comes down to a few key factors:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The API dramatically &lt;strong&gt;improves the overall UX&lt;/strong&gt; bypassing the user manual entry.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Low implementation effort&lt;/strong&gt; for the developers, just a bunch lines of code are needed&lt;/li&gt;
&lt;li&gt;Google and W3C are pushing for &lt;strong&gt;passwordless and secure&lt;/strong&gt; login methods&lt;/li&gt;
&lt;li&gt;Done is better than perfect&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Cool, but who's supporting this feature at the moment?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chrome&lt;/li&gt;
&lt;li&gt;Opera&lt;/li&gt;
&lt;li&gt;Safari (Partially)&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  &lt;strong&gt;🧬 How to?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Implementing a proper OTP form is quite easy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;form action="/verify-otp" method="POST"&amp;gt;
  &amp;lt;input type="text"
         inputmode="numeric"
         autocomplete="one-time-code"
         pattern="\d{6}"
         required&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's explained every prop:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;type="text"&lt;/code&gt; Avoids leading zero numbers error when using type number&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;inputmode="numeric"&lt;/code&gt; Triggers the numeric keyboard on mobile&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;autocomplete="one-time-code"&lt;/code&gt;On mobile suggests OTP directly from SMS&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pattern="\d{6}"&lt;/code&gt; Ensures only 6 digits code&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;🙋Works with every message?&lt;/strong&gt;
&lt;/h2&gt;

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

&lt;p&gt;The WebOTP API doesn’t work with every SMS message. It only triggers if the OTP message is in the origin-bound format that browsers expect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Your code is 123456  

@yourdomain.com #123456
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The last line must contain your &lt;strong&gt;domain preceded by @&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The OTP &lt;strong&gt;must follow a #&lt;/strong&gt; symbol.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;SMS must be short enough&lt;/strong&gt; (under ~140 characters).&lt;/li&gt;
&lt;li&gt;The page must be served over &lt;strong&gt;HTTPS&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;👋 Conclusion &amp;amp; Future Outlook&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;SMS OTP isn't perfect&lt;/strong&gt;: it's still &lt;strong&gt;vulnerable to phishing&lt;/strong&gt; and &lt;strong&gt;SIM swap attacks&lt;/strong&gt;. For more secure alternatives, the future is in WebAuthn and biometric authentication.&lt;/p&gt;

&lt;p&gt;But in the meantime, WebOTP API lets us do this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reduce manual input errors.&lt;/li&gt;
&lt;li&gt;Dramatically improve UX.&lt;/li&gt;
&lt;li&gt;Improve security with a simple change of formatting.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 The future may not rely on SMS at all — but in the meantime, we can make it intelligent and safer.&lt;/p&gt;

&lt;p&gt;👏 Thank you for reading. &lt;br&gt;
This is my first article.&lt;br&gt;
If you found this useful let me know and share it.&lt;br&gt;
See you around!&lt;/p&gt;

</description>
      <category>webotp</category>
      <category>webdev</category>
      <category>ux</category>
    </item>
  </channel>
</rss>
