Type something to search...

Nextjs

Building a Progressive Web App (PWA) with Next.js

Building a Progressive Web App (PWA) with Next.js

A Progressive Web App is a website that can behave like an installed app. Users can add it to their home screen or dock, it opens in its own window w

Continue Reading
Building a Monorepo with Next.js and Turborepo

Building a Monorepo with Next.js and Turborepo

The second Next.js app is usually where things get messy. You build a marketing site, then a dashboard, then maybe a docs site, and each one needs th

Continue Reading
Implementing Rate Limiting in Next.js Route Handlers

Implementing Rate Limiting in Next.js Route Handlers

Every public endpoint will eventually get hit harder than you planned. Sometimes it's a scraper, sometimes a bot trying passwords on your login route

Continue Reading
Monitoring and Error Tracking in Next.js with Sentry and OpenTelemetry

Monitoring and Error Tracking in Next.js with Sentry and OpenTelemetry

In development, Next.js shows you every error in a big red overlay. In production, an error in a Server Component turns into a generic "Something wen

Continue Reading
Setting Up CI/CD for Next.js with GitHub Actions

Setting Up CI/CD for Next.js with GitHub Actions

A Next.js project without CI relies on everyone remembering to run the linter, the type checker, and the tests before they push. Somebody eventually

Continue Reading
Exporting a Fully Static Next.js Site with output: "export"

Exporting a Fully Static Next.js Site with output: "export"

Not every Next.js project needs a server. A documentation site, a portfolio, a marketing site, or a blog whose content changes only when you deploy c

Continue Reading
Self-Hosting Next.js with Docker and Standalone Output

Self-Hosting Next.js with Docker and Standalone Output

Next.js runs anywhere Node.js runs. You don't need a specific platform to get Server Components, streaming, image optimization, Server Actions, or `p

Continue Reading
A Deep Dive into next.config Options Every Developer Should Know

A Deep Dive into next.config Options Every Developer Should Know

next.config.ts is the one file every Next.js project has and almost nobody reads end to end. It starts as an empty object, then slowly collects a r

Continue Reading
Managing Environment Variables in Next.js: Build-Time vs Runtime

Managing Environment Variables in Next.js: Build-Time vs Runtime

Environment variables in Next.js look simple: put a value in .env, read it with process.env.SOMETHING, done. Then you deploy, change a value in y

Continue Reading
Common Next.js Errors and How to Fix Them

Common Next.js Errors and How to Fix Them

Most Next.js errors aren't really bugs in your logic. They're the framework telling you that code ended up on the wrong side of the server-client bou

Continue Reading
Fixing Hydration Mismatch Errors in Next.js

Fixing Hydration Mismatch Errors in Next.js

"Hydration failed because the server rendered HTML didn't match the client." If you've built anything non-trivial with Next.js, you've probably seen

Continue Reading
Debugging Next.js Applications in VS Code and Chrome DevTools

Debugging Next.js Applications in VS Code and Chrome DevTools

A Next.js app runs in two places at once. Server Components, Server Actions, Route Handlers, and proxy.ts execute in a Node.js process. Client Comp

Continue Reading
Testing Next.js Applications with Vitest

Testing Next.js Applications with Vitest

Vitest has become the default test runner for a lot of new JavaScript projects. It's fast, it understands TypeScript and ESM natively, its API is clo

Continue Reading
End-to-End Testing a Next.js App with Playwright

End-to-End Testing a Next.js App with Playwright

Unit tests tell you that a component renders the right markup for a given set of props. They can't tell you that your login flow works, that a Server

Continue Reading
Unit Testing Next.js Components with Jest and React Testing Library

Unit Testing Next.js Components with Jest and React Testing Library

Unit tests are the fastest feedback loop you can have on a Next.js project. They run in milliseconds, don't need a browser or a running server, and t

Continue Reading
Building Multi-Step Forms in Next.js with React Hook Form

Building Multi-Step Forms in Next.js with React Hook Form

Long forms are hard to complete. Splitting a signup, checkout, or onboarding flow into a few short steps makes it feel lighter, lets you validate as

Continue Reading
Syncing State with URL Search Params in Next.js

Syncing State with URL Search Params in Next.js

Think about the last time you filtered a product list, refreshed the page, and lost every filter you'd set. Or shared a link to a search result and t

