Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firebase database structure #1

Open
ragnar-homekit opened this issue Apr 28, 2020 · 13 comments
Open

firebase database structure #1

ragnar-homekit opened this issue Apr 28, 2020 · 13 comments

Comments

@ragnar-homekit
Copy link

hi can you tell me how to structure the database on farebase?

@Sam1247
Copy link
Owner

Sam1247 commented Apr 28, 2020

it's quite complex but bare with me

Direct

Screen Shot 2020-04-28 at 1 47 14 PM

  • messages (which contains all messages per user)

  • messagesPreview (which contains only the last message for each user)

FeedPosts

Screen Shot 2020-04-28 at 1 53 33 PM

  • contains all posts to display for user

Comments

Screen Shot 2020-04-28 at 2 00 21 PM

  • PostId -> userId -> comment

Followers and Followings

Screen Shot 2020-04-28 at 2 03 18 PM

Likes

Screen Shot 2020-04-28 at 2 03 54 PM

Posts

Screen Shot 2020-04-28 at 2 04 46 PM

  • posts -> userId -> postsId -> postInfo

Users

Screen Shot 2020-04-28 at 2 06 13 PM

@ragnar-homekit
Copy link
Author

ragnar-homekit commented Apr 28, 2020

I see that it is quite articulated. I try to build it. thank you very much

@Sam1247
Copy link
Owner

Sam1247 commented Apr 28, 2020

You're welcome 😊

@ragnar-homekit
Copy link
Author

sorry if I keep asking for info, but the rules of the database, some I have understood, others not.

@Sam1247
Copy link
Owner

Sam1247 commented Apr 28, 2020

Feel free to ask anything but please be specific as you can, FYI Firebase is not a sql database it's a nosql database that has rules not tied to sql but it's much easier thought.

@ragnar-homekit
Copy link
Author

I try to explain myself, to register the user correctly I had to set it like this:

"rules": {
"users": {
"$uid": {
".read": "$uid === auth.uid",
".write": "$uid === auth.uid"

the user search does not work, on xcode i have this error, lost both for a question of permissions

Failed to fetch users for search: Error Domain=com.firebase Code=1 "Permission Denied" UserInfo={NSLocalizedDescription=Permission Denied}
2020-04-28 17:21:18.152408+0200 Instagram_Clone_SW5[12178:222485] 5.20.0 - [Firebase/Database][I-RDB038012] Listener at /users failed: permission_denied

@ragnar-homekit
Copy link
Author

if you can export a standard copy of your test database, in json format, I would appreciate it

@m00nbek
Copy link

m00nbek commented Jun 13, 2021

Hi. How did you learn how to do this bro?

@Sam1247
Copy link
Owner

Sam1247 commented Jun 13, 2021

Hi. How did you learn how to do this bro?

I took the Stanford iOS development course then took some tutorial from channel called let's build that app

@m00nbek
Copy link

m00nbek commented Jun 13, 2021

"Let's build that app" has a lot of videos. Which one did you took specifically? or any playlist? Can you give me link?

@Sam1247
Copy link
Owner

Sam1247 commented Jun 13, 2021

"Let's build that app" has a lot of videos. Which one did you took specifically? or any playlist? Can you give me link?

I don't remember, pick any tutorial you like

@m00nbek
Copy link

m00nbek commented Jun 13, 2021

Thanks bro 😊

@m00nbek
Copy link

m00nbek commented Jun 13, 2021

BTW your project is awesome i loved it 😍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants