Rasoi Planner is a shared kitchen workflow app for Indian households. It helps an Owner plan meals and manage pantry inventory, while a Cook updates stock status in real time (including AI-assisted pantry updates).
- Household Owner: plans meals, manages pantry, invites/removes cook access, verifies anomalies.
- Household Cook: checks daily menu, marks inventory as low/out/in-stock, adds quantity notes, uses AI assistant.
- Contributor: develops features, fixes bugs, updates rules/tests.
- QA / Reviewer: validates role behavior, security rules, and end-to-end journeys.
| Role | Must Validate |
|---|---|
| Product reviewer | Owner and Cook flows are understandable and usable on local app UI |
| QA / E2E reviewer | npm run e2e scenarios pass and test/e2e/artifacts/summary.json reports overallPass: true |
| Security reviewer | npm run rules:test passes Firestore access-control constraints |
| Contributor (before merge) | npm run verify:local passes (lint, build, rules tests, E2E) |
- Frontend: React 19 + Vite + Tailwind
- Backend endpoint: Vercel serverless function at
POST /api/ai/parse - Data/Auth: Firebase Auth (Google) + Firestore
- AI: Gemini model via
@google/genai - Tests:
- Firestore rules tests via Firebase Emulator
- Browser E2E via Puppeteer + local mocks
Install these before local setup:
- Node.js
18+(LTS recommended) - npm (comes with Node.js)
- Java
17+(required by Firestore Emulator used inrules:test) - A Chromium/Chrome browser (for local sign-in popup and E2E)
No global Firebase CLI install is required because firebase-tools is in project devDependencies.
- Install dependencies:
npm install- Create local env file from example:
cp .env.example .env.local-
Set
GEMINI_API_KEYin.env.local. -
Start the app:
npm run devApp runs at http://0.0.0.0:3000 (or http://localhost:3000).
Before validating sign-in flows, confirm in Firebase Console:
- Authentication -> Sign-in method -> Google is enabled.
- Authentication -> Settings -> Authorized domains includes
localhostand127.0.0.1(if you use that host). - Google popup sign-in works in local browser.
- Owner can invite/remove cook.
- Invited cook gets access.
- Removed cook loses access immediately.
All scripts below are defined in package.json.
- Start dev server:
npm run dev- Start E2E-focused dev server config:
npm run dev:e2e- Type-check:
npm run lint- Production build:
npm run build- Preview build output:
npm run preview- Clean build output:
npm run clean- Firestore rules tests (emulator-backed):
npm run rules:test- End-to-end tests:
npm run e2e- Full local verification before release:
npm run verify:localhouseholds/{householdId}households/{householdId}/inventory/{itemId}households/{householdId}/meals/{YYYY-MM-DD}households/{householdId}/logs/{logId}
Owner permissions:
- create/update/delete inventory
- create/update meals
- invite or remove cook (
cookEmail) - read all household data
Cook permissions:
- read household, inventory, meals, logs
- update inventory status and request quantities
- cannot modify meals or delete inventory
These constraints are enforced in firestore.rules and validated by test/rules/run.ts.
POST /api/ai/parse
{
"input": "tamatar khatam ho gaya",
"inventory": [{ "id": "9", "name": "Tomatoes", "nameHi": "टमाटर" }],
"lang": "hi"
}{
"understood": true,
"message": "optional",
"updates": [{ "itemId": "9", "newStatus": "out", "requestedQuantity": "1kg" }],
"unlistedItems": [{ "name": "Dhania", "status": "low", "category": "Veggies", "requestedQuantity": "2 bunch" }]
}- Invalid request body: HTTP
400 - Missing
GEMINI_API_KEY: HTTP503 - AI/runtime failures: HTTP
500with safe fallback message - Client uses safe fallback message if response parsing/validation fails
- Firestore rules tests entry:
test/rules/run.ts - E2E runner:
test/e2e/run.mjs - E2E mock server config:
test/e2e/vite.e2e.config.ts - E2E summary output:
test/e2e/artifacts/summary.json
- Ensure rewrites in
vercel.jsonare preserved:/api/*->/api/*and/*->/index.html. - Set
GEMINI_API_KEYin Vercel project environment variables.
- Firestore security rules source:
firestore.rules - Local emulator config:
firebase.json - App uses Firestore named database:
ai-studio-3900af62-0bf5-496a-a136-d1c8a0c4b8bd - Confirm production Firebase Auth domain setup before release (Google provider and authorized domains)
- Mainline path (default):
- Merge to
main; CI deploysfirestore.rulesautomatically when Firestore files change.
- Merge to
- CI deploy preconditions:
verify-localmust pass.npm run rules:target:checkmust pass (project/database target integrity gate).
- Post-deploy smoke checks:
- Owner smoke user must read
households/{householdId}/unknownIngredientQueue. - Non-member smoke user must receive
PERMISSION_DENIED.
- Owner smoke user must read
- Emergency/manual deploy only:
npm run rules:deploy:prodnpm run rules:smoke:prod
- Optional deploy diagnostics:
npm run rules:deploy:prod:dry
This project uses GitHub as the deployment source of truth.
- Create a feature branch from
main. - Commit and push branch changes.
- Open a pull request.
- Wait for CI check
verify-localto pass. - Merge PR into
main. - Vercel auto-deploys merged
maincommit to production.
- Workflow file:
.github/workflows/ci.yml - Triggers:
- every pull request
- every push to
main
- Required check name for branch protection:
verify-local - CI command chain:
npm cinpm run verify:coreverify-coreincludesnpm run rules:target:check
mainpush additional automation:- Detect Firestore-related file changes.
- Deploy Firestore rules automatically when changed.
- Run production smoke test for owner-allow and non-member-deny unknown queue reads.
- E2E is executed as a separate non-blocking CI job (
e2e) to avoid blocking production rules deploy on browser flakiness.
- Husky install hook is configured via
npm run prepare. - Pre-push hook path:
.husky/pre-push - Pre-push command:
npm run verify:local - If checks fail, push is blocked.
- Require pull request before merging.
- Require status checks to pass before merging.
- Add required status check:
verify-local. - Require branches to be up to date before merging.
- Add repository secrets for Firestore deploy/smoke workflow:
FIREBASE_TOKENSMOKE_OWNER_EMAILSMOKE_OWNER_PASSWORDSMOKE_OWNER_HOUSEHOLD_IDSMOKE_NON_MEMBER_EMAILSMOKE_NON_MEMBER_PASSWORD
- Git repository connected to this GitHub repo.
- Production branch set to
main. - Preview deployments enabled for pull requests.
GEMINI_API_KEYconfigured for Preview and Production environments.
- Open Vercel dashboard.
- Find the last known-good production deployment.
- Redeploy that deployment to production.
- Set
GEMINI_API_KEYin.env.local(local) or Vercel environment settings (deploy).
- Install Java 17+ and confirm
java -versionresolves correctly in shell.
- Confirm the visible build id is the latest deployment.
- Validate CI Firestore deploy and smoke test status on latest
mainrun. - For emergency recovery, deploy + smoke manually:
npm run rules:deploy:prodnpm run rules:smoke:prod
- Add
localhost/127.0.0.1to Firebase Auth authorized domains. - Ensure browser popup blocking is disabled for local app.
- Install Chrome/Chromium, or set
PUPPETEER_EXECUTABLE_PATHto a valid browser binary.
- Check browser network call to
/api/ai/parse. - Confirm request has
input,inventory, andlang. - Confirm response passes schema validation (
understood,updates,unlistedItems).