Next.js edition
Vercel or Netlify
Push the project to a Git repository and import it. Both detect Next.js and need no extra settings. Add your API's environment variables (for example API_URL) in the project settings.
Your own server
npm run build
npm run start # serves on port 3000; set PORT to change itRun it behind your usual reverse proxy, with Node 20.9 or newer.
Any static host, including Cloudflare
If your screens fetch data in the browser or you don't need server rendering, export a static site:
STATIC_EXPORT=1 npm run build # writes a static site to out/Upload out/ to Cloudflare, Netlify, S3, GitHub Pages or any static host. To serve it from a sub-path such as /console, add BASE_PATH=/console to the same command. The live demos on this site are built this way.
React + Vite edition
npm run build writes a static single-page app to dist/, so it runs on any static host. The host must send every unknown path to index.html, so deep links like /traces/tr_8f2a91 load the app instead of a 404:
- Vercel:
vercel.jsonin the project already does it. - Netlify and Cloudflare:
public/_redirectsalready does it. - nginx: add
try_files $uri /index.html;to the location block.
To serve the app from a sub-path such as /console/, build with BASE_PATH=/console/ npm run build.
Environment variables that start with VITE_ are baked into the build and visible to anyone, so use them only for public values such as your API's URL.
Before you go live
- Replace the sample data on every screen people will see, or hide the screens you haven't connected.
- Change the favicon, product name and sample user.
- Add authentication in front of the console. The sign-in screens are UI only.
- Remove the
/designpage from navigation if you don't want customers to see it.