Skip to content

Migration viet-bike-scout to Tinyfish SDK #136

Open
KrishnaAgarwal7531 wants to merge 4 commits intotinyfish-io:mainfrom
KrishnaAgarwal7531:mig-viet-bike-scout
Open

Migration viet-bike-scout to Tinyfish SDK #136
KrishnaAgarwal7531 wants to merge 4 commits intotinyfish-io:mainfrom
KrishnaAgarwal7531:mig-viet-bike-scout

Conversation

@KrishnaAgarwal7531
Copy link
Copy Markdown
Contributor

@KrishnaAgarwal7531 KrishnaAgarwal7531 commented Apr 7, 2026

Migrates Viet Bike Scout from raw TinyFish HTTP calls to the official SDK and removes the Supabase caching layer that was added in the original build. The app now runs entirely in-memory — one API key, no external services to provision.
The app finds motorbike rental prices across Vietnam by firing parallel browser agents at 5–6 rental shop websites simultaneously per city, streaming results back as each shop completes. TinyFish handles cookie banners, dynamic loading, and VND→USD conversion automatically.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 7, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c322e88d-4451-4948-af58-6ed7c95c5440

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@simantak-dabhade simantak-dabhade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: changes requested (close to approval — docs-only fixes)

Best code-side migration in this batch. Build passes cleanly, tests-less-but-legit, and /api/search/route.ts is now the gold-standard SDK reference in the cookbook:

  • Typed EventType.STREAMING_URL / EventType.COMPLETE, RunStatus.COMPLETED check
  • client.agent.stream(...) with for await
  • Parallel execution via Promise.allSettled
  • Per-request client, explicit env check via getEnv() with a helpful 500 if the key is missing
  • Guards for both string and object event.result
  • maxDuration = 800 for long-running scrapes

Stack is also already on the target: Next 16.1.6, React 19.2.3, Tailwind 4 — matches what the repo-wide sweep is heading toward. Only 5 UI components, all actually used (no shadcn dump). Custom components are domain-named (bike-card, shop-group, etc.). Supabase, Redis, Mino — all gone from runtime.

The only things blocking approval are stale docs.

🔴 README still documents the old Supabase cache setup

  • Line 50 (Tech Stack table): | Caching | Supabase (Postgres) | 6-hour TTL, graceful degradation if unavailable | — delete the row (or replace with a note that it's in-memory per request).
  • Lines 69-70 (Environment Variables):
    NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
    SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
    
    Delete these. .env.example only has TINYFISH_API_KEY.
  • Line 115: "Results are cached in Supabase with a 6-hour TTL, keyed by (city, website). The cache toggle on the UI lets you choose between instant cached results and a fresh live scrape..." — entire paragraph describes gone functionality, should be rewritten or removed.

🔴 docs/ folder still describes the old architecture

Both docs describe a system that no longer exists. A future contributor reading these would be misled.

  • docs/use-case-brief.md (336 lines):
    • Line 78, 87: architecture diagrams showing Supabase (6h TTL) nodes
    • Line 240: const TINYFISH_SSE_URL = "https://agent.tinyfish.ai/v1/automation/run-sse"; — shows the old raw-HTTP pattern that the migration replaced
    • Lines 283, 291: "Optionally stream cached results instantly from Supabase" / "On COMPLETED: caches result to Supabase"
    • Line 319, 325-326: Tech stack bullets calling out Supabase caching + raw SSE URL
  • docs/PRD.md (171 lines):
    • Line 9: "Cache Check: The API route checks Supabase for cached results (6-hour TTL)..." — that flow no longer exists
    • Line 25: Same raw TINYFISH_SSE_URL reference

Either update both docs to match reality, or delete them and rely on a trimmed README. A design doc that misdescribes the system is worse than no design doc.

🟡 Nits (not blocking)

  • src/components/ui/switch.tsx:2 imports from @radix-ui/react-switch, but src/components/ui/button.tsx:2 imports from the radix-ui meta-package. Build works via transitive resolution, but the style is inconsistent — pick one. Since package.json declares radix-ui (meta), prefer that everywhere.
  • api/search/route.ts:111 tags every result source: "live" — leftover literal from the live/cached toggle era. Drop the field, or make it meaningful.
  • PR body empty — add a short description of what was migrated + testing notes.

✅ Summary

Code is approval-worthy. Please:

  1. Scrub README Supabase references (lines 50, 69-70, 115).
  2. Update or delete docs/use-case-brief.md + docs/PRD.md.
  3. Nits optional.

Once docs match reality, I'll run the local test pass and approve.

@KrishnaAgarwal7531 KrishnaAgarwal7531 changed the title Migration viet-bike-scout Migration viet-bike-scout to Tinyfish SDK Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants