Ship it

Deployment

It is a Next application and it exports to static files. That means almost anywhere, and it means one decision.

What you have

A standard Next application. npm run build produces the build, and because this edition is output: "export" that build is a folder of static files rather than a server. npm start serves that folder. Nothing in the theme constrains your hosting.

The one decision: static or server

Static exportNode server
Setoutput: "export"the default
Producesa folder of HTML and assetsa server you run
Host onany static host or CDNanywhere Node runs
Server componentsprerendered at buildrendered per request
Route handlersnot availableavailable
next startdoes not workhow you run it

⚠️ next start cannot serve a static export

If output: "export" is set there is no server to start, and Next refuses rather than serving anything. Put the exported folder behind a static host, or remove the setting.

Behind a path

Hosting at example.com/admin/ rather than a domain root needs basePath, and it needs it at build time only: setting it unconditionally also moves your dev server, so every local URL changes for no reason.

next.config.js
...(process.env.NODE_ENV === "production" ? { basePath: "/admin" } : {}),

Before you ship

  • npx tsc --noEmit is clean. The download ships a check-types script for it.
  • The dashboard renders with styling in the built output, not just in dev. An unstyled build means Tailwind is not scanning the components, and it fails with a green build and no error.
  • Dark mode survives a reload without a flash of the wrong theme.
  • Your API base URL is set for production. The demo screens do not call one; your screens will.