For developers

8. Testing and deploying

From the THINQ Site developer guide, in the guide's own words. The same text ships with every site's core.

8.1 Seeing your work in the admin

  1. Run the dev server (§1.2) and sign in at /admin.
  2. Appearance → Theme: pick your theme, set its options. Settings → Brand color if the site uses one.
  3. Appearance → Menus: build the header and footer menus your header and footer render.
  4. Pages → open or create a page → Add block. Your blocks are listed under their category.
  5. Fill in the fields, Save draft, and preview.

8.2 Preview

  • /preview/<slug> shows a page as saved, drafts included, for a signed-in admin. It renders on every request (so it always reflects the last save), shows a banner, and is never indexed. The page editor's Preview opens it.
  • Links inside preview stay in preview, so you can click through the whole site as saved, unpublished pages included. Preview site ↗ in the admin sidebar opens it at the home page. Routes that are not CMS pages (the blog, your own routes) open their public version.
  • /preview/post/<slug> does the same for blog posts.

The public pages are cached and only change when content is saved, so after editing code, reload; after editing content, the public page updates on its next request.

8.3 The block catalogue

/admin/blocks lists every block on the site, core's and yours, each previewed with its sample content, with its description and its editable fields. Use it to check every block at once after a theme change, and to show an editor what's available.

8.4 The production build

The dev server is forgiving; the host's build is not. Before you merge, build exactly what the host builds:

node core/scripts/assemble.mjs --site . --out /tmp/encore-build
cd /tmp/encore-build
npm ci
MYPRESS_ADMIN_PASSWORD=local-test-only npm run build
npm test
  • npm run build type-checks everything and builds every page. A type error anywhere in your code fails it.

  • npm test runs core's tests against your assembled site, including the rich-text check on your blocks (Blocks §4.3). TODO lines that name your blocks are bugs to fix.

  • To run it the way it runs on the host, start it and open it:

    MYPRESS_ADMIN_PASSWORD=local-test-only MYPRESS_CONTENT_ROOT=/tmp/encore-content npx next start -p 3400
    

What the build does not catch: content that doesn't match a schema. A seed page whose content fails validation is left out of the build with a log line ([mypress] invalid page <slug>: <field>: <problem>), and the build still succeeds. On a live site the same page returns 404. Search the build output for invalid page after a schema change. (Making this fail the build is on the open list.)

8.5 How it deploys

  1. You push a branch and open a pull request.
  2. It is reviewed and merged into main.
  3. The host (Render, for Encore) sees the push, clones the repo with core/, runs the one Dockerfile every site shares (assemble, npm ci, npm run build), and starts it. Staging is updated a few minutes after the merge.
  4. If the build fails, the host keeps serving the previous version. Ask Bo for the build log if staging doesn't update.

Staging is hidden from search engines until launch, and has its own admin (ask Bo for an account). Its content is separate from your local content (§1.4).

8.6 How core updates reach your site

Every change to core runs the cascade. Since 2026-10-23 it runs in two rings: THINQ's own two sites take a core change the moment it lands, and client sites — yours — take it from the daily run once it has been live on those two for 24 hours. So a core change normally reaches your staging site one to two days after it is merged; a security fix is sent to every site the same day. For your site the cascade:

  1. clones your repo's main,
  2. moves core/ to the new core commit,
  3. assembles, runs npm ci, npm run build and npm test,
  4. runs the drift check (§2.4),
  5. boots the production server and checks /health, / and /admin/login,
  6. and only if all of that passes, pushes a Core → <sha> commit to main, which deploys.

So your site only gets core updates while it builds and passes on the new core. If your code stops type-checking against a core change, the cascade stops pushing to your site (nothing breaks on staging; it just stops getting updates) and Bo gets a failure report. Example: core changed SiteNav's class callbacks to receive the menu item instead of a string on 2026-10-06; a header still typed against the old form failed the type check, and the site received no core updates from 2026-10-17 until it was fixed on 2026-10-20.

To keep it flowing:

  • Build on the assembled tree before merging (§8.4).
  • Pull main (and git submodule update --init) before starting work, so you build against the core you'll deploy with.
  • Use core's exported types (Site, NavItem, your schema's z.infer type) rather than your own copies of them. Then a core change shows up as a type error on your machine, not as a stalled cascade.

8.7 Before launch

The parts that are yours:

  • Every page checked in /preview at phone, tablet and desktop widths
  • Mobile menu works, dropdowns reachable by touch and keyboard
  • Every image has real alt text; large images have sizes
  • Text contrast checked on every background colour
  • Rich-text fields render formatting (no literal <p>)
  • npm run build and npm test pass on the assembled tree, no invalid page lines
  • Vendor widgets tested on the final addresses (see Embeds §7.3)
  • Anything editors will change is editable in the admin, not hard-coded

Bo handles the domain, redirects from the old site's URLs, search-engine visibility, form notification emails and backups.

This text is maintained in thinq-site-core at docs/developers/08-testing-and-deploying.md (commit e72488e) and published here unchanged.