How do you apply Tinder-like functionalities with the Swipe component?

Hey, I’m a beginner to Glide and wanted to make a Prototype for my app here, for which I need much of the functionalities that Tinder has. The Swipe would help me do 50% of that, I need a little help with the other 50%.

My question is, how do I connect the left swipe and right swipes to help do the like/dislike functionality so it’s saved. Right now, I only have one table of dummy users with about 6 properties per row. Do I need to make another table to save the match information and if so, what should I save exactly?

My second question would be once two people match with each other, is it simple enough to have the Chat screen only populated with that user’s matches or do I need the help of user-specific columns for the filter.

Apologies if these seem a little too beginnerish but any help would really be appreciated.

We might need more info on what you want when the users “match” with each other.

  • Saying user A likes user B already.
  • When user B likes user A, does that mean we have to automatically show a chat for each of the users to start chatting with each other?

I don’t think we can use user-specific columns for this.

My idea is like this:

  • Have a “Likes” table with 2 columns “Initiated Email” and “Liked Email”.
  • Have a “Chats” table with 2 columns “Email 1” and “Email 2”.
  • In the Users table, add a “Dislike” boolean column.

When users swipe left:

  • Set the dislike column to true.
  • Filter the list of users by dislike is not true and email is not signed-in user.

When users swipe right, we have 2 cases here, and before that, we add some columns to help in the Users table.

  • Relation from the email column to the “Liked Email” column of the “Likes” table.
  • Joined list of “Initiated Emails” so you get a list of emails that have liked each profile.

Then, if the email we’re viewing IS NOT included in the SIGNED-IN USER’s “Initiated Emails” joined list.

  • Add a row to the Likes table with the signed-in user’s email as “Initiated Email” and the email they’re viewing as the “Liked Email”.

Else, if the email we’re viewing IS included in the SIGNED-IN USER’s “Initiated Emails” joined list.

  • Add a row to the Likes table with the signed-in user’s email as “Initiated Email” and the email they’re viewing as the “Liked Email”.

  • Add a row to the Chats table with two emails above as “Email 1” and “Email 2”.

  • Add a chat tab, show the rows where signed-in user’s email is email 1 or signed-in user’s email is email 2, or add row owners to both columns and just show all visible rows.

5 Likes