Continue Reading
State Management in Next.js: Context, Zustand, or Redux Toolkit?

State Management in Next.js: Context, Zustand, or Redux Toolkit?

State management used to be one of the first architecture decisions in a React app. You picked Redux (or MobX, or something else), wired up a store a

Continue Reading
Building an AI Chat Interface in Next.js with the Vercel AI SDK

Building an AI Chat Interface in Next.js with the Vercel AI SDK

A chat interface looks like a simple feature: a list of messages and a text box. Under the hood, it needs streaming responses so text appears as the

Continue Reading
Using a Headless CMS with Next.js: Sanity, Contentful, and Strapi Compared

Using a Headless CMS with Next.js: Sanity, Contentful, and Strapi Compared

Markdown files in a Git repository are a great way to run a developer blog. They stop being great the moment someone who doesn't use Git needs to pub

Continue Reading
Role-Based Access Control in Next.js: Protecting Pages and Server Actions

Role-Based Access Control in Next.js: Protecting Pages and Server Actions

Authentication answers "who are you?". Authorization answers "what are you allowed to do?". Most Next.js tutorials stop at the first question: once t

Continue Reading
Handling File Uploads in Next.js: Local Storage, S3, and Beyond

Handling File Uploads in Next.js: Local Storage, S3, and Beyond

File uploads look simple: a file input, a submit button, and somewhere to put the bytes. In practice, the "somewhere" decides almost everything. Writ

Continue Reading
Sending Transactional Emails from Next.js with Resend and React Email

Sending Transactional Emails from Next.js with Resend and React Email

Almost every app sends email: welcome messages, password resets, receipts, invitations, "someone replied to your comment". These transactional emails

Continue Reading
Integrating Stripe Payments into a Next.js Application

Integrating Stripe Payments into a Next.js Application

Taking payments is one of those features where the happy path is easy and the edge cases are where money goes missing. A customer closes the tab befo

Continue Reading
Building a Full-Stack App with Next.js and Supabase

Building a Full-Stack App with Next.js and Supabase

Supabase gives you a Postgres database, authentication, file storage, and realtime subscriptions behind one project and one client library. Next.js g

Continue Reading
Connecting MongoDB to Next.js: Handling Connections in Serverless Environments

Connecting MongoDB to Next.js: Handling Connections in Serverless Environments

Connecting MongoDB to Next.js takes about five lines of code. Connecting it so it still works when your app has real traffic takes a bit more thought

Continue Reading
Using Drizzle ORM with Next.js: A Lightweight Type-Safe Alternative

Using Drizzle ORM with Next.js: A Lightweight Type-Safe Alternative

Drizzle ORM has become the go-to choice for Next.js developers who want type safety without a heavy runtime. There is no separate schema language, no

Continue Reading
Connecting Next.js to a Database with Prisma ORM

Connecting Next.js to a Database with Prisma ORM

The App Router changed how Next.js apps talk to databases. Server Components run on the server, so a page can query the database directly with no API

Continue Reading
Building a Responsive Navigation Menu in Next.js

Building a Responsive Navigation Menu in Next.js

Every site needs navigation, and almost every site needs it to work in two shapes: a horizontal row of links on wide screens and a collapsible menu b

Continue Reading
Adding Page Transitions and Animations to Next.js with Framer Motion

Adding Page Transitions and Animations to Next.js with Framer Motion

Animation is one of the easiest ways to make an app feel polished, and one of the easiest ways to make it feel slow. A subtle fade when a page loads,

Continue Reading
Building Accessible UI Components in Next.js with shadcn/ui

Building Accessible UI Components in Next.js with shadcn/ui

Building a dropdown menu that looks right takes an afternoon. Building one that works with a keyboard, announces itself to screen readers, traps and

Continue Reading
Using CSS Modules in Next.js: Scoped Styles Made Simple

Using CSS Modules in Next.js: Scoped Styles Made Simple

Global CSS has one big problem: every class name lives in the same namespace. Name something .card or .title and sooner or later another componen

Continue Reading
Implementing Dark Mode in Next.js Without a Flash of Unstyled Content

Implementing Dark Mode in Next.js Without a Flash of Unstyled Content

You add a dark mode toggle, pick dark, and reload the page. For a split second the page is bright white, then it snaps to dark. That flash is the mos

