feat: add fb-rent-filter tool#1
Open
pathors wants to merge 21 commits into
Open
Conversation
added 2 commits
March 14, 2026 16:40
Next.js 15 app that extracts structured rental info from FB posts using OpenAI gpt-4o via Vercel AI SDK. Features: - Paste FB rental posts → AI extracts price, location, size, room type, features, contact, etc. - Results displayed in sortable table (price/size), card layout on mobile - localStorage persistence across page refreshes - Export as CSV or JSON download - Share via URL (data encoded in query param) - Multi-post input (separated by blank lines)
- D1 database: fb-rent-filter-db (ae874d9d) - New API routes: POST /api/lists, GET/DELETE /api/lists/[id] - Shared list view: /list/[id] - Cloud save button on main page - wrangler.jsonc config - D1 migration: migrations/0001_init.sql - All routes set to edge runtime
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 28714994 | Triggered | Generic High Entropy Secret | 27bafa0 | tools/fb-rent-filter/.vercel/output/functions/index.rsc.prerender-config.json | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
added 19 commits
March 14, 2026 18:48
- Switch from @cloudflare/next-on-pages (Pages) to @opennextjs/cloudflare (Workers) - Update wrangler.jsonc: Worker main + assets binding - Add open-next.config.ts - API routes use nodejs runtime (nodejs_compat flag) - OPENAI_API_KEY stored as Worker secret (never reaches client) - Update scripts: worker:build, worker:dev, worker:deploy
- Add edgeExternals: ['node:crypto'] to open-next.config.ts - Migrate getRequestContext() -> getCloudflareContext() from @opennextjs/cloudflare - Remove @cloudflare/next-on-pages dependency
- Editorial design: Playfair Display + DM Sans fonts - Warm white bg (#FAFAF8), stone-900 buttons, no gradients - Feature tags → dot-separated text - Toast system replacing alert()/confirm() - Share URL fix: btoa(encodeURIComponent) / decodeURIComponent(atob) - Cloud save inline panel (no prompt()) - SVG logo (earthy accent) - AI model: gpt-4o → gpt-5-mini
- New endpoint: POST /api/lists/[id]/records (append records) - /list/[id] page is now interactive: has RentInput, appends to D1 list - Remove base64 URL sharing entirely — all sharing via D1 - ExportBar: onCloudSave is now optional (not shown on shared list page) - Main page: removed ?data= URL param handling
- D1 migration: add status, notes columns to records - New endpoint: PATCH /api/lists/[id]/records/[recordId] - Status: interested/contacted/visited/rejected with color badges - Click badge to cycle through statuses - Inline notes editing with auto-save - Filter bar: filter cards by status - Main page: localStorage sync - Shared list page: D1 sync on status/notes change
- D1 post_cache table: hash(post) -> structured_result, hit_count - analyze API: check cache first, skip OpenAI if hit - Auto-create D1 list on first analysis, redirect to /list/<uuid> - /list/<uuid>: record count / 30 limit, share button, editable name - Remove localStorage as primary storage
- manifest.json (MV3), content.js, popup.html/js - Auto-scrapes FB group posts, AI analyzes, saves to D1 list - Filter by max price and district - Auto-scroll to load more posts - Progress tracking in popup - icons (16/48/128px) - PUBLISHING.md with local testing + Chrome Web Store guide
- notes: z.string().nullable() (was optional().nullable() which creates invalid anyOf schema) - omit status and notes from generateObject schema, add defaults manually - OpenAI structured output rejects anyOf+not patterns from Zod optional/nullable combo
- Shimmer skeleton for list page (navbar, header, cards, count bar) - Skeleton textarea + button on main page while creating list - Dot pulse animation on analyze button (replaces spinner icon) - dotPulse + shimmer keyframes in globals.css
- D1 rate_limits table (migration 0004) - lib/rateLimit.ts: per-minute window, D1 upsert counter - /api/analyze: max 5/min per IP → 429 with Retry-After header - /api/lists POST: max 20/min per IP - CF-Connecting-IP header for real IP (Cloudflare edge) - Fails open on D1 error (don't block legit traffic) - Auto-cleanup of 2h+ old windows
PWA:
- public/manifest.json (share_target, shortcuts, icons)
- public/sw.js (network-first, cache homepage)
- public/icons/pwa-{192,512}.png
- components/RegisterSW.tsx (client-side SW registration)
- app/layout.tsx: manifest meta, apple-web-app, viewport, themeColor
Install prompt:
- components/PWAInstallToast.tsx
- Shows on /list/[id] page (2s delay, once)
- Chrome/Android: native beforeinstallprompt + install button
- iOS: shows share → add to home screen instructions
- Dismissed state in localStorage
New fields:
- subsidyEligible (可租補), parking — schema + D1 + API + card UI
- migrations/0005_subsidy.sql
Map overview:
- app/list/[id]/map/page.tsx — Leaflet CDN + Nominatim geocoding
- Navbar map button on list page
- Brand: FB 租屋過濾器 → 租多好室 (layout, manifest, pages, navbar) - Map: explicit height calc(100vh-100px), invalidateSize(), tile URL fix - PWA icons: house silhouette SVG → sharp rendered PNG (192/512) - logo.svg: house design - iOS PWA: navigator.standalone check in install toast
- Mobile-only bottom tab bar: 首頁/新增/地圖/分享 - Homepage: ← 返回清單 when navigated from list page - List page content: bottom padding calc(80px + safe-area) for tab bar - Mobile navbar: map button hidden (moved to tab bar) - Delete button: opacity 1 on mobile (no hover needed) - Scroll-to-top FAB: appears after 300px scroll, above tab bar
… banner - Homepage: OpenListInput - paste URL/UUID to navigate to list in PWA - Homepage: Share Target handler - auto-redirect when friend shares list URL to PWA - Lucide icons: tab bar, PWAInstallToast, RecentLists, RentTable (Car/MapPin) - BrowserOpenBanner: orange banner when viewing in browser (not PWA)
…dling - Inline full Leaflet CSS to avoid CDN timing issue (tiles not showing) - Map container uses flex:1 instead of calc(100vh - Xpx) - main uses height:100dvh + flexDirection:column + overflow:hidden - requestAnimationFrame + setTimeout before map init - mapInitRef to prevent double-init in StrictMode - fitBounds after all markers added - Better error handling + catch block
- Remove sticky navbar from homepage - Logo (56px) + app name centered at top - Clean tagline, no noise - Input as main CTA, maxWidth 640, centered - Below-fold: open friend list + recent lists - hint text centered below input
- Status bar: ⏳→Loader2(spinning), 📍→MapPin (Lucide) - Bottom nav bar: ChevronLeft/ChevronRight buttons - Click next/prev: map.setView(coords, zoom=16) + marker.openPopup() - First open: ➡ button highlighted orange to hint interaction - Shows current listing: price, title, N/M counter - Markers collected into state array for navigation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fb-rent-filter 🏠
把 FB 租屋貼文丟進去,AI 幫你洗出結構化資料。
功能
generateObject):啟動
之後可加