This guide is the quickest way to get a local Phuzzle environment running, verify your toolchain, and debug the common issues that show up while developing the app.
- Node.js
22+ - npm, which ships with Node.js
- Git
- Optional: Docker Desktop if you want local Supabase workflows
- Optional: GitHub CLI (
gh) if you work on GitHub issues, PRs, or Actions
The required Node version is declared in package.json:
"engines": {
"node": ">=22.0.0"
}Check your version:
node -v
npm -v
git --versionUse one of these setup paths. A version manager is preferred because it keeps this project isolated from other Node projects on your machine.
macOS/Linux:
nvm install 22
nvm use 22
nvm alias default 22Then confirm:
node -v
npm -vmacOS/Linux/Windows:
fnm install 22
fnm use 22Then confirm:
node -v
npm -vInstall Node.js 22+ from the official Node.js installer for your operating
system. After installation, open a new terminal and run:
node -v
npm -vIf your terminal still shows an older version, restart the terminal and check whether another version manager is overriding your PATH.
git clone https://github.com/NickTheDevOpsGuy/phuzzle.git
cd phuzzle
npm install
npm run test:e2e:install
npm run doctorWhat each step does:
npm installinstalls app dependencies and local hooks.npm run test:e2e:installdownloads the browser binaries used by the e2e suite.npm run doctorchecks Node, dependencies, Playwright availability, Supabase/Docker reachability, and whether preview port4173is already in use.
Most frontend development works without local secrets. If you need Supabase, copy the example file and fill in the values for your project:
cp .env.example .env.localDo not commit .env.local or any secret-bearing env file.
Start the app:
npm run devOpen the local site shown by Vite, usually http://127.0.0.1:5173/.
npm run dev intentionally runs lint and build before starting Vite. If that
feels slow while iterating, fix the reported issue first; the dev command is
meant to keep the local loop close to the production gate.
Useful local commands:
npm run lint
npm run typecheck
npm run test
npm run build
npm run previewWhat they do:
| Command | Purpose |
|---|---|
npm run lint |
ESLint for TypeScript and React files. |
npm run typecheck |
TypeScript validation without emitting files. |
npm run test |
Vitest unit/component tests. |
npm run build |
Production TypeScript + Vite build. |
npm run preview |
Serve the production build locally. |
npm run precheck |
Local pre-push style gate. |
If you are working on performance, layout, or input behavior, run Firefox explicitly:
npx playwright test src/app/screens/Play/PlayScreen.e2e.spec.ts --project=firefox --workers=1
npx playwright test src/app/accessibility.e2e.spec.ts --project=firefox --workers=1Notes:
- Use
--workers=1when debugging viewport or animation issues so results are easier to read. - If Playwright says a browser executable is missing, rerun
npx playwright install firefox. - If the preview server fails because port
4173is already in use, stop the old preview process or runnpm run doctorto confirm what is occupying it.
The standard matrix already covers the popular desktop browsers:
npm run test:e2e:smoke
npm run test:e2e:layouts
npm run test:e2eNotes:
test:e2e:smokecovers Chrome, Firefox, Safari/WebKit, and Edge-compatible Chromium.test:e2e:layoutscovers iPhone WebKit, iPad WebKit, and Android tablet Chromium.- The smoke and full matrix scripts now auto-detect a local Microsoft Edge install and set
PW_USE_EDGE=1for you when Edge is available. - If Edge is not installed, the
edgeproject still runs with Edge-compatible Chromium coverage instead of failing.
For touch-first Safari and tablet coverage, run the responsive projects explicitly:
npx playwright test src/app/responsive.responsive.e2e.spec.ts --project=safari-iphone-responsive --workers=1
npx playwright test src/app/responsive.responsive.e2e.spec.ts --project=safari-ipad-responsive --workers=1
npx playwright test src/app/responsive.responsive.e2e.spec.ts --project=chrome-android-tablet-responsive --workers=1Run this before pushing:
npm run precheckIf you want the shorter manual version:
npm run lint
npm run typecheck
npm run test
npm run build
npm run test:e2e:smoke
npm run test:e2e:layoutsCI builds once, then reuses dist for bundle size, Playwright, and Lighthouse checks. You can use the same shortcuts locally after npm run build:
CHECK_BUNDLE_USE_EXISTING_DIST=1 npm run check:bundle
PW_USE_EXISTING_BUILD=1 npm run test:e2e:smoke
PW_USE_EXISTING_BUILD=1 npm run test:e2e:layoutsThe bundle check compares against the target branch when BASELINE_REF is set, with
a small default gzip allowance for normal build drift. Override it with
BUNDLE_TOLERANCE_KB=0 for an exact comparison.
If you need leaderboards, co-op, or database work:
- Read SUPABASE_SETUP.md
- Use the
supabase:push:*scripts frompackage.jsononce your env vars are configured
If npm install, npm run doctor, or npm run build reports a Node engine
problem, switch to Node 22+:
nvm install 22
nvm use 22Then reinstall dependencies:
npm installnpm run test:e2e:installThe e2e config uses preview on port 4173. If that port is already busy, close
the old preview process and rerun the test command.
If package installation behaves strangely after switching Node versions:
rm -rf node_modules
npm installAvoid deleting package-lock.json unless you intentionally want to update the
dependency graph.
Use the Firefox project commands above. The app includes a lighter Firefox performance profile now, but long-running dev tools, traces, and repeated e2e runs can still warm up a laptop during investigation.
The smoke and matrix scripts will opt into real Edge automatically when the browser is installed locally. If you want to force it manually, run:
PW_USE_EDGE=1 npx playwright test --project=edge- README.md for project overview
- README.md for the docs index
- MOBILE_QA.md for mobile and viewport regression coverage
- RELEASE_AUDIT.md for recent cross-browser QA notes