A magical real estate search interface that parses natural language queries in real-time as you type.
main.ts file is already configured as an HTTP triggerVisit the main URL and try these example searches:
"2 bed 2 bath under 800k in Williamsburg""3 bedroom townhouse with yard in Park Slope""condo with doorman and gym under 1M""apartment in Bed Stuy with parking above 400k"Test the backend endpoints directly:
Search Properties:
GET /api/search?beds=2&priceMax=800000&neighborhoods=Williamsburg
Health Check:
GET /api/health
Example API Response:
{ "properties": [ { "id": 1, "address": "123 Main St, Williamsburg, Brooklyn", "price": 750000, "beds": 2, "baths": 2, "sqft": 1200, "propertyType": "condo", "features": ["parking", "laundry"], "neighborhood": "Williamsburg" } ], "total": 1, "filters": { "beds": "2", "priceMax": "800000", "neighborhoods": "Williamsburg" } }
โโโ backend/
โ โโโ index.ts # Hono API server with search endpoints
โโโ frontend/
โ โโโ components/
โ โ โโโ SearchApp.tsx # Main React search interface
โ โโโ index.html # HTML template with styling
โ โโโ index.tsx # React app entry point
โโโ shared/
โ โโโ types.ts # TypeScript interfaces and constants
โ โโโ parser.ts # Natural language parsing logic
โโโ main.ts # HTTP trigger entry point
โโโ README.md
GET / - Main application interfaceGET /api/search - Property search with filter parametersGET /api/health - Health check endpointbeds - Minimum number of bedroomsbaths - Minimum number of bathroomspriceMin - Minimum pricepriceMax - Maximum priceneighborhoods - Comma-separated list of neighborhoodspropertyTypes - Comma-separated list of property typesfeatures - Comma-separated list of desired featuresType naturally in the search bar and watch filters populate automatically:
Bedrooms:
Bathrooms:
Price Ranges:
Neighborhoods:
Property Types:
Features:
Try these search queries to see the magic in action:
"2 bed 2 bath""under 800k""condo in Williamsburg""apartment with doorman and gym""3 bedroom townhouse with yard in Park Slope under 1.2M"