I'm trying to think of the best way to structure a database to allow users to send/accept/decline users as friends.
I've currently got a system that allows users to search through users, checks all the necessary stuff like people already being on their list bhalbhla, but I don't know how to finish it off with actually sending the invites.
My structure looks like:
Users
290384239843
friends:
093824098209384: true
username: Bob
Usernames
Bob: 290384239843
I figure when I hit the add button, it sends something to both users on Firebase, and I think the two options are:
users
29038493
friends
0283940839024: pending
or
users
02938409384
friends
3094809384903 : true
pendingFriends:
0283940839024: true
I think both could potentially work, but I figured I'd reach out incase I could get some guidance from someone with more experience with this. Maybe there's a better way entirely different?