Continue Reading
Setting Up Tailwind CSS v4 in a Next.js Project

Setting Up Tailwind CSS v4 in a Next.js Project

Tailwind CSS and Next.js are the default pairing for a lot of React projects, and with Tailwind v4 the setup has become noticeably smaller. There's n

Continue Reading
Adding Syntax Highlighting to Code Blocks in a Next.js Blog

Adding Syntax Highlighting to Code Blocks in a Next.js Blog

If you write about code, your code blocks are half the post. Plain monospace text in a gray box works, but readers scan code by color: keywords, stri

Continue Reading
Generating an RSS Feed for Your Next.js Blog

Generating an RSS Feed for Your Next.js Blog

RSS never went away. Feed readers, newsletter tools, podcast apps, Slack integrations, and plenty of aggregators still pull content from a plain XML

Continue Reading
Creating Custom MDX Components and Shortcodes in Next.js

Creating Custom MDX Components and Shortcodes in Next.js

Plain Markdown gets you headings, paragraphs, lists, links, and code. That covers most of a blog post, but sooner or later you want something it can'

Continue Reading
Building a Markdown-Powered Blog with Next.js and MDX

Building a Markdown-Powered Blog with Next.js and MDX

A blog built from Markdown files in your repository is hard to beat for a developer's site or documentation. Posts live next to your code, they're ve

Continue Reading
Adding JSON-LD Structured Data to Next.js Pages for Rich Search Results

Adding JSON-LD Structured Data to Next.js Pages for Rich Search Results

Search engines are good at reading pages, but they still guess. Is "4.7" a rating or a version number? Is that date when the article was published or

Continue Reading
Creating sitemap.xml and robots.txt Programmatically in Next.js

Creating sitemap.xml and robots.txt Programmatically in Next.js

A sitemap tells search engines which URLs exist on your site and when they last changed. A robots.txt tells crawlers where they're allowed to go an

Continue Reading
Generating Dynamic Open Graph Images in Next.js with ImageResponse

Generating Dynamic Open Graph Images in Next.js with ImageResponse

When someone shares a link to your site, the preview image does most of the work of getting it clicked. A generic logo on every page looks the same i

Continue Reading
The Next.js Metadata API: Managing Titles, Descriptions, and Open Graph Tags

The Next.js Metadata API: Managing Titles, Descriptions, and Open Graph Tags

Every page on your site needs a title, a description, and a set of tags that tell search engines and social platforms how to present it. In the Pages

Continue Reading
Measuring Real-User Performance in Next.js with useReportWebVitals

Measuring Real-User Performance in Next.js with useReportWebVitals

Lighthouse tells you how your page performs on one simulated device, on one simulated network, on one run. Your users are on hundreds of different ph

Continue Reading
Edge Runtime vs Node.js Runtime in Next.js: Choosing the Right One

Edge Runtime vs Node.js Runtime in Next.js: Choosing the Right One

For a few years, "should this route run on the Edge?" was a real question in Next.js projects. You could add export const runtime = "edge" to a pag

Continue Reading
Turbopack in Next.js: What It Is and How It Speeds Up Development

Turbopack in Next.js: What It Is and How It Speeds Up Development

