{"id":15794234,"url":"https://github.com/ahlusar1989/postactivityfirebase","last_synced_at":"2026-04-10T23:54:11.881Z","repository":{"id":80545505,"uuid":"100498285","full_name":"ahlusar1989/PostActivityFirebase","owner":"ahlusar1989","description":"Working with Realtime Firebase DB","archived":false,"fork":false,"pushed_at":"2017-08-16T17:36:18.000Z","size":127,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-04T23:41:21.041Z","etag":null,"topics":["android","android-app","android-studio","firebase","firebase-auth","material-ui"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahlusar1989.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-16T14:28:34.000Z","updated_at":"2017-08-16T17:37:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"a4d2d89d-991d-4600-a938-5cbcdd743d34","html_url":"https://github.com/ahlusar1989/PostActivityFirebase","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahlusar1989%2FPostActivityFirebase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahlusar1989%2FPostActivityFirebase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahlusar1989%2FPostActivityFirebase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahlusar1989%2FPostActivityFirebase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahlusar1989","download_url":"https://codeload.github.com/ahlusar1989/PostActivityFirebase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246525542,"owners_count":20791748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-app","android-studio","firebase","firebase-auth","material-ui"],"created_at":"2024-10-04T23:40:48.033Z","updated_at":"2026-04-10T23:54:11.814Z","avatar_url":"https://github.com/ahlusar1989.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Learning Firebase Integration with Android\n=============================\n\nIntroduction\n------------\n\n- [Read more about Firebase Database](https://firebase.google.com/docs/database)\n\nSet-up Started\n---------------\n\n- [Add Firebase to your Android Project](https://firebase.google.com/docs/android/setup).\n- Log in to the [Firebase Console](https://console.firebase.google.com).\n- Go to **Auth** tab and enable **Email/Password** authentication.\n- Run the sample on Android device or emulator.\n\nData Model\n-----------\nThis quickstart demonstrates a simple data model for a social application.\nWhile this data model uses some of the Firebase best practices, it has some\nknown tradeoffs made for simplicity that would not scale to very large numbers\nof users.\n\nThe database has four \"root\" nodes:\n\n  * `users` - a list of `User` objects, keyed by user ID. So\n    `/users/\u003cID\u003e/email` is the email address of the user with id=`\u003cID\u003e`.\n  * `posts` - a list of `Post` objects, keyed by randomly generated push ID.\n    Each `Post` contains the `uid` and `author` properties to determine the\n    identity of the author without a JOIN-style query.\n    * Posts contain a `stars` property which is a `Map` of user IDs to boolean\n      values.  If `/posts/\u003cPOST-ID\u003e/stars/\u003cUSER-ID\u003e` is `true`, this means\n      the user with ID `\u003cUSER-ID\u003e` has starred the post with ID `\u003cPOST-ID\u003e`.\n      This data nesting makes it easy to tell if a specific user has already\n      starred a specific post, but would not scale to large numbers of stars\n      per post as it would make loading the Post data more expensive.\n  * `user-posts` - a list of posts by the user.  `/user-posts/\u003cUSER-ID\u003e` is a list\n     of all posts made by a specific user, keyed by the same push ID used in\n     the `posts` tree. This makes it easy to query \"all posts by a specific\n     user\" without filtering through all Post objects.\n  * `post-comments` - comments on a particular posts, where\n    `/post-comments/\u003cPOST-ID\u003e` is a list of all comments on post with id\n    `\u003cPOST-ID\u003e`.  Each comment has a randomly generated push key. By keeping\n    this data in its own tree rather than nesting it under `posts`, we make it\n    possible to load a post without loading all comments while still\n    having a known path to access all comments for a particular post.\n\nDatabase Rules\n---------------\nBelow are some samples rules that limit access and validate data:\n\n```javascript\n\n{\n  \"rules\": {\n    // User profiles are only readable/writable by the user who owns it\n    \"users\": {\n      \"$UID\": {\n        \".read\": \"auth.uid == $UID\",\n        \".write\": \"auth.uid == $UID\"\n      }\n    },\n\n    // Posts can be read by anyone but only written by logged-in users.\n    \"posts\": {\n      \".read\": true,\n      \".write\": \"auth.uid != null\",\n\n      \"$POSTID\": {\n        // UID must match logged in user and is fixed once set\n        \"uid\": {\n          \".validate\": \"(data.exists() \u0026\u0026 data.val() == newData.val()) || newData.val() == auth.uid\"\n        },\n\n        // User can only update own stars\n        \"stars\": {\n          \"$UID\": {\n              \".validate\": \"auth.uid == $UID\"\n          }\n        }\n      }\n    },\n\n    // User posts can be read by anyone but only written by the user that owns it,\n    // and with a matching UID\n    \"user-posts\": {\n      \".read\": true,\n\n      \"$UID\": {\n        \"$POSTID\": {\n          \".write\": \"auth.uid == $UID\",\n        \t\".validate\": \"data.exists() || newData.child('uid').val() == auth.uid\"\n        }\n      }\n    },\n\n\n    // Comments can be read by anyone but only written by a logged in user\n    \"post-comments\": {\n      \".read\": true,\n      \".write\": \"auth.uid != null\",\n\n      \"$POSTID\": {\n        \"$COMMENTID\": {\n          // UID must match logged in user and is fixed once set\n          \"uid\": {\n              \".validate\": \"(data.exists() \u0026\u0026 data.val() == newData.val()) || newData.val() == auth.uid\"\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n\nReferences\n-------\n\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/firebase-database)\n- [Firebase Support](https://firebase.google.com/support/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahlusar1989%2Fpostactivityfirebase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahlusar1989%2Fpostactivityfirebase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahlusar1989%2Fpostactivityfirebase/lists"}