Prerequisites
- Node.js (LTS)
- npm
- wrangler CLI (installed as a devDependency)
All commands run from the apps/gpn-yp-site-worker/ directory.
npm scripts
Development server
npm run dev
Starts the Remix Vite dev server with hot module replacement. The site is available at http://localhost:5173. Changes to routes, components, and styles reload instantly.
The dev server runs Remix loaders locally. D1 queries work against a local SQLite database managed by wrangler (.wrangler/state/).
Production build
npm run build
Runs remix vite:build, which produces:
build/client/— static assets (JS, CSS, images) with content hashes for cache bustingbuild/server/index.js— the server bundle that runs on the Cloudflare Worker
Preview the production build
npm run preview
Runs wrangler pages dev build/client, which serves the production build locally using the wrangler Pages runtime. This simulates the Cloudflare Worker environment including D1, AI, and Vectorize bindings.
Use preview to verify that the production build works before deploying.
Type checking
npm run typecheck
Runs tsc --noEmit to check for TypeScript errors without producing output files. This catches type errors in routes, components, and loaders.
Full validation
npm run validate
Runs typecheck. Use this as a quick pre-commit check.
Test suite
npm run test
Runs typecheck followed by the regression test suite (test/front-end-regressions.ts). The regression tests verify that core routes and components render correctly.
Smoke check
npm run smoke-check
Runs a remote sanity check against the deployed worker to verify it responds correctly.
Database provisioning
npm run db:provision # Create and seed the gpn-user-d1 tables
npm run db:migrate # Run pending migrations
npm run db:backfill:listings # Backfill business listings from source data
These scripts set up the local D1 database with schema and seed data so the search page returns results during development.
Typical workflow
npm run db:provision— set up local database (first time only)npm run dev— start the dev server- Edit routes in
app/routes/and components inapp/components/ npm run typecheck— verify types before committingnpm run build— verify the production build succeedsnpm run preview— test the production build locally