Real time notifications for Real Estate

Get real time notifications any time a new property is up for sale.

Code Level

Advanced

Published

 

Example Description

In this example we built a real estate site where the user can see properties up for sale and upload a property they would like to sell. We use wix-realtime-backend API to send real time notifications, so no matter on which page the user is on, they get a notification message once a new property has been added. The message includes the property’s neighbourhood and a link to the property's page.

Example Code

How We Built It

Collections

  • Listings - holds the properties that are up for sale.

  • Amenities - holds the features of each property.

 

Backend

  • data.js - exports a afterInsert data hook on the Listings collection. This data hook uses wix-realtime-backend API to publish a message to the ‘new-property’ channel that a new property is up for sale, alongside a link to view that property.

Pages

  1. Buy - a page that uses a repeater to display all the properties up for sale from the Listings collection. The page uses wix-realtime API and subscribes to the ‘new-property’ channel to get real time notifications. Once a message is published on that channel it runs the newPropertyUploaded function to display a message with the new property’s details for 10 seconds.

  2. Upload - a page that lets the user upload a new property. It also subscribes to the ‘new-property’ channel to get and display a notification that a new property is up for sale.

  3. Listings - a dynamic page that displays the details of each property.

APIs We Used

Related Articles

Related Examples

Add to Cart Gallery

Let customers to add products to their cart

INTERMEDIATE

Hide and Show Elements

Hide and show elements in response to user interactions

BEGGINER

Hide and Show Elements

Hide and show elements in response to user interactions

BEGGINER

 

This website was designed with Corvid by Wix.