This is a NextJS starter in Firebase Studio.
To get started, take a look at src/app/page.tsx.
JOKEHUB_JARVIS_USER_ID— Firebase UID that jokes added viaPOST /api/jokes/addare attributed to. Required; the endpoint returns a 500 if unset.
The local firestore.rules and firestore.indexes.json are the source of truth. Two ways to push them:
npm run migrations— migration003-deploy-firestore-rules-and-indexesdeploys both, using the samefirebase-admin-credentials.jsonas every other migration. Runs once; for a later rules change, add a new004-...tsmigration.npm run firestore:push— ad-hoc deploy (ornpm run firestore:push -- --checkfor a read-only diff of local vs deployed). Credentials come fromFIREBASE_PROJECT_ID/FIREBASE_CLIENT_EMAIL/FIREBASE_PRIVATE_KEY(env or.env, same shape assrc/lib/admin.ts) or fall back tofirebase-admin-credentials.json.
Both are idempotent: in-sync rules are left untouched (and any push is verified by re-fetching the deployed ruleset), existing indexes are skipped. Index builds are async — dependent queries start working once each index leaves the BUILDING state in the Firebase console.