Build with AI
Prompt: search page
A /search page whose first page of results is rendered on your server, with the search box, filters, cards, pagination, the map and the MLS disclaimers.
This prompt builds the search page with map: the results for the place and filters in the URL, rendered on your server.
The prompt
Prompt
Read RUUSTER_IDX.md first and follow its MUST and NEVER rules. Ask me if it doesn't cover something.
Build a search page at /search that follows the recipe at <https://help.ruuster.com/idx/recipe-search-page>. Render the first page of results on the server with GET /v1/listings and my secret key, reading the page's own URL parameters (the API's names, through fromSearchParams from @ruuster/idx). Show the Filters, ListingGrid, Pagination, AreaMap and MlsDisclaimers components from @ruuster/idx-recipes, put the SearchBox at the top with baseUrl="/api/idx" (and the same baseUrl on Filters), and set the page's metadata from the head object the API returns (toMetadata). Pagination and card links must be plain <a href> links.
Use these environment variables: IDX_SECRET_KEY (server only), SITE_ORIGIN and SITE_NAME. Never paste a secret key into a chat, and never put IDX_SECRET_KEY in browser code, a URL or a log. No key goes in any page: my pages call my own /api/idx route, made with createListingsRoute from @ruuster/idx/route, which adds my secret key on the server (on a site with no server, the widgets call the API with no key from my approved website address). The map uses NEXT_PUBLIC_GOOGLE_MAPS_KEY and NEXT_PUBLIC_GOOGLE_MAP_ID.
Fair housing: describe homes, places and amenities only. Never describe the people who live in an area or who a home or area suits, and never rank schools as a reason to buy.
When you are done, show me how to check with curl that the first page of cards is in the HTML, and that a search with filters I picked has a noindex,follow robots tag.What it builds
app/search/page.tsx, rendering the first page of results from the URL withfromSearchParams- the
Filters,ListingGrid,Pagination,AreaMapandMlsDisclaimerscomponents, with theSearchBoxon top - metadata from the API's
head, so filtered searches arenoindex,follow
How to check it
- Run
npm run dev, search a place, and view source: the first card's address and its/homes/link are in the HTML. - Add a filter such as 3 or more beds and find
noindex,followin the page's robots meta tag. - Turn JavaScript off and reload: every card is still there.
Before you paste it
Follow the setup on Build it with your AI coding assistant once: RUUSTER_IDX.md at the root of your project, the two lines in CLAUDE.md or AGENTS.md, and your keys in .env.local. Never paste a secret key into a chat. Replace the text in square brackets with your own before you send the prompt.