migratetonextjs.com

FREE GUIDE / NEXT.JS ARCHITECTURE

Decide the runtime
before the rebuild.

Next.js can deliver static pages or server-powered applications. Those deployment modes do not support the same features.

Start with a route inventory

For each template, record who sees it, where its data comes from, how quickly changes must appear, and whether it reads request-time information. Public content, account pages and draft previews may need different treatment.

Static export

With output: 'export', Next.js creates HTML, CSS and JavaScript for a static host. Server Components can run during the build, but there is no Next.js server at request time. Enumerate dynamic routes with generateStaticParams in App Router, or getStaticPaths in Pages Router. Build again when content changes.

Do not plan around Server Actions, request-dependent route handlers, cookies, Draft Mode, ISR or next.config.js redirects in a static export. Default Next.js image optimization needs a server; use an appropriate custom loader or unoptimized images when exporting. Put redirect and header rules in the host configuration. Browser-side forms still need a separate receiving service.

A compatible server runtime

Choose server deployment when the application needs request-time rendering or server features. Check your host or adapter against the exact Next.js version and features you use. Do not assume Node.js, edge and third-party adapter capabilities are identical.

Cache and revalidation behavior depends on the APIs, configuration and framework version. Define freshness per data source and test the full CMS publish-to-live cycle, including failures. Do not copy older caching defaults into a new project without checking current documentation.

Server and client boundaries

In the App Router, pages and layouts are Server Components by default. Add 'use client' at focused interactive boundaries for state, events and browser APIs. Client Components can still be prerendered on the server: access window or document in an appropriate client lifecycle, not unconditionally during rendering.

Never send secrets to the browser. Treat server mutations as public entry points: validate inputs, authenticate and authorize every sensitive operation. A hidden button is not access control.

URLs and search

Next.js permanent redirects use 308, while temporary redirects use 307. Both preserve the request method. Match your migration map to real hosting behavior, including trailing slashes, query strings and encoded paths. On static hosting, the host owns these rules.

Keep staging noindex, but use authentication for confidential previews. Check production canonicals, robots, sitemap coverage, metadata and structured data after the actual deployment.

Official references

Use these decisions with your own team. If you want an implementation partner, Everbase can help scope the move.