We built DEV3 AI Real Estate Listings as a WordPress plugin in PHP with a React admin and a fast, mobile-first front end. It bundles the feature set that real estate themes are known for: map search with filters, saved searches with email alerts, favourites, compare, agents and agencies, front-end submission, a lead inbox, a mortgage calculator and RealEstateListing schema.
Key design decisions
- Descriptions from photos, as drafts. Up to 8 gallery photos go to the Google Gemini API as inline images with the facts and the agent's private notes. The model returns a title, summary, description, highlights and features, and features are kept only when they match the site's own feature list.
- Agents can only send their own photos.
Describer::images() drops any attachment the agent did not upload, unless it is already in the gallery of a property they may edit.
- Neighbourhood text grounded in OpenStreetMap. The plugin asks the Overpass API for schools, transport, parks, shops, healthcare, food and gyms within 1 km, then gives the model that list with names and distances. The prompt forbids claims about school quality, crime, demographics or future developments.
- Facts and AI text shown separately. The nearby-places list is stored and displayed as facts with an OpenStreetMap credit; the AI paragraph carries an
neighbourhood_ai flag and an "AI-generated summary. Please check details locally." label until an admin turns it off.
- Everything works without AI. Template descriptions from the facts, a facts-only neighbourhood summary from the OpenStreetMap counts, and a rule-based search parser for queries like "3 bed house for rent under 2000 with pool".
Architecture
Properties, agents and agencies are custom post types. A search index table holds price, beds, baths, area in m², coordinates and status, so range and bounding-box queries avoid meta-query joins. Leads and saved searches have their own tables. Maps use Leaflet and OpenStreetMap by default, or Google Maps with a key. The mortgage formula exists in PHP and JavaScript and is tested in both. Public endpoints check the origin and rate-limit by IP. The API client, encryption, caching and usage logs come from a shared core used across DEV3's plugins.