Cloudflare setup
Create the production D1 database:
Terminal
npx wrangler login
npx wrangler d1 create website-catalog-dbCopy the returned database ID into wrangler.jsonc, replacing the all-zero placeholder. Then generate fresh binding types and apply the migration:
Terminal
npm run cf-typegen
npm run db:migrate:remoteDeploy the Next.js application to Cloudflare Workers:
Terminal
npm run deployDeploy from your machine
Important
The wrangler login sees several Cloudflare accounts. Set CLOUDFLARE_ACCOUNT_ID to the APPNEURAL account in your shell first, or Wrangler stops to ask.
Terminal
npm install
npm run db:migrate:remote
npm run deploySet the secrets once (they stay across deploys):
Terminal
npx wrangler secret put EDIT_PASSCODEDatabase migrations
Applied in order from migrations/:
| # | Migration |
|---|---|
| 0001 | create websites |
| 0002 | add website stage |
| 0003 | add provisioning status |
| 0004 | replace website catalog |
| 0005 | add website infrastructure |
| 0006 | remove public website subdomains |
| 0007 | enable catalog owned website routing |
| 0008 | add website priority |
| 0009 | add edit auth |
| 0010 | add checklist and documents |
| 0011 | add document uploads |
| 0012 | add checklist due date |
| 0013 | add project planning fields |
| 0014 | add document notes |
| 0015 | allow note document kind |
| 0016 | add assignee and subtasks |
| 0017 | add on hold dependency attachments comments |
| 0018 | upgrade task attachments to documents |
| 0019 | add missing checklist websites |
| 0020 | add website types |
| 0021 | product catalog websites are products |
Check that it is live
Terminal
curl https://websites.appneurox.com/healthIt answers {"status":"ok"} when the Worker and its database are up.