Appearance

Visual style

Mode
Theme
Accent
Advanced
Text sizeScales the whole site
16 px
Reduce motionReduce animations or match your system
Separate light and darkChoose a theme, accent and font for each
50

Technology · Frontend

Next.js development

Next.js is a React framework maintained by Vercel. According to its documentation, it adds file-system routing, React Server Components, server-side and static rendering, data fetching and caching, image and font optimisation, and a metadata API on top of React.

In practice

How I use Next.js

Next.js is the framework behind most of the applications I work on: the Ekonavi marketplace and its seller dashboard, the AutoViz marketing site, the Minar Cruise booking platform, and the storefront of a creator commerce platform. Several of these run on Cloudflare Workers through the OpenNext adapter rather than on Vercel.

How I structure a Next.js application

Most of my Next.js work follows the same shape, regardless of where it’s deployed:

  • Route groups per audience. Public, authenticated and admin areas live in separate route groups with their own layouts, so auth checks and navigation don’t leak between them. The creator commerce storefront, for example, separates (user) and (admin) route groups.
  • Server Components by default. Pages and layouts fetch data on the server. Client Components are reserved for things that need browser state: forms, filters, carts, animation.
  • A typed data layer, not fetch calls in components. Data access goes through a small module (or TanStack Query hooks on the client), so components never know whether data came from GraphQL, REST or a cache.
  • Validation at the edges. Form input and API responses are parsed with Zod before they reach business logic.

Rendering strategy, per route

The App Router lets each route choose how it renders. I decide per route, not per project:

Route typeStrategyWhy
Marketing, docs, case studiesStatic (build time)Same HTML for everyone; cheapest and fastest to serve
Catalogue and listing pagesStatic with periodic revalidationContent changes, but not per request
Dashboards, carts, account pagesRequest-time rendering or client fetchingDepends on the signed-in user

Illustrative example: metadata per route

A pattern I use so every data-driven page has unique, explicit metadata. This is a simplified illustration, not code from a client project.

// app/products/[slug]/page.tsx
import type { Metadata } from "next";
import { notFound } from "next/navigation";
import { getProduct } from "@/lib/catalog";

export async function generateMetadata({ params }: { params: Promise<{ slug: string }> }): Promise<Metadata> {
  const product = await getProduct((await params).slug);
  if (!product) return {};
  return {
    title: product.name,
    description: product.summary,
    alternates: { canonical: `/products/${product.slug}` },
    openGraph: { images: [product.image] },
  };
}

export default async function ProductPage({ params }: { params: Promise<{ slug: string }> }) {
  const product = await getProduct((await params).slug);
  if (!product) notFound(); // real 404 status, not an empty page
  return <ProductView product={product} />;
}

Deploying to Cloudflare Workers

Running Next.js on Workers via OpenNext puts the application on Cloudflare’s network next to the APIs it calls, which on Ekonavi are also Workers. The trade-off is that you are a step removed from the platform Next.js is primarily developed against, so I keep an end-to-end test suite running against the deployed build rather than trusting local next dev behaviour.

Trade-offs

Where Next.js shines, and where it doesn't

Strengths

  • One framework covers marketing pages, authenticated dashboards and API routes, so a product doesn't need two stacks.
  • Server Components keep data fetching and secrets on the server and ship less JavaScript to the browser.
  • Per-route choice between static generation and request-time rendering.
  • Large ecosystem; almost every SaaS SDK ships a Next.js integration first.

Limitations

  • Caching behaviour has changed between major versions; upgrades need deliberate testing.
  • Some features assume Vercel's infrastructure. Self-hosting or running on Workers needs an adapter such as OpenNext and attention to which APIs the runtime supports.
  • For content-only sites it is heavier than necessary; a static-first framework like Astro ships less JavaScript by default.

Evidence

Projects using Next.js

All work →

Sources

Official documentation

General descriptions on this page are based on the official documentation linked below. Experience notes are my own.

FAQ

Next.js questions

When should a business choose Next.js over a simpler static site?

When the site behaves like an application: logged-in users, dashboards, carts, per-user data or frequent updates from an API. For a brochure or editorial site with mostly static content, Astro or a plain static build is usually faster to load and cheaper to run.

Can Next.js run somewhere other than Vercel?

Yes. I deploy Next.js applications to Cloudflare Workers using the OpenNext adapter. It works well, but you have to check that the Next.js features you rely on are supported by the adapter and the Workers runtime, and test caching behaviour on the target platform.

Is Next.js good for SEO?

It can be, because pages can be rendered on the server or at build time so content is in the initial HTML, and the Metadata API makes titles, canonicals and Open Graph tags explicit per route. SEO still depends on content, internal linking and performance, which the framework doesn't solve for you.

What is the App Router in Next.js?

The App Router is Next.js's routing system based on the app/ directory. Folders define routes, layout files wrap nested pages, and components are React Server Components by default, with loading, error and not-found states as files. It replaced the older pages/ router as the recommended approach.

What is OpenNext?

OpenNext is an open-source adapter that builds a Next.js application for platforms other than Vercel, including Cloudflare Workers and AWS. It translates Next.js build output into that platform's runtime. I use its Cloudflare adapter to deploy Next.js apps to Workers.

Need a Next.js developer?

If your project needs Next.js, send a short description of what you're building and where it's stuck. I'll reply with how I'd approach it.