If you started a Next.js project recently, you're already using Turbopack. Since Next.js 16 it's the default bundler for both next dev and `next bu

Continue Reading
Lazy Loading Components in Next.js with next/dynamic

Lazy Loading Components in Next.js with next/dynamic

Not every component on a page is needed the moment the page loads. The rich text editor only matters once someone clicks "Edit". The chart sits three

Continue Reading
Analyzing and Reducing Bundle Size in Next.js with the Bundle Analyzer

Analyzing and Reducing Bundle Size in Next.js with the Bundle Analyzer

Every kilobyte of JavaScript you send has to be downloaded, parsed, and executed before the page is fully interactive, and on a mid-range phone, pars

Continue Reading
Improving Core Web Vitals in a Next.js Application

Improving Core Web Vitals in a Next.js Application

Core Web Vitals are Google's three measurements of how a page feels to real users: how fast the main content appears, how quickly the page responds t

Continue Reading
Loading Third-Party Scripts Efficiently with next/script

Loading Third-Party Scripts Efficiently with next/script

You can spend weeks shaving kilobytes off your own JavaScript and then lose all of it to a single chat widget. Third-party scripts (analytics, tag ma

Continue Reading
Font Optimization in Next.js with next/font: Eliminating Layout Shift

Font Optimization in Next.js with next/font: Eliminating Layout Shift

You load a page, start reading the first paragraph, and then the text jumps. Lines rewrap, a button moves down, the paragraph you were reading is sud

Continue Reading
Optimizing Images in Next.js with the next/image Component

Optimizing Images in Next.js with the next/image Component

Images are usually the heaviest thing on a page. A single unoptimized hero photo can outweigh all of your JavaScript, and images without reserved spa

Continue Reading
Streaming Responses and Server-Sent Events with Next.js Route Handlers

Streaming Responses and Server-Sent Events with Next.js Route Handlers

Most HTTP responses are all-or-nothing: the server does its work, then sends the whole body at once. That's fine for a list of products. It's not fin

Continue Reading
Route Handlers in Next.js: Building REST Endpoints in the App Router

Route Handlers in Next.js: Building REST Endpoints in the App Router

Server Components and Server Actions cover most of what a Next.js app needs from the server. Your pages read data directly, and your forms call funct

Continue Reading
Building Infinite Scroll and Paginated Lists in Next.js

Building Infinite Scroll and Paginated Lists in Next.js

Almost every app eventually has a list that's too long to render in one go: blog posts, products, comments, search results, activity feeds. You have

Continue Reading
Using SWR and TanStack Query Alongside Next.js Server Components

Using SWR and TanStack Query Alongside Next.js Server Components

Before the App Router, SWR and TanStack Query (formerly React Query) were close to mandatory in a serious React app. They handled loading states, cac

Continue Reading
Fetching Data in Parallel vs Sequentially in Next.js: Avoiding Request Waterfalls

Fetching Data in Parallel vs Sequentially in Next.js: Avoiding Request Waterfalls

Server Components make data fetching feel almost too easy. You mark a component async, await whatever you need, and render. But that convenience

Continue Reading
Partial Prerendering (PPR) in Next.js: Combining Static and Dynamic Content on One Page

Partial Prerendering (PPR) in Next.js: Combining Static and Dynamic Content on One Page

For years, every route in a Next.js app had to pick a side. A static route was prerendered once and served instantly from a CDN, but it couldn't show

Continue Reading
The "use cache" Directive in Next.js: A Guide to the New Caching Model

The "use cache" Directive in Next.js: A Guide to the New Caching Model

Caching in the App Router used to be something that happened to you. fetch calls were cached or not depending on the version, routes became static

Continue Reading
On-Demand Revalidation in Next.js with revalidatePath and revalidateTag

On-Demand Revalidation in Next.js with revalidatePath and revalidateTag

Caching makes Next.js pages fast, but cached content has an obvious problem: it can go out of date. Time-based revalidation helps, since you can tell

Continue Reading
Understanding the Next.js Caching Layers: Request Memoization, Data Cache, and Full Route Cache

Understanding the Next.js Caching Layers: Request Memoization, Data Cache, and Full Route Cache

Most confusion about caching in Next.js comes from treating it as one thing. You change a record in the database, reload the page, and the old value

Continue Reading
Form Validation in Next.js with Zod and Server Actions

Form Validation in Next.js with Zod and Server Actions

Server Actions make it easy to accept a form submission, but they hand you a FormData object full of strings, nulls, and the occasional File. Bef

Continue Reading
Optimistic UI Updates in Next.js with useOptimistic and Server Actions

Optimistic UI Updates in Next.js with useOptimistic and Server Actions

Every mutation that goes through the server has a gap between the click and the result. On a fast connection that gap might be 100 milliseconds; on a

Continue Reading
Server Actions in Next.js: Handling Form Submissions Without API Routes

Server Actions in Next.js: Handling Form Submissions Without API Routes

For a long time, handling a form in a React app meant writing the same plumbing over and over. You built an API route, wrote a client component with

Continue Reading
Using the server-only Package to Keep Sensitive Code Off the Client

Using the server-only Package to Keep Sensitive Code Off the Client

In the App Router, a module doesn't declare whether it's server code or client code. It becomes one or the other, or both, depending on who imports i

Continue Reading
Composition Patterns for Mixing Server and Client Components in Next.js

Composition Patterns for Mixing Server and Client Components in Next.js

Knowing the rules of Server and Client Components is one thing. Structuring a real page with them is another. A modal that contains server-fetched da

Continue Reading
Passing Data from Server Components to Client Components Without Leaking Secrets

Passing Data from Server Components to Client Components Without Leaking Secrets

Server Components make it easy to forget where the server ends. You query the database right inside a component, the code never ships to the browser,

Continue Reading
The "use client" Directive Explained: Drawing the Server–Client Boundary in Next.js

The "use client" Directive Explained: Drawing the Server–Client Boundary in Next.js

"use client" is one line at the top of a file, and it's responsible for a surprising amount of confusion. Developers add it to silence an error and

Continue Reading
React Server Components in Next.js: A Practical Mental Model

React Server Components in Next.js: A Practical Mental Model

React Server Components (RSC) are the default in the Next.js App Router, which means you're using them whether you've thought about them or not. Ever

Continue Reading
The Next.js Link Component: Prefetching, Scroll Behavior, and Best Practices

The Next.js Link Component: Prefetching, Scroll Behavior, and Best Practices

Link is probably the component you use most in a Next.js app, and the one you think about least. You import it from next/link, give it an href,

Continue Reading
Programmatic Navigation in Next.js with useRouter, redirect, and permanentRedirect

Programmatic Navigation in Next.js with useRouter, redirect, and permanentRedirect

Most navigation in a Next.js app happens through links: the user clicks, the URL changes, a new page renders. But plenty of navigation isn't triggere

Continue Reading
Building Custom 404 Pages with not-found.tsx in Next.js

Building Custom 404 Pages with not-found.tsx in Next.js

A 404 page is one of the most visited pages on a typical site, and one of the least designed. People land on it from old links, typos, deleted produc

Continue Reading
Custom Error Boundaries in Next.js with error.tsx and global-error.tsx

Custom Error Boundaries in Next.js with error.tsx and global-error.tsx

Every app eventually throws an error you didn't plan for. A database times out, an upstream API returns HTML instead of JSON, or someone ships a comp

Continue Reading
Using loading.tsx and Streaming UI for Instant Feedback in Next.js

Using loading.tsx and Streaming UI for Instant Feedback in Next.js

When a page depends on slow data, the worst thing it can do is nothing. The user clicks a link, the old page stays on screen, and for a second or two

Continue Reading
Templates vs Layouts in Next.js: When State Should Reset Between Navigations

Templates vs Layouts in Next.js: When State Should Reset Between Navigations

Layouts in the App Router are built to persist. Navigate between two pages that share a layout, and the layout stays mounted: its state, its DOM, and

Continue Reading
Nested Layouts in Next.js: Sharing UI Across Routes Without Re-rendering

Nested Layouts in Next.js: Sharing UI Across Routes Without Re-rendering

Most apps have UI that repeats across many pages: a top navigation bar, a sidebar inside the dashboard, a row of tabs inside settings. In a tradition

Continue Reading
Intercepting Routes in Next.js: Creating Modal Experiences the Right Way

Intercepting Routes in Next.js: Creating Modal Experiences the Right Way

Most modals are built with a piece of state: const [open, setOpen] = useState(false). That works until someone wants to share what's in the modal,

Continue Reading
Parallel Routes in Next.js: Building Dashboards with Independent Sections

Parallel Routes in Next.js: Building Dashboards with Independent Sections

A dashboard is rarely one thing. It's a revenue chart, a list of recent orders, an activity feed, and maybe a panel of alerts, each pulling from a di

Continue Reading
Route Groups in Next.js: Organizing Your App Without Changing URLs

Route Groups in Next.js: Organizing Your App Without Changing URLs

In the App Router, folders are URLs. app/dashboard/settings/page.tsx becomes /dashboard/settings, and every layout.tsx along the way wraps the

Continue Reading
Dynamic Routes in Next.js: Mastering [slug], Catch-All, and Optional Catch-All Segments

Dynamic Routes in Next.js: Mastering [slug], Catch-All, and Optional Catch-All Segments

Most real routes aren't known ahead of time. A blog has a page per post, a store has a page per product, and a docs site has pages nested three or fo

Continue Reading
Migrating a Next.js Project from the Pages Router to the App Router, Step by Step

Migrating a Next.js Project from the Pages Router to the App Router, Step by Step

Moving a real project from the Pages Router to the App Router is less scary than it looks, as long as you don't try to do it all at once. The app a

Continue Reading
App Router vs Pages Router in Next.js: Which One Should You Use in 2026?

App Router vs Pages Router in Next.js: Which One Should You Use in 2026?

Next.js ships with two routers. The Pages Router is the original one: a pages directory where every file is a route, data loaded through `getServer

