Local dev
Emulator, seed, auth bypass, and verify scripts.
Quick start
npm run dev:setup
Runs in one terminal:
- Starts Firebase Realtime DB emulator (if not already running)
- Pulls prod sites into the emulator (
seed:pull -- -y --clone-all) - Starts Next.js dev server with Turbopack
Auth is bypassed locally. You'll auto-login as dev@nertia.local.
Manual setup
# Terminal 1: Firebase emulator
npm run emulator
# Terminal 2: Once emulator is ready
npm run seed:pull # or: npm run seed:pull -- -y --clone-all
# Terminal 3: Dev server
npm run dev
Test data
dev:setup runs npm run seed:pull -- -y --clone-all, which wipes the emulator and clones all production sites for the owner email (default ps2pdx@gmail.com; override with DEV_AUTH_EMAIL in .env.local).
Optional client recipe:
npm run seed:pull -- -y --recipes=bend-cleaning
Set DEV_AUTH_EMAIL to match the seed owner so auth bypass sees those sites.
Auth bypass
Recommended for day-to-day local work:
- Client:
NEXT_PUBLIC_DEV_BYPASS_AUTH=trueinjects mock user in auth context - Server:
DEV_BYPASS_AUTH=trueacceptsdev-bypassas a valid token in API routes - Email: Defaults to
dev@nertia.local; setDEV_AUTH_EMAILto match seed owner
npm run dev:setup exports emulator env vars automatically. With bypass on, app routes skip the login gate.
Auth emulator (optional)
When bypass is off, email/password sign-up uses the Auth emulator (port 9099) whenever the DB emulator is active. Google sign-in is not available on the emulator. Restart the emulator after pulling: npm run emulator now starts database + auth.
Emulator ports
| Service | Port |
|---|---|
| RTDB | 9000 |
| Auth | 9099 |
| Emulator UI | 4000 |
Inspect/edit the database at http://localhost:4000.
Verify scripts
npm run verify # typecheck + lint
npm test # Vitest
npm run test:e2e # Playwright
Quick reference
One shot: npm run dev:setup
Emulator: npm run emulator
Seed: npm run seed:pull -- -y --clone-all
Dev URL: http://localhost:3000
Auth: dev-bypass (local only)