Blocking system

Hi guys an gals.
Anyone know how to build a blocking system or can point me to a tutorial ?

For context…

I’m assuming by ‘blocking system’ you’re talking about a way to allow Users to block other users from seeing them in your app (or something similar)… if you’re talking about something else entirely then you’ll need to clarify…

But assuming I’ve understood the question, it’s a fairly simple thing to achieve.

You just need to have a way to store who’s blocked who - and then apply whatever logic you need to those relationships between Users.

There’s nothing inherently different about doing this than there is with any other kind of User-User relational data, so all the basics of database design and relational data apply (check the bubble manual for a good explanation of linking datatypes (Creating a Data Structure - Bubble Docs).

but, basically there are a few options…

  1. You can simply have a Block List field on the User datatype
    Here you can just store a list of other Users who’ve been blocked the User

  2. You could create that Block list as a separate datatype (useful if you anticipate a larger number of blocked users and want to keep the User dataype light).
    I.e. have a datatype called User_Block_List, which has a field for User (the User doing the blocking), and a field for Blocked Users (a list of blocked Users). You could also link that block list directly to the User datatype in a User_Block_List field to make it easier to access directly from the User datatype.

  3. You could create a datatype called blocked_user, which simply links two users - the one doing the blocking, and the one being blocked.

Of course, like everything, which option is best for you will depend on many factors, but I would guess in most cases the number of users blocked by any particular user is unlikely to be very high, so the first option is probably the simplest, although option 2 will help keep the User datatype lighter.

In this case option 3 might be over-complicating things for the purposes of what you’re trying to achieve.

Regardless of how you decide to store the blocked User info, once you’ve got that list it’s just a case of applying conditions, and maybe privacy rules, to restrict user interactions in whatever way you need to for your app.

1 Like

Great response, Adam. I tried to provide some context before anyone responded because what you wrote is a much longer (and much better, admittedly) version of my initial response in the other thread, but I’m sure it will be helpful (or at least it should be).

Sorry, @anon7044910, but I’m pretty sure you aren’t going to find a tutorial on how to build a block feature because the details of such a feature are going to be heavily dependent upon the functionality of your app. If I were you, I would either start with a template or just start building because it really won’t be all that difficult to include a block feature in your app. In other words, don’t let the lack of a “canned” feature stop you from getting going with Bubble, but that’s just my two cents.

1 Like

Hi , I will need to read this several times over to digest the concepts.
Basically I need to build the block feature used on all the dating sites.
As I am trying to build a dating site myself.
The blocking feature also has to have follow on actions.
As after a person has been blocked so many times by different users in the same day for example that then leads to them being deleted/removed/banned. from the site or warned etc .
As I say none of this is in the dating app templates also from what I can see.
Witch I would of thought should been apart of the templates and for all of the social media apps templates.
I wish it was ready made I know that much.
But I will check out your suggested reading and at least now have some terminologies to throw into youtube and took yet another step down the rabbit hole.
All help and information is gratefully appreciated.
Thanks Guys

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.