Skip to content

feat: add District Rent Shark — English-first apartment hunting in Vietnam#85

Open
giaphutran12 wants to merge 8 commits intotinyfish-io:mainfrom
giaphutran12:feat-giaphutran12/district-rent-shark
Open

feat: add District Rent Shark — English-first apartment hunting in Vietnam#85
giaphutran12 wants to merge 8 commits intotinyfish-io:mainfrom
giaphutran12:feat-giaphutran12/district-rent-shark

Conversation

@giaphutran12
Copy link
Copy Markdown
Contributor

Summary

  • New cookbook app: District Rent Shark — English-first apartment hunting tool for Vietnam powered by TinyFish parallel browser agents
  • Scrapes Chợ Tốt + batdongsan.com.vn across HCMC, Hanoi, and Da Nang via SSE streaming
  • Includes trust scoring (owner/broker detection, price anomaly flagging), building rules extraction (pets, parking, curfew), neighborhood vibe scoring (Google Maps POIs), and interactive Mapbox map with color-coded pins

What's in district-rent-shark/

API Routes

  • /api/search — SSE endpoint with parallel TinyFish scraping across 2 platforms × 3 cities. Cache-aside with Supabase (6h TTL). Uses proxy_config: VN + browser_profile: stealth for geo-restricted Vietnamese RE sites.
  • /api/vibe — SSE endpoint scraping Google Maps for neighborhood POIs per district (coworking, gyms, nightlife, supermarkets, pharmacies). 48h cache TTL. 2s stagger between districts.

Vietnamese Data Normalization

  • Price parsing: "5.500.000 đ/tháng" → 5,500,000 VND, "5,5 triệu" → 5,500,000 (comma = decimal), "Thỏa thuận" → negotiable
  • District mapping: "Quận 2""Thu Duc" (2021 merger), diacritics stripping
  • Trust scoring: broker keyword detection, price anomaly flagging (<70% of district average)

UI

  • Multi-slot search (up to 4 parallel city searches) — matches viet-bike-scout architecture
  • Interactive Mapbox map with green/yellow/red pins by trust level
  • Neighborhood vibe cards with POI counts per district
  • Client-side filters: district, price range, bedrooms, bathrooms, sort
  • Live TinyFish browser agent iframes during search
  • Full graceful degradation — works with only TINYFISH_API_KEY

Graceful Degradation

Missing Behavior
NEXT_PUBLIC_MAPBOX_TOKEN Map hidden, list-only view
NEXT_PUBLIC_SUPABASE_URL / SUPABASE_SERVICE_ROLE_KEY Caching disabled, live scraping only
All optional vars App works fully — just no map and no caching

Testing

  • 47 vitest tests covering normalization (Vietnamese prices, areas, districts, trust scoring) and API route validation
  • Build, lint, and type-check all pass clean

Tech Stack

Next.js 16, React 19, TypeScript strict, Tailwind CSS 4, shadcn/ui, react-map-gl + Mapbox GL, Zod, Supabase, TinyFish SSE API, Vitest

Related PRs

giaphutran12 and others added 8 commits March 5, 2026 20:17
…cout

Add Vietnam Bike Price Scout cookbook example
…, Mapbox map, trust badges, and tests

- Next.js 16 app with multi-slot search across Cho Tot + batdongsan (3 cities)
- SSE API routes for listing search (/api/search) and vibe scoring (/api/vibe)
- Vietnamese data normalization (prices, areas, districts, trust scoring)
- Interactive Mapbox map with trust-colored pins (graceful degradation)
- Neighborhood vibe cards with Google Maps POI scraping
- Filter toolbar (district, price, bedrooms, bathrooms, sort)
- Supabase cache-aside with graceful degradation
- 47 vitest tests covering normalization, trust scoring, API validation
- README following CONTRIBUTING.md template
…l degradation

NEXT_PUBLIC_MAPBOX_TOKEN was in the server-side Zod schema alongside
Supabase vars. When Mapbox was missing, getEnv() threw, causing
tryGetSupabase() to return null — disabling caching even when Supabase
WAS configured. Mapbox is a client-side var checked directly in
listing-map.tsx, not a server-side dependency.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 17, 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: 6e97f841-13f4-4199-a347-751c45cc286b

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
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

You can customize the high-level summary generated by CodeRabbit.

Configure the reviews.high_level_summary_instructions setting to provide custom instructions for generating the high-level summary.

@giaphutran12
Copy link
Copy Markdown
Contributor Author

PR link: #85

Part of a 3-app contribution batch for Vietnamese market tools:

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.

1 participant