Migration wing-command to Tinyfish SDK #134
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
simantak-dabhade
left a comment
There was a problem hiding this comment.
Review: changes requested
Code migration is the cleanest pass I've seen from this batch — SDK usage is idiomatic (client.agent.stream with typed EventType / RunStatus), Supabase and Redis are fully gone from the runtime, .env.local is correctly not tracked, no shadcn UI dump. Nice work there.
Two things to fix before merge.
🔴 README is heavily out of date
The code removed Supabase + Redis + PostGIS + the Python cron scraper, but the README still documents all of it. A user following this README today would spend 30 minutes provisioning services they don't need and still not be able to run the recipe. Needs a full rewrite of the following sections:
- Architecture diagram (lines ~25-35) — currently shows
Supabase (PostgreSQL + PostGIS),Upstash Redis,lib/tinyfish-scraper.ts,lib/cache.ts. None of those exist. - Scraping Flow (line 60) — step 6 says "Cache in Redis (15-min TTL) + persist to Supabase". That path is gone; it's pure in-memory now.
- Prerequisites (line 67) — drop "Supabase project" and the Upstash Redis line.
- Environment Variables (lines 73-90) — instructs users to create
.env.localwithSUPABASE_SERVICE_ROLE_KEY,NEXT_PUBLIC_SUPABASE_URL,NEXT_PUBLIC_SUPABASE_ANON_KEY,UPSTASH_REDIS_REST_URL,UPSTASH_REDIS_REST_TOKEN, andTINYFISH_API_URL. The actual.env.exampleonly needsTINYFISH_API_KEY+GROQ_API_KEY. Match them, and have README saycp .env.example .env.localinstead of hand-authoring. - Database Setup (lines 92-107) — tells users to run
supabase/schema.sql. That directory doesn't exist anymore. Delete the whole section. - Render config (lines 137-161) —
render.yamlexample still listsNEXT_PUBLIC_SUPABASE_URL,NEXT_PUBLIC_SUPABASE_ANON_KEY,SUPABASE_SERVICE_ROLE_KEY,UPSTASH_REDIS_REST_URL,UPSTASH_REDIS_REST_TOKEN. Strip to justTINYFISH_API_KEY+GROQ_API_KEY. - Cron Job section (lines 166-172) — references
scraper/scrape_wings.pywhich doesn't exist. Delete. - Project Structure (lines 176-209) — lists
lib/tinyfish-scraper.ts,lib/supabase.ts,lib/cache.ts,lib/menu.ts,supabase/,scraper/. All gone. Also mentions/api/menu/route.ts— actual routes are/api/scout+/api/discover. - Tech Stack (lines 222-231) — drop
Database: Supabase (PostgreSQL + PostGIS)andCache: Upstash Redis. - Constraint Checklist (lines 211-220) — still relevant but re-verify claims since infra changed.
🔴 Regression: engines field dropped
On main, wing-command/package.json has:
"engines": { "node": "22.x" }This PR removes it. Please restore — it's one of only two recipes in the cookbook that pins Node, and the repo is moving toward standardizing on this.
🟡 Nits (not blocking)
- PR body is empty — add a short description of what was migrated.
- Next 14.2.35 — outdated vs the rest of the pack (most recipes are on Next 16). Will be handled by a separate repo-wide sweep, no action needed here.
✅ What's working well
/api/scout/route.tsis another solid SDK reference (alongside scholarship-finder's search route).lib/types.ts:3andlib/geocode.ts:3explicitly call out "No Supabase. No Redis. Pure in-memory." — good signal that the teardown was intentional..env.exampleformat with inline sign-up URLs.- No
.env.localleak this time. (Unlike #132.)
Push README rewrite + engines restore and we'll re-review.
simantak-dabhade
left a comment
There was a problem hiding this comment.
Good progress — all 3 asks from the last review are resolved. README rewritten, engines field restored, PR body filled in. Grep sweeps all clean.
Two remaining issues before we can merge:
1. Build fails — missing isPast on CountdownTime type
npm run build fails with:
./components/CommandJumbotron.tsx:50:19
Type error: Property 'isPast' does not exist on type 'CountdownTime'.
lib/types.ts:76 defines CountdownTime with days, hours, minutes, seconds but is missing isPast: boolean. Meanwhile lib/utils.ts:113,121 returns isPast in the object, and both CommandJumbotron.tsx:50 and utils.ts:126 read it.
Fix: add isPast: boolean to the CountdownTime interface in lib/types.ts.
2. Switch from Groq to OpenAI or Gemini
The recipe uses Groq (groq-sdk, GROQ_API_KEY) for LLM calls, but Groq is currently not opening up access for new accounts. This makes the recipe impossible to run for new users — violates clone-runnable.
Please switch the LLM integration to either OpenAI (openai package, OPENAI_API_KEY) or Google Gemini (@google/generative-ai, GEMINI_API_KEY). Update:
- The SDK import and client initialization
.env.example(swapGROQ_API_KEYfor the new key, with sign-up URL comment)README.mdenv vars section and prerequisitespackage.jsondependencies
Migrates Wing Command from raw TinyFish HTTP calls to the official SDK, and tears out the Supabase + Redis infrastructure that was never needed for this use case. The app now runs entirely in-memory — no database to provision, no cache to configure, just two API keys and you're running.
The app itself finds the best chicken wing spots near you by zip code. Pick a flavor persona, and it fires parallel browser agents at DoorDash, Uber Eats, Grubhub, and Google simultaneously, streaming results back as each source finishes rather than waiting for all of them.