Install the dependencies.
Terminalnpm installCreate the local database. It applies every migration to a local copy of D1.
Terminalnpm run db:migrate:localAdd local secrets. Create
.dev.varsnext topackage.json..dev.varsEDIT_PASSCODE=choose-a-long-passcodeStart the app and open http://localhost:3000.
Terminalnpm run dev
Checks before a change
Terminal
npm run typecheck
npm run lint
npm run test
npm run buildLocal development
Terminal
npm install
cp .dev.vars.example .dev.vars
npm run db:migrate:local
npm run devSet a long random local ADMIN_TOKEN in .dev.vars. Do not commit .dev.vars.
The public directory remains usable when optional provider credentials are absent.
Validation
Terminal
npm run cf-typegen
npm run typecheck
npm run lint
npm test
npm run test:e2e
npm run test:responsive # run while the local server is available
npm run build
npx opennextjs-cloudflare build
npx wrangler deploy --dry-run --env=""