feat: add District Rent Shark — English-first apartment hunting in Vietnam#85
feat: add District Rent Shark — English-first apartment hunting in Vietnam#85giaphutran12 wants to merge 8 commits intotinyfish-io:mainfrom
Conversation
…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.
|
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)
📝 Coding Plan
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 Tip You can customize the high-level summary generated by CodeRabbit.Configure the |
|
PR link: #85 Part of a 3-app contribution batch for Vietnamese market tools:
|
Summary
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). Usesproxy_config: VN+browser_profile: stealthfor 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
"5.500.000 đ/tháng"→ 5,500,000 VND,"5,5 triệu"→ 5,500,000 (comma = decimal),"Thỏa thuận"→ negotiable"Quận 2"→"Thu Duc"(2021 merger), diacritics strippingUI
TINYFISH_API_KEYGraceful Degradation
NEXT_PUBLIC_MAPBOX_TOKENNEXT_PUBLIC_SUPABASE_URL/SUPABASE_SERVICE_ROLE_KEYTesting
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