Continue Reading
What is Next.js?

What is Next.js?

You stand at the precipice of building a modern web application. You have chosen React, a powerful library for crafting dynamic user interfaces. But

Continue Reading
Beyond the Basics: Unlocking the Full Power of Next.js Middleware

Beyond the Basics: Unlocking the Full Power of Next.js Middleware

Next.js Middleware is more than just a tool for routing and redirection—it's your gateway to building smarter, more responsive applications. If you'r

Continue Reading
How Do You Efficiently Manage API Routes in Large-Scale Next.js Applications?

How Do You Efficiently Manage API Routes in Large-Scale Next.js Applications?

As Next.js grows in popularity for building full-stack applications, efficiently managing [API routes](https://nextjs.org/

Continue Reading
Security Considerations When Building a Next.js Application and Mitigating Common Security Risks

Security Considerations When Building a Next.js Application and Mitigating Common Security Risks

Building secure web applications is crucial to protect both users and the application itself from various security threats.Next.js, a popular React f

Continue Reading
How to Integrate CSS and Sass in Next.js?

How to Integrate CSS and Sass in Next.js?

Next.js is a powerful React framework that provides built-in support for CSS and **Sass*

Continue Reading
How to Use TypeScript with Next.js and the Benefits of Using TypeScript?

How to Use TypeScript with Next.js and the Benefits of Using TypeScript?

TypeScript has gained significant popularity among developers due to its ability to catch errors at compil

Continue Reading
Managing Authentication in a Next.js Application: A Detailed Guide of NextAuth.js

Managing Authentication in a Next.js Application: A Detailed Guide of NextAuth.js

Authentication is a critical aspect of many web applications, ensuring that users can securely access their data and functionalities. In **[Next.

Continue Reading
Understanding Middleware in Next.js: Concept and Example

Understanding Middleware in Next.js: Concept and Example

Middleware is an integral part of web development that enables deve

Continue Reading
Understanding Server-Side Rendering (SSR) in Next.js

Understanding Server-Side Rendering (SSR) in Next.js

Server-Side Rendering (SSR) is a crucial feature in modern

Continue Reading
Understanding Internationalization (i18n) in Next.js

Understanding Internationalization (i18n) in Next.js

Internationalization, often abbreviated as i18n, is the process of designing and developing software applications that can be adapted to differen

Continue Reading
Integrating Next.js with Other Backend Technologies: Express, GraphQL, and Beyond

Integrating Next.js with Other Backend Technologies: Express, GraphQL, and Beyond

Next.js, a versatile React framework, is often used for building frontend applications. However, its flexibility extends beyon

Continue Reading
Exploring Advanced Data Fetching in Next.js

Exploring Advanced Data Fetching in Next.js

Data fetching is a critical aspect of web development, enabling applications

Continue Reading
Common Deployment Strategies for Next.js Applications

Common Deployment Strategies for Next.js Applications

Deploying a Next.js application involves several strategies tailored to various needs, from simple static sites to **dynamic s

Continue Reading
Understanding Static Site Generation (SSG) in Next.js and When to Use It

Understanding Static Site Generation (SSG) in Next.js and When to Use It

Static Site Generation (SSG) is a powerful feature pr

Continue Reading
How Does Next.js Handle Routing and What Are Its Advantages Over Client-Side Routing Libraries?

How Does Next.js Handle Routing and What Are Its Advantages Over Client-Side Routing Libraries?

Next.js is a popular React framework known for its robust features, including a powerful routing system. Routing is an

Continue Reading
The Benefits of Using Next.js for SEO

The Benefits of Using Next.js for SEO

Next.js, a React-based framework, offers powerful features that enhance web development efficiency and performance

Continue Reading
What is Next.js and how does it differ from React?

What is Next.js and how does it differ from React?

Next.js has emerged as one of the leading frameworks in the modern web development landscape, especially for React application

Continue Reading