Follow Users

I would like to implement a system that would allow the users of my site to follow/Support each other something similar to the Twitter follow system. Has anyone done this in their own sites and if so how did you manage it ?

Hi Josh,
That would require some design and product specification.
First of all, you should have a followers data base. Maybe the best thing to do it have two of them.
First one will map a member to his own follower, second one will map a member to other members he follows.
Then, you need to describe what ‘Follow’ means… If it means you’re sending an email every time the user do something, this should be pretty easy to achieve using sendgrid API (see other example for that).
If by ‘follow’ you mean building a time line… we’ll, that is a large product to specify.
Start by trying to define what you need.

Liran.

1 Like

Thanks Liran! I will consider each option and do abit of research into what option will best suit me, Im thinking more of the latter option, where a user would follow someone and their profile will appear as a thumbnail on their profile/ user page, Simply to show people who they support/follow. The update such as a timeline will have to wait for now… So facebook and the likes can rest assured their platforms are safe ;D

1 Like

Hello Liran. I have a site that is an event listing platform with 2 types of members, Vendors (the ones who post events) and Users (the ones who view the events) and I would like them to be able to ‘follow’ eachother. Meaning, when a User member follows a Vendor member, that Vendor member’s specific data (event data, etc) will be displayed on the Users logged in pages in various ways. So I want User members to be able to choose who/what other Vendor member’s specific data entries appears on their User member access. Hopefully this makes enough sense to comprehend what I want to achieve. Thanks.

Hi Nelson,

The product you describe requires a ‘real-time’ update, which is not yet available on Wix Code (so this means that notifications cannot be ‘pushed’, only ‘pulled’).

First of all, you need to model your data correctly.
I assume you already have a collection of events, so that part is done, now you need to model a collection that saves relations between users.
I suggest going with a simple solution of a collection that has two main columns: FOLLOWER, FOLLOWEE.

You’ll need to add a ‘FOLLOW’ button and write some code to update this database using wixData API .
And finally you’ll need to use wixData again for querying collections and decide what notification to show when a user logs in.
Now, since we don’t have real-time yet, you can use polling (use setInterval with 1 second). This way when a user is already logged in, the database will be checked for changes every second.

Good luck :slight_smile:
Liran.

1 Like

You’re the man! Thanks buddy.

Hey Nelson ! Have you managed to do " And finally you’ll need to use wixData again for querying collections and decide what notification to show when a user logs in." ?

Thanks in advance !!