<?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: Taufiqul Islam</title>
    <description>The latest articles on DEV Community by Taufiqul Islam (@taufiqul7756).</description>
    <link>https://dev.to/taufiqul7756</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%2F997851%2Fc5543cfe-f3d1-438c-b6f5-31832e095a31.png</url>
      <title>DEV Community: Taufiqul Islam</title>
      <link>https://dev.to/taufiqul7756</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/taufiqul7756"/>
    <language>en</language>
    <item>
      <title>This is What AI Development Actually Looks Like in 2026 - Stop Prompting. Start Directing.</title>
      <dc:creator>Taufiqul Islam</dc:creator>
      <pubDate>Mon, 15 Jun 2026 10:45:02 +0000</pubDate>
      <link>https://dev.to/taufiqul7756/this-is-what-ai-development-actually-looks-like-in-2026-stop-prompting-start-directing-3hdn</link>
      <guid>https://dev.to/taufiqul7756/this-is-what-ai-development-actually-looks-like-in-2026-stop-prompting-start-directing-3hdn</guid>
      <description>&lt;p&gt;I want to be honest about something upfront. &lt;br&gt;
Most "I built [anything] with AI" posts are actually "I prompted AI and fixed whatever came out." That is not a workflow. That is improvisation with extra steps.&lt;/p&gt;

&lt;p&gt;This post is about a structured approach - one that works whether you are building a frontend portfolio, a full-stack SaaS, a REST API, or a microservice. The phases are the same. The discipline is the same. The results are the same.&lt;/p&gt;


&lt;h2&gt;
  
  
  Where We Are Right Now
&lt;/h2&gt;

&lt;p&gt;As of 2026, Claude Code has crossed &lt;strong&gt;500,000 active developer users&lt;/strong&gt; worldwide. GitHub Copilot has over &lt;strong&gt;1.8 million paid subscribers&lt;/strong&gt;. A Stack Overflow survey found that &lt;strong&gt;76% of developers&lt;/strong&gt; are now using or planning to use AI tools in their development process.&lt;/p&gt;

&lt;p&gt;But here is the uncomfortable number: &lt;strong&gt;42% of developers&lt;/strong&gt; said AI-generated code introduced bugs they had to spend significant time debugging. Another &lt;strong&gt;38%&lt;/strong&gt; said the code did not match their project's conventions.&lt;/p&gt;

&lt;p&gt;Fast but wrong. That is the current state of AI-assisted development for most teams.&lt;/p&gt;

&lt;p&gt;The problem is not the tools. The problem is the workflow - or the lack of one.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Real Problem - AI Forgets Everything
&lt;/h2&gt;

&lt;p&gt;Open a new chat. Paste an error. Get a fix. Copy it back.&lt;/p&gt;

&lt;p&gt;Open another chat tomorrow. Explain the whole project again. Paste another error. Get another fix.&lt;/p&gt;

&lt;p&gt;Every session starts from zero. The AI has no memory of your folder structure, your naming conventions, your design tokens, your API patterns. You spend half your time giving context instead of building.&lt;/p&gt;

&lt;p&gt;This is the chatbox trap. It feels like using AI. It is actually just a slower Stack Overflow.&lt;/p&gt;


&lt;h2&gt;
  
  
  Before You Write a Single Command - The Design Foundation
&lt;/h2&gt;

&lt;p&gt;This step happens before opening any terminal. It is what makes everything else work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Take screenshots of your design.&lt;/strong&gt; Figma, Adobe XD, Canva, PDF mockup - it does not matter. Export screenshots per feature, per page, per state. Close-up screenshots of specific components. Wide screenshots for layout. Light mode and dark mode both.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Organize them like this:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docs/
└── designs/
    ├── system-design.md     ← all design tokens
    └── ss/
        ├── hero-light.png
        ├── hero-dark.png
        └── dashboard-light.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Write your system-design.md.&lt;/strong&gt; Every color token with its hex value. Every font family, font size, font weight. Every spacing value. Every border radius. Light mode and dark mode separately.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Colors&lt;/span&gt;
--color-bg-page:      #f7f7f2   (light) / #0d0d0d (dark)
--color-text-primary: #111111   (light) / #f0f0f0 (dark)
--color-accent:       #2d6a4f   (light) / #84cc16 (dark)

&lt;span class="gu"&gt;## Typography&lt;/span&gt;
--font-serif: Playfair Display
--font-sans:  Geist Sans
--font-mono:  Geist Mono

&lt;span class="gu"&gt;## Spacing&lt;/span&gt;
--spacing-section: 80px
--spacing-content: 40px
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This file is what the AI reads to understand your visual language. Without it the AI guesses. With it every component uses your exact tokens.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Write CLAUDE.md.&lt;/strong&gt; The project bible. Tech stack, folder structure, naming conventions, every rule the AI should follow. You write this once. The AI reads it every session and never forgets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Write CONTEXT.md.&lt;/strong&gt; The domain language. What are things actually called in your project? What is the difference between a &lt;code&gt;User&lt;/code&gt; and a &lt;code&gt;Consultant&lt;/code&gt;? What does &lt;code&gt;assign&lt;/code&gt; mean versus &lt;code&gt;link&lt;/code&gt;? When terminology is written down the AI uses it consistently across every file it touches.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;With these four things in place - screenshots, system-design.md, CLAUDE.md, CONTEXT.md - the AI has permanent memory of your project. No more explaining from scratch every session.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  The Four-Phase Loop
&lt;/h2&gt;

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

&lt;p&gt;Four hard stops. Nothing moves forward until the current phase is complete. The stops are not bureaucracy - they are the entire point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Phase 1 - Grilling
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Triggered by:&lt;/strong&gt; &lt;code&gt;/grill-with-docs build &amp;lt;feature&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The AI reads all your documentation - system-design.md, CLAUDE.md, CONTEXT.md, the relevant screenshots - then interrogates you about the feature. One question at a time. It waits for your answer before asking the next.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For a frontend feature:&lt;/strong&gt;&lt;br&gt;
What font size is the heading? What happens on hover? What does empty state look like? Which screenshot does this match?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For a backend feature:&lt;/strong&gt;&lt;br&gt;
What does the request body look like? What HTTP status does a validation error return? Is this endpoint authenticated? What happens when the foreign key does not exist?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For a full-stack feature:&lt;/strong&gt;&lt;br&gt;
What is the API contract between frontend and backend? Who owns error handling? What does the frontend show when the request is pending? When it fails?&lt;/p&gt;

&lt;p&gt;Every question answered here is a bug that never gets written in Phase 3. The phase ends when a task spec file is written at &lt;code&gt;docs/tasks/&amp;lt;feature&amp;gt;.md&lt;/code&gt;. Then a hard stop. No code, nothing in &lt;code&gt;src/&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Every question answered in Phase 1 is a bug that never gets written in Phase 3."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  Phase 2 - PRD
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Triggered by:&lt;/strong&gt; &lt;code&gt;/prd&lt;/code&gt; or &lt;code&gt;/to-prd&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The AI synthesizes everything from the grilling session into a Product Requirements Document. Problem statement, user stories, implementation decisions, API contracts, data shapes, what is explicitly out of scope.&lt;/p&gt;

&lt;p&gt;You review it. If something is wrong you flag it. If it aligns you say so. Then another hard stop.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;With GitHub MCP connected&lt;/strong&gt;, the PRD is automatically submitted as a GitHub issue. Every feature becomes a tracked issue before a single line of code is written.&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="c"&gt;# Connect GitHub MCP once&lt;/span&gt;
claude mcp add &lt;span class="nt"&gt;--transport&lt;/span&gt; http github https://api.githubcopilot.com/mcp/ &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--header&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer YOUR_GITHUB_TOKEN"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now &lt;code&gt;/prd&lt;/code&gt; creates the spec and opens the issue. When Phase 3 finishes, the AI automatically creates a PR linked to that issue. Your entire feature lifecycle - spec, implementation, review, merge - tracked in GitHub without leaving the terminal.&lt;/p&gt;




&lt;h2&gt;
  
  
  Phase 3 - TDD
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Triggered by:&lt;/strong&gt; &lt;code&gt;/tdd build &amp;lt;feature&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;All the code is written here. The cycle is red → green → refactor. Write a failing test, write the minimum code to pass it, clean up, move to the next behavior.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For a frontend component:&lt;/strong&gt;&lt;br&gt;
Types first, then data, then component, then wired into the page. After build passes, Playwright MCP opens the browser automatically, takes a screenshot, compares it against your design reference, lists every discrepancy, fixes them, re-screenshots. Repeats until it matches both light and dark mode.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For a backend endpoint:&lt;/strong&gt;&lt;br&gt;
Types first, then service logic, then controller, then route registration. Tests cover happy path, validation errors, authentication failures, and edge cases from the PRD.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For an API integration:&lt;/strong&gt;&lt;br&gt;
Service layer built and tested first with mocked responses. Real API connected. Error states, loading states, empty states all verified against the PRD.&lt;/p&gt;

&lt;p&gt;Nothing is committed yet. Phase 4 happens first.&lt;/p&gt;


&lt;h2&gt;
  
  
  Phase 4 - Review
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Triggered by:&lt;/strong&gt; &lt;code&gt;/review&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After &lt;code&gt;/tdd&lt;/code&gt; finishes the AI audits everything it just built against your CLAUDE.md rules.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hardcoded values that should be tokens? Flagged.&lt;/li&gt;
&lt;li&gt;Missing TypeScript types? Flagged.&lt;/li&gt;
&lt;li&gt;Components that duplicate existing primitives? Flagged.&lt;/li&gt;
&lt;li&gt;API calls missing error handling? Flagged.&lt;/li&gt;
&lt;li&gt;Accessibility issues? Flagged.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then it fixes everything it flagged. The diff you approve is clean code - not just working code.&lt;/p&gt;

&lt;p&gt;After &lt;code&gt;/review&lt;/code&gt; passes, the AI proposes a commit message, shows the full diff, and waits. You review, approve, and it commits - or creates a PR linked to the GitHub issue automatically.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Full Setup
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Install once globally:&lt;/strong&gt;&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="c"&gt;# Claude Code CLI&lt;/span&gt;
npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @anthropic-ai/claude-code

&lt;span class="c"&gt;# Matt Pocock's skills - /grill-with-docs, /tdd, /prd, /review&lt;/span&gt;
npx openskills &lt;span class="nb"&gt;install &lt;/span&gt;mattpocock/skills &lt;span class="nt"&gt;--global&lt;/span&gt;

&lt;span class="c"&gt;# Playwright MCP - real browser for visual verification&lt;/span&gt;
claude mcp add &lt;span class="nt"&gt;--transport&lt;/span&gt; stdio playwright &lt;span class="nt"&gt;--&lt;/span&gt; npx &lt;span class="nt"&gt;-y&lt;/span&gt; @playwright/mcp@latest

&lt;span class="c"&gt;# GitHub MCP - optional, for automatic issues and PRs&lt;/span&gt;
claude mcp add &lt;span class="nt"&gt;--transport&lt;/span&gt; http github https://api.githubcopilot.com/mcp/ &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--header&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer YOUR_TOKEN"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Per project - four files:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docs/designs/system-design.md   ← design tokens
docs/designs/ss/*.png            ← feature screenshots
CLAUDE.md                        ← project rules
CONTEXT.md                       ← domain language
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Per feature - four commands:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/grill-with-docs build &amp;lt;feature&amp;gt;   &lt;span class="c"&gt;# questions + task spec → STOP&lt;/span&gt;
/prd                                &lt;span class="c"&gt;# PRD + GitHub issue   → STOP&lt;/span&gt;
/tdd build &amp;lt;feature&amp;gt;                &lt;span class="c"&gt;# build + Playwright   → STOP&lt;/span&gt;
/review                             &lt;span class="c"&gt;# quality gate → commit approval&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  What This Looks Like End to End
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Building a user management feature&lt;/span&gt;

/grill-with-docs build user management
&lt;span class="c"&gt;# AI reads CLAUDE.md, CONTEXT.md, system-design.md&lt;/span&gt;
&lt;span class="c"&gt;# Asks: what fields does a user have? what roles exist?&lt;/span&gt;
&lt;span class="c"&gt;# what does the list page look like? (reads screenshot)&lt;/span&gt;
&lt;span class="c"&gt;# what happens when you delete a user with active sessions?&lt;/span&gt;
&lt;span class="c"&gt;# ... 10 questions total, you answer each one&lt;/span&gt;
&lt;span class="c"&gt;# writes docs/tasks/user-management.md&lt;/span&gt;
&lt;span class="c"&gt;# STOP&lt;/span&gt;

/prd
&lt;span class="c"&gt;# synthesizes task spec into full PRD&lt;/span&gt;
&lt;span class="c"&gt;# creates GitHub issue #47 automatically&lt;/span&gt;
&lt;span class="c"&gt;# STOP&lt;/span&gt;

/tdd build user management
&lt;span class="c"&gt;# writes failing tests&lt;/span&gt;
&lt;span class="c"&gt;# builds UserService, UserController, routes&lt;/span&gt;
&lt;span class="c"&gt;# builds UserTable, UserForm components&lt;/span&gt;
&lt;span class="c"&gt;# Playwright screenshots list page, compares against design&lt;/span&gt;
&lt;span class="c"&gt;# fixes spacing mismatch on row height&lt;/span&gt;
&lt;span class="c"&gt;# re-screenshots, matches - done&lt;/span&gt;
&lt;span class="c"&gt;# STOP&lt;/span&gt;

/review
&lt;span class="c"&gt;# flags: UserForm missing loading state from PRD&lt;/span&gt;
&lt;span class="c"&gt;# flags: one hardcoded hex color in UserTable&lt;/span&gt;
&lt;span class="c"&gt;# fixes both&lt;/span&gt;
&lt;span class="c"&gt;# proposes commit: "feat: add user management (#47)"&lt;/span&gt;
&lt;span class="c"&gt;# you approve&lt;/span&gt;
&lt;span class="c"&gt;# PR created, linked to issue #47&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One feature. Four commands. Complete audit trail. Zero surprises.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why The Hard Stops Matter
&lt;/h2&gt;

&lt;p&gt;Most AI-assisted workflows fail because the AI keeps moving. It generates code while you are still figuring out what you want. By the time you realize the direction is wrong there is significant code to undo.&lt;/p&gt;

&lt;p&gt;Forcing a stop after grilling means the spec is locked before implementation. Forcing a stop after the PRD means the contract is signed before code runs. Forcing a stop after TDD means the code is reviewed before it is committed.&lt;/p&gt;

&lt;p&gt;By Phase 4 there are no open questions - just a quality check on clean execution.&lt;/p&gt;

&lt;p&gt;The Playwright visual check closes the quality loop for frontend. The test suite closes it for backend. The &lt;code&gt;/review&lt;/code&gt; phase closes it for code quality. Without automated verification "looks good" and "seems to work" are the standards. With it the check is objective and repeatable.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Numbers
&lt;/h2&gt;

&lt;p&gt;Gartner predicts that by 2028, &lt;strong&gt;75% of enterprise software engineers&lt;/strong&gt; will use AI coding assistants daily, up from roughly 25% in 2025. Claude Code usage has grown &lt;strong&gt;340% year over year&lt;/strong&gt; according to Anthropic's 2026 developer report. The percentage of professional developers using AI in their daily workflow crossed &lt;strong&gt;60%&lt;/strong&gt; in Q1 2026 for the first time.&lt;/p&gt;

&lt;p&gt;But the shift that is coming is not about more developers using AI. It is about developers using AI differently - moving from ad-hoc prompting to structured workflows, from chatbox conversations to disciplined collaboration.&lt;/p&gt;

&lt;p&gt;The four-phase loop is one version of that structure. The specific commands will evolve. Better tools will emerge. But the underlying discipline - front-load decisions, lock the spec, verify automatically, review before committing - that will remain.&lt;/p&gt;

&lt;p&gt;Because that discipline is not about AI. It is about how good software gets built. AI just makes the execution faster.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Honest Part
&lt;/h2&gt;

&lt;p&gt;This workflow only works if you can answer the grilling questions. Phase 1 exposes every gap in your thinking. If you do not know what you are building the AI cannot figure it out for you.&lt;/p&gt;

&lt;p&gt;AI removes friction between thinking and shipping. It does not replace the thinking.&lt;/p&gt;

&lt;p&gt;We spent years learning to write code. The next skill is learning to direct it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Start Here
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Take screenshots of your current project's designs&lt;/li&gt;
&lt;li&gt;Write a system-design.md extracting the tokens&lt;/li&gt;
&lt;li&gt;Write a CLAUDE.md - ten minutes, basics only&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;/grill-with-docs&lt;/code&gt; on your next feature&lt;/li&gt;
&lt;li&gt;Answer every question honestly&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The first session will feel slower than prompting and copying. The second will feel natural. By the third you will not want to go back.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Software engineer, 4+ years building web applications.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://github.com/Taufiqul7756" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; · &lt;a href="https://linkedin.com/in/taufiqul7756" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>productivity</category>
      <category>claudecode</category>
    </item>
    <item>
      <title>How Software Engineers Can Stay Relevant in the Age of AI</title>
      <dc:creator>Taufiqul Islam</dc:creator>
      <pubDate>Mon, 08 Dec 2025 05:59:56 +0000</pubDate>
      <link>https://dev.to/taufiqul7756/how-software-engineers-can-stay-relevant-in-the-age-of-ai-37dj</link>
      <guid>https://dev.to/taufiqul7756/how-software-engineers-can-stay-relevant-in-the-age-of-ai-37dj</guid>
      <description>&lt;p&gt;📌 &lt;em&gt;This blog lays the foundation. After reading it, check out my updated article to see how AI workflows &lt;strong&gt;(/grill, /prd, /tdd, /review)&lt;/strong&gt; are changing the way we build software.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Imagine waking up one day to find that the skills you’ve spent years mastering are suddenly being performed faster, cheaper, and more efficiently by AI. This isn’t science fiction - it’s the reality facing software engineers today.&lt;/p&gt;

&lt;p&gt;In 2001, a professor told his students that software engineering was a golden ticket to job security. Fast forward to 2025, and the CEO of GitHub declared that the future of programming is natural language. The prediction came true - but not in the way anyone expected. AI is now capable of writing code, fixing bugs, and even generating entire projects from natural language prompts. Tools like GitHub Copilot and ChatGPT are changing the game, raising a critical question: &lt;br&gt;
&lt;strong&gt;How can software engineers stay relevant in an era where AI is becoming a co-pilot- or even a competitor?⛔&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Don’t be afraid, this isn’t the end of software engineering. It’s the beginning of a new chapter. Let’s explore how you can not only stay relevant but thrive in the age of AI.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧠 &lt;strong&gt;1. AI’s Capabilities and Limitations: What You Need to Know&lt;/strong&gt;
&lt;/h2&gt;

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

&lt;p&gt;&lt;strong&gt;💪 What AI Can Do&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Generate code fast:&lt;/strong&gt; Can produce large, functional codebases    within seconds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Translate languages:&lt;/strong&gt; Converts code between languages (e.g., Python ⇄ JavaScript).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automate fixes &amp;amp; tasks:&lt;/strong&gt; Helps with debugging, testing, repetitive work, and UI generation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🙏 What AI Can’t Do&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Understand the “why”:&lt;/strong&gt; Lacks human intuition and real context.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Think strategically:&lt;/strong&gt; Can’t handle long-term planning, trade-offs, or ethics well.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Communicate &amp;amp; collaborate:&lt;/strong&gt; Cannot replace human empathy or teamwork.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Be fully reliable:&lt;/strong&gt; May hallucinate or produce incorrect code; most AI code still needs human review.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📌 &lt;em&gt;AI is like a brilliant junior developer, it can do a lot quickly, but it’s up to us to define the vision, validate the results, and ensure what we’re building is good for society.&lt;/em&gt;&lt;/p&gt;

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




&lt;h2&gt;
  
  
  🛠️ &lt;strong&gt;2. The Evolving Role of Software Engineers: Beyond Coding&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Software engineering has never been just about writing code. It’s about solving problems, understanding user needs, and making tough decisions. &lt;/p&gt;

&lt;p&gt;In the AI era, the role of engineers is evolving:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqn4eps3j3b3gy4pc2woy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqn4eps3j3b3gy4pc2woy.png" alt="coders tpo visionaries" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Look at the image, and you’ll understand why engineers are still essential. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Understanding AI:&lt;/strong&gt; Engineers don’t just prompt AI - they understand the models, data pipelines, and risks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Building Better Software:&lt;/strong&gt; Anyone can prototype a demo with AI, but engineers build scalable, maintainable, and secure systems.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improving AI&lt;/strong&gt;: Engineers fine-tune models, optimize performance, and make AI accessible to everyone.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📌 &lt;em&gt;We’re not just building software anymore - we’re building the future of intelligence itself.&lt;/em&gt; &lt;/p&gt;




&lt;h2&gt;
  
  
  📚 &lt;strong&gt;3. How to Prepare for the Future: Foundations &amp;amp; Practical Steps&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Master the Foundations&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Data Structures and Algorithms:&lt;/strong&gt; These are the bedrock of adaptability. Spend time mastering them.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Full-Stack Thinking:&lt;/strong&gt; The days of specializing in just frontend or backend are fading. Future engineers must be versatile, bridging gaps between design, product management, and data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Develop Soft Skills&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;Communication and Collaboration:&lt;/strong&gt; AI can’t replace human connection. Engineers who can explain complex ideas and work well in teams will stand out.&lt;/li&gt;
&lt;li&gt;   &lt;strong&gt;Leadership:&lt;/strong&gt; Engineers are becoming leaders - not just of teams, but of AI itself.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Embrace AI as a Creative Partner&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use AI to prototype, automate repetitive tasks, and explore generative tools.&lt;/li&gt;
&lt;li&gt;Treat AI like a teammate discuss projects, delegate work, and iterate together.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Stay Adaptable&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tools change, but principles like critical thinking and problem-solving endure.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Focus on learning how to learn&lt;/em&gt;. Adaptability will define leadership in the AI era.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📌 &lt;em&gt;In the future, engineers won’t just lead teams - they’ll lead AI too.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Final Thoughts: Are You an AI Zombie or an AI Master?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So, here’s the deal:&lt;/strong&gt; AI isn’t just knocking on the door - it’s already inside, raiding your fridge and rearranging your code. The question is, are you using AI, or is AI using you?&lt;/p&gt;

&lt;p&gt;Let’s talk numbers, because numbers don’t lie (unless they’re generated by AI, of course):&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;55% of developers&lt;/strong&gt; are using tools like GitHub Copilot. If you’re not in that 55%, congratulations! You’re officially a manual laborer in a world of cyborgs. Enjoy your handwritten loops and debugging marathons.&lt;br&gt;
&lt;strong&gt;Only 30%&lt;/strong&gt; of those developers accept AI - generated code without changes. If you’re in that 30%, you’re in danger, my friend.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;68% of developers&lt;/strong&gt; (per Stack Overflow 2025) use AI tools daily, cutting repetitive tasks by 40%.&lt;/p&gt;

&lt;p&gt;📌 &lt;em&gt;The future isn’t about fearing AI - it’s about mastering it.&lt;/em&gt; &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Share your thoughts:&lt;/strong&gt; How are you adapting to AI in your work? Let’s discuss in the comments!&lt;br&gt;
&lt;strong&gt;Stay curious:&lt;/strong&gt; Follow tech blogs, attend webinars, and experiment with AI tools.&lt;br&gt;
&lt;strong&gt;Keep learning:&lt;/strong&gt; The best engineers never stop growing.&lt;/p&gt;




</description>
      <category>softwareengineering</category>
      <category>career</category>
      <category>learning</category>
      <category>futureofwork</category>
    </item>
    <item>
      <title>Next.js 15 Authentication with nextAuth.js , App Router and Middleware</title>
      <dc:creator>Taufiqul Islam</dc:creator>
      <pubDate>Thu, 29 May 2025 15:07:21 +0000</pubDate>
      <link>https://dev.to/taufiqul7756/nextjs-15-authentication-with-app-router-and-middleware-4f94</link>
      <guid>https://dev.to/taufiqul7756/nextjs-15-authentication-with-app-router-and-middleware-4f94</guid>
      <description>&lt;p&gt;Here's a comprehensive guide to setting up authentication in Next.js 15 using the App Router, middleware, and NextAuth.js.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Folder Structure&lt;/strong&gt;&lt;br&gt;
Here's a visual representation of the folder structure :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/src/
├── app/
│   ├── auth/
│   │   ├── login/
│   │   │   └── page.tsx
│   │   └── register/
│   │       └── page.tsx
│   ├── dashboard/
│   │   └── page.tsx
│   ├── api/
│   │   └── auth/
│   │       └── [...nextauth]/
│   │           └── route.ts
│   ├── provider.tsx
│   ├── layout.tsx
│   └── page.tsx
├── middleware/
│   └── middleware.ts
├── lib/
│   ├── auth.ts
│   └── next-auth.d.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔐 &lt;strong&gt;1. Authentication Setup : &lt;code&gt;/app/api/auth/[...nextauth]/route.ts&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Sets up the API route for NextAuth using handlers imported from the central auth config &lt;code&gt;(/lib/auth.ts)&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { GET, POST } from "@/lib/auth";
export { GET, POST };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;⚙️ &lt;strong&gt;2. Auth Configuration : &lt;code&gt;/lib/auth.ts&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Defines NextAuth options, including the credentials provider, JWT/session callbacks, token refresh logic, and error handling.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import NextAuth, { type NextAuthOptions } from "next-auth";
import Credentials from "next-auth/providers/credentials";

import { AxiosError } from "axios";
import { post } from "./api/handlers";

type LoginResponse = {
  accessToken: string;
  refreshToken: string;

  user: {
    _id: string;
    stdId: string;
    name: string;
    email: string;
    hallName: string;
    description: string;
    role: string;
  };
};

const authOptions: NextAuthOptions = {
  providers: [
    Credentials({
      name: "Credentials",
      credentials: {
        email: { label: "Email", type: "email" },
        password: { label: "Password", type: "password" },
      },
      authorize: async (credentials) =&amp;gt; {
        if (credentials === null) throw new Error("Missing credentials");

        try {
          const response = await post&amp;lt;LoginResponse&amp;gt;(
            "/api/auth/login",
            {
              email: credentials?.email,
              password: credentials?.password,
            },
            {
              "Content-Type": "application/json",
            },
          );
          console.log("API Response:", response);

          if (response.accessToken) {
            // Return an object that matches your User interface
            return {
              id: response.user._id,
              email: response.user.email,
              name: response.user.name,
              accessToken: response.accessToken,
              refreshToken: response.refreshToken,
              user: response.user,
            };
          }
          return null;
        } catch (error) {
          if (error instanceof AxiosError) {
            throw new Error(error.response?.data?.message || "Login failed");
          }
          console.error("Authentication error:", error);
          throw new Error("Login failed");
        }
      },
    }),
  ],
  callbacks: {
    jwt: async ({ token, user }) =&amp;gt; {
      if (user) {
        // Include both the required fields and your custom data
        token.id = user.id;
        token.email = user.email;
        token.name = user.name;
        token.accessToken = user.accessToken;
        token.refreshToken = user.refreshToken;
        token.user = user.user;
        token.accessTokenExpires = Math.floor(Date.now() / 1000) + 60;
      }
      // Check if the current time is past the access token's expiry time
      const now = Math.floor(Date.now() / 1000);
      if (token.accessTokenExpires &amp;amp;&amp;amp; now &amp;gt; token.accessTokenExpires) {
        try {
          // Attempt to refresh the access token
          const response = await post&amp;lt;{ accessToken: string }&amp;gt;(
            "/api/auth/refresh-token",
            {
              refreshToken: token.refreshToken,
            },
            {
              "Content-Type": "application/json",
            },
          );

          // Update the token with the new access token
          token.accessToken = response.accessToken;
          token.accessTokenExpires = now + 60; // Set new expiry time (1 minute from now)
        } catch (error) {
          console.error("Error refreshing access token", error);
          // Handle refresh token error (e.g., redirect to login)
          return { ...token, error: "RefreshAccessTokenError" };
        }
      }

      return token;
    },
    session: ({ session, token }) =&amp;gt; {
      if (token) {
        session.user = {
          ...session.user,
          // id: token.id,
          email: token.email,
          name: token.name,
        };
        (session as any).accessToken = token.accessToken;
        (session as any).user = token.user;
      }
      return session;
    },
    redirect: async ({ url, baseUrl }) =&amp;gt; {
      // Redirect to login page if there's an error with the refresh token
      if (url === baseUrl) {
        return `${process.env.NEXT_PUBLIC_BASE_URL}/login`;
      }
      return url;
    },
    // authorized: async ({ auth }) =&amp;gt; {
    //   return !!auth;
    // },
  },
  pages: {
    signIn: "/login",
    error: "/login",
  },
  session: {
    strategy: "jwt" as const,
  },
  debug: process.env.NODE_ENV === "development",
  secret:
    process.env.NEXTAUTH_SECRET,
};

const handler = NextAuth(authOptions);

export { handler as GET, handler as POST, authOptions };
export const auth = handler.auth;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📄 &lt;strong&gt;3. Type Definitions:  &lt;code&gt;/lib/next-auth.d.ts&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Extends NextAuth types &lt;em&gt;(Session, User, and JWT)&lt;/em&gt; to include custom user data like role, hallName, and refreshToken.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import NextAuth from "next-auth";

declare module "next-auth" {
  interface Session {
    accessToken: string;
    refreshToken: string;
    user: {
      _id: string;
      stdId: string;
      name: string | null | undefined;
      email: string | null | undefined;
      hallName: string;
      description: string;
      role: string;
    };
  }

  interface User {
    id: string;
    accessToken: string;
    refreshToken: string;
    user: {
      _id: string;
      stdId: string;
      name: string;
      email: string;
      hallName: string;
      description: string;
      role: string;
    };
  }
}

declare module "next-auth/jwt" {
  interface JWT {
    id?: string;
    email?: string | null;
    name?: string | null;
    accessToken?: string;
    refreshToken?: string;
    accessTokenExpires?: number;
    error?: string;
    user?: {
      _id: string;
      stdId: string;
      name: string;
      email: string;
      hallName: string;
      description: string;
      role: string;
    };
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🧱 &lt;strong&gt;4. Middleware : &lt;code&gt;/middleware/middleware.ts&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Protects private routes by checking if the user is authenticated; redirects to login if no valid token is found.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";
import { getToken } from "next-auth/jwt";

export async function middleware(request: NextRequest) {
  const token = await getToken({ req: request });

  // Check if the user is trying to access a protected route
  if (!token &amp;amp;&amp;amp; !request.nextUrl.pathname.startsWith("/auth/login")) {
    // Redirect to login page if there is no token
    return NextResponse.redirect(new URL("/auth/login", request.url));
  }

  return NextResponse.next();
}

export const config = {
  matcher: [
    "/((?!api|_next/static|_next/image|favicon.ico).*)",
    "/dashboard/:path*",
  ],
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🧪 &lt;strong&gt;5. Session Provider : &lt;code&gt;/app/provider.tsx&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Wraps the app with SessionProvider so session data is accessible in all client components.&lt;br&gt;
&lt;/p&gt;

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

import { SessionProvider } from "next-auth/react";
import React from "react";

interface AuthProviderProps {
  children: React.ReactNode;
}

const AuthProvider: React.FC&amp;lt;AuthProviderProps&amp;gt; = ({ children }) =&amp;gt; {
  return &amp;lt;SessionProvider&amp;gt;{children}&amp;lt;/SessionProvider&amp;gt;;
};

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

&lt;/div&gt;



&lt;p&gt;🌐 &lt;strong&gt;6. Root Layout : &lt;code&gt;/app/layout.tsx&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Includes global providers (Auth, React Query, UI layout) and sets up the app’s foundational structure with session support.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// app/layout.tsx
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";

import { SessionProvider } from "next-auth/react";
import { Toaster } from "react-hot-toast";
import ReactQueryProvider from "@/providers/QueryClientProvider";
import LayoutProvider from "@/providers/LayoutProvider";
import AuthProvider from "./provider";

const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
  title: "title",
  description: "description",
};

export default async function RootLayout({
  children,
}: Readonly&amp;lt;{
  children: React.ReactNode;
}&amp;gt;) {
  // const session = await auth();

  return (
    &amp;lt;html lang="en" suppressHydrationWarning&amp;gt;
      &amp;lt;head&amp;gt;
        &amp;lt;title&amp;gt;E Delivery Client&amp;lt;/title&amp;gt;
      &amp;lt;/head&amp;gt;
      &amp;lt;body className={inter.className}&amp;gt;
        &amp;lt;AuthProvider&amp;gt;
          &amp;lt;ReactQueryProvider&amp;gt;
            &amp;lt;LayoutProvider&amp;gt;{children}&amp;lt;/LayoutProvider&amp;gt;
          &amp;lt;/ReactQueryProvider&amp;gt;
        &amp;lt;/AuthProvider&amp;gt;
        &amp;lt;Toaster position="top-right" /&amp;gt;
      &amp;lt;/body&amp;gt;
    &amp;lt;/html&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🧠 &lt;strong&gt;Accessing Session Data&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;🧾 &lt;strong&gt;Client Component Example:&lt;/strong&gt;&lt;br&gt;
Uses useSession hook from NextAuth to get and display user session data in client-side components.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"use client";
import { useSession } from "next-auth/react";

export default function DashboardPage() {
  const { data: session, status } = useSession();

  return (
    &amp;lt;div&amp;gt;
      {session ? (
        &amp;lt;p&amp;gt;
          Logged in as name: {session.user.name} Email: {session.user.email}
        &amp;lt;/p&amp;gt;
      ) : (
        &amp;lt;p&amp;gt;Not logged in&amp;lt;/p&amp;gt;
      )}
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🧾 &lt;strong&gt;Server Component Example&lt;/strong&gt;&lt;br&gt;
Fetches the session using auth() in server components, redirecting unauthenticated users to the login page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { auth } from "@/lib/auth";
import { redirect } from "next/navigation";

export default async function ProfilePage() {
  const session = await auth();

  if (!session) {
    redirect("/auth/login");
  }

  return (
    &amp;lt;div className="p-4"&amp;gt;
      &amp;lt;h1 className="text-2xl font-bold"&amp;gt;Profile&amp;lt;/h1&amp;gt;
      &amp;lt;div className="mt-4 space-y-2"&amp;gt;
        &amp;lt;p&amp;gt;
          &amp;lt;span className="font-semibold"&amp;gt;Email:&amp;lt;/span&amp;gt; {session.user.email}
        &amp;lt;/p&amp;gt;       
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;✅ Credentials Auth: Uses email &amp;amp; password login via a custom backend.&lt;br&gt;
🔁 Token Refresh: Automatically refreshes JWT access tokens using refresh tokens.&lt;br&gt;
🔒 Protected Routes: Middleware blocks access to routes if not logged in.&lt;br&gt;
🛡️ Type Safety: Custom types improve safety and developer experience.&lt;br&gt;
🔍 Session Access: Available in both server and client components.&lt;br&gt;
🧱 Provider Pattern: Clean separation of logic using dedicated providers.&lt;/p&gt;

&lt;p&gt;⚠️ &lt;strong&gt;Implementation Notes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Make sure to configure your environment variables properly, especially NEXTAUTH_SECRET&lt;br&gt;
&lt;code&gt;.env&lt;/code&gt; example :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NEXT_PUBLIC_BASE_URL=your base url
NODE_ENVL=development
NEXTAUTH_SECRET=hbbinmkbnnkvdfjvskvnkvDDVVfvmndjbvshbvhbrvv=
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The middleware checks for authentication status on every route change&lt;/p&gt;

&lt;p&gt;The session data includes both standard fields (email, name) and custom fields (role, hallName, etc.)&lt;/p&gt;

&lt;p&gt;Error handling is implemented for both login and token refresh operations&lt;/p&gt;

&lt;p&gt;This setup provides a solid foundation for authentication in Next.js 15 applications using the App Router, with proper type safety and route protection.&lt;/p&gt;

</description>
      <category>nextauth</category>
      <category>nextjs</category>
      <category>authentication</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Strapi API with PostgreSQL – Quick Reference 🚀</title>
      <dc:creator>Taufiqul Islam</dc:creator>
      <pubDate>Thu, 17 Oct 2024 11:11:05 +0000</pubDate>
      <link>https://dev.to/taufiqul7756/strapi-api-with-postgresql-quick-reference-205g</link>
      <guid>https://dev.to/taufiqul7756/strapi-api-with-postgresql-quick-reference-205g</guid>
      <description>&lt;p&gt;&lt;strong&gt;Strapi&lt;/strong&gt; is an open-source headless CMS (Content Management System) built to work with any frontend and any database. It provides developers with a flexible and customizable solution for building content-rich applications, giving them full control over the API, data model, and platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Strapi? 🏗️
&lt;/h2&gt;

&lt;p&gt;Strapi sets itself apart from other CMS solutions in several ways:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Open-source and Self-hosted&lt;/strong&gt;: Unlike most CMS platforms, Strapi allows you to self-host your instance, offering greater flexibility, control, and security.&lt;br&gt;
&lt;strong&gt;Headless by Design&lt;/strong&gt;: Strapi is built as a headless CMS, meaning the frontend and backend are decoupled, giving you the freedom to use any frontend technology—React, Vue, Angular, or even native mobile apps.&lt;br&gt;
&lt;strong&gt;Customizable APIs&lt;/strong&gt;: Strapi lets you customize the API for your specific needs, whether it’s REST or GraphQL, making it ideal for projects requiring complex data structures.&lt;br&gt;
&lt;strong&gt;Database Agnostic&lt;/strong&gt;: You can use Strapi with multiple databases like PostgreSQL, MongoDB, MySQL, or SQLite, offering seamless flexibility for different use cases.&lt;/p&gt;



&lt;p&gt;This guide provides an overview of basic operations for managing products and images using Strapi, with PostgreSQL as the database. Ensure you have &lt;strong&gt;PostgreSQL&lt;/strong&gt; and &lt;strong&gt;PgAdmin 4&lt;/strong&gt; installed if you're using PostgreSQL for your Strapi setup.&lt;/p&gt;
&lt;h3&gt;
  
  
  Prerequisites 🛠️
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Install and set up Strapi following the &lt;a href="https://docs.strapi.io/dev-docs/quick-start" rel="noopener noreferrer"&gt;official Strapi Quick Start guide&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Ensure you have PostgreSQL installed in your system.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  REST API Overview 🌳
&lt;/h3&gt;

&lt;p&gt;For complete details, refer to the &lt;a href="https://docs.strapi.io/dev-docs/api/rest" rel="noopener noreferrer"&gt;Strapi REST API documentation&lt;/a&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  Products Collection API
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Assume&lt;/strong&gt; a &lt;code&gt;Products&lt;/code&gt; collection with fields:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Product_name&lt;/code&gt;: String (Name of the product)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;img&lt;/code&gt;: Media (Image ID associated with the product)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;state&lt;/code&gt;: Boolean (Indicating product status)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  1. &lt;strong&gt;Get All Products&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Retrieve all products with their associated data (including images).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Endpoint:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;GET http://localhost:1337/api/products?populate=*&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;populate=*&lt;/code&gt; ensures all relational data, including images, are properly fetched.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  2. &lt;strong&gt;Upload an Image&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Upload an image to the Strapi server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Endpoint:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;POST http://localhost:1337/api/upload/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Request Body:&lt;/strong&gt; (form-data)  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;key = files&lt;/code&gt; (value is the image file uploaded from your browser).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  3. &lt;strong&gt;Get All Uploaded Images&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Retrieve all uploaded image files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Endpoint:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;GET http://localhost:1337/api/upload/files&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  4. &lt;strong&gt;Add a New Product&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Create a new product entry in the &lt;code&gt;Products&lt;/code&gt; collection.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Endpoint:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;POST http://localhost:1337/api/products&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Request Body:&lt;/strong&gt;&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;"data"&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;"Product_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;"Samsung S4 old colored"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"state"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"img"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&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;ul&gt;
&lt;li&gt;The &lt;code&gt;"img": 3&lt;/code&gt; field refers to the ID of the uploaded image, in this case, image ID &lt;code&gt;3&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. &lt;strong&gt;Update a Product&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Update a specific product using its &lt;code&gt;documentId&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Endpoint:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;PUT http://localhost:1337/api/products/:documentId&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Request Body:&lt;/strong&gt;&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;"data"&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;"Product_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;"Samsung S4 old updated"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"state"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"img"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&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;Here, you update the product name while keeping the image ID (&lt;code&gt;3&lt;/code&gt;), which represents the already uploaded image.&lt;/p&gt;




&lt;p&gt;📚 This document should serve as a quick reference for managing products and images in Strapi with PostgreSQL. For further customization or detailed configurations, consult the official Strapi documentation.&lt;/p&gt;

</description>
      <category>strapi</category>
      <category>webdev</category>
      <category>postgressql</category>
      <category>strapirestapi</category>
    </item>
  </channel>
</rss>
