{"id":19535028,"url":"https://github.com/mateusfonseca/mobileapp2_accelerometer_leaderboard","last_synced_at":"2026-04-29T21:03:27.241Z","repository":{"id":171144564,"uuid":"585779927","full_name":"mateusfonseca/mobileApp2_Accelerometer_Leaderboard","owner":"mateusfonseca","description":"\"Accelerometer Leaderboard\" React Native app developed for my Project at Dorset College BSc in Computing, Year 3, Semester 1.","archived":false,"fork":false,"pushed_at":"2023-01-07T01:11:52.000Z","size":735,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-26T04:14:51.130Z","etag":null,"topics":["accelerometer","firebase","jsx","mobile","object-oriented-programming","react-hooks","react-native","sensors","webstorm"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/mateusfonseca.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":"2023-01-06T03:43:48.000Z","updated_at":"2023-01-06T04:10:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"08e3e0a7-6b04-4ca1-9616-b2cfb788c7e2","html_url":"https://github.com/mateusfonseca/mobileApp2_Accelerometer_Leaderboard","commit_stats":null,"previous_names":["mateusfonseca/mobileapp2_accelerometer_leaderboard"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mateusfonseca/mobileApp2_Accelerometer_Leaderboard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateusfonseca%2FmobileApp2_Accelerometer_Leaderboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateusfonseca%2FmobileApp2_Accelerometer_Leaderboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateusfonseca%2FmobileApp2_Accelerometer_Leaderboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateusfonseca%2FmobileApp2_Accelerometer_Leaderboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mateusfonseca","download_url":"https://codeload.github.com/mateusfonseca/mobileApp2_Accelerometer_Leaderboard/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateusfonseca%2FmobileApp2_Accelerometer_Leaderboard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32443576,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T20:22:27.477Z","status":"ssl_error","status_checked_at":"2026-04-29T20:22:26.507Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["accelerometer","firebase","jsx","mobile","object-oriented-programming","react-hooks","react-native","sensors","webstorm"],"created_at":"2024-11-11T02:16:56.503Z","updated_at":"2026-04-29T21:03:27.218Z","avatar_url":"https://github.com/mateusfonseca.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Native App: Accelerometer Leaderboard\n\n**Dorset College Dublin**  \n**BSc in Science in Computing \u0026 Multimedia**  \n**Mobile Applications 2 - BSC30922**  \n**Year 3, Semester 1**  \n**Project**\n\n**Lecturer name:** Saravanabalagi Ramachandran  \n**Lecturer email:** saravanabalagi.ramachandran@dorset.ie\n\n**Student Name:** Mateus Fonseca Campos  \n**Student Number:** 24088  \n**Student Email:** 24088@student.dorset-college.ie\n\n**Submission date:** 08 January 2023\n\nThis repository contains an \"Accelerometer Leaderboard\" React Native app developed for my Project at Dorset College BSc in Computing, Year 3, Semester 1.\n\n## Part 1: Requirements Checklist\n\n- [x] **1. Authenticate using Firebase, upload data to Firestore**\n  - [x] 1.1. Sign up using StudentID@student.\u003cspan\u003edorset-college\u003c/span\u003e.ie (as email) and a password\n  - [x] 1.2. After sign up, collect and update details such as name, course, year in Firestore \u003e StudentID, allow editing these details later\n  - [x] 1.3. Collect and store locally 1000 accelerometer data points\n  - [x] 1.4. Once 1000 data points are collected, upload to Firestore under: Users \u003e StudentID \u003e accelerometer_data\n  - [x] 1.5. Repeat 3 and 4 as long as the app is open and is in the foreground (Don't record when minimised)\n- [x] **2. Display Leaderboard**\n  - [x] 2.1. Retrieve accelerometer_data of all users and calculate movement score2 for each user\n  - [x] 2.2. If accelerometer_data is unavailable or not in correct format or has more than 1000 data points, show score \"N/A\".\n  - [x] 2.3. Show recycler view to display leaderboard with columns rank, name and score (use score for ranking)\n  - [x] 2.4. Refresh every minute, show information: last refreshed (in time ago format3), and refreshing in x seconds\n  - [x] 2.5. Show details of user when clicked in full screen, allow going back to leaderboard\n\n## Part 2: Report\n\nFor this assessment, I was tasked with developing a mobile app that collects movement data through the device’s accelerometer. The data should, then, me uploaded to a cloud database. The app should also display a leaderboard that ranks all users in the database by movement score, from highest to lowest.\n\nOnce again, I chose to work with **React Native**, but differently from the [previous assignment](https://github.com/mateusfonseca/mobileApp2_Ireland_Literature_Map) in this module, this time I decided to go with function components instead of class components. React function components rely heavily on *Hooks*, which themselves are special functions that \"[allow you to reuse stateful logic without changing your component hierarchy](https://reactjs.org/docs/hooks-intro.html#its-hard-to-reuse-stateful-logic-between-components)\", \"[let you split one component into smaller functions based on what pieces are related](https://reactjs.org/docs/hooks-intro.html#complex-components-become-hard-to-understand)\" and \"[let you use more of React’s features without classes](https://reactjs.org/docs/hooks-intro.html#classes-confuse-both-people-and-machines)\". Hooks were introduced with React 16.8, in 2019, and offer a new way of using different features from components. There is a number of built-in Hooks designed to handle the most common needs of any React-based application, but they can also be combined and used to create custom Hooks to answer more specific needs and avoid boilerplate.\n\nAdmittedly, the use of Hooks and this more functional approach to developing mobile apps made things considerably more challenging to me than I had anticipated. Sharing data between components felt less straightforward without classes and, often, I felt like I was using Hooks unnecessarily. In fact, the documentation states: “[Don’t use Effects to orchestrate the data flow of your application. If you’re not interacting with an external system, you might not need an Effect.](https://beta.reactjs.org/reference/react#effect-hooks)”, when explaining the role of the *useEffect* Hook, which is something that I certainly did in this project. Unfortunately, I did not have enough time to go through the theoretical basis of Hooks (*and the React framework as a whole, if I’m being honest*) before jumping into action and starting to code. *Too bad!*\n\nBesides the natural challenges of trying a new approach for the first time, there was at least one other issue that I faced while working on this project that I ended up using somewhat of a workaround to solve. For [requirement 1.2](#part-1-requirements-checklist), I could not have the flow of the program navigate to the screen for editing user details right after signing-up. I believe this was due to how I structured the navigation stack, where some screens are rendered conditionally and, after the user signs-up and gets automatically logged-in, disappear from the stack upon re-render, making it impossible to navigate back. Ideally, I would have refactored my code and changed the screen stack structure so that this problem would no longer happen, however, the lack of time made me resort to an easier, albeit much less elegant, solution: I created another component that basically holds the same form for updating user details and displayed it on a brand-new screen. *Not exactly DRY-compliant, mind you, but it gets the job done.*\n\n#### ________________\n\nReact/RN is among the most popular JavaScript frameworks in the market today and absolutely worth learning, be it for mobile or web development. Working on this assignment, and the [previous one](https://github.com/mateusfonseca/mobileApp2_Ireland_Literature_Map), gave me the “excuse” I needed to get started with it.\n\n## Part 3: References\n\nConceptually, every line of code in this project was written based on official documentation:\n\n- **[React Native](https://reactnative.dev/docs/getting-started)**\n- **[React Native Firebase](https://rnfirebase.io/)**\n- **[React](https://reactjs.org/docs/getting-started.html)**\n- **[React Docs BETA](https://beta.reactjs.org/)**\n- **[React Navigation](https://reactnavigation.org/docs/getting-started/)**\n- **[MDN Web](https://developer.mozilla.org/)**\n- **[RxJS](https://rxjs-dev.firebaseapp.com/)**\n- **[Firebase](https://firebase.google.com/docs)**\n- **[Android](https://developer.android.com/docs)**\n- **[FlashList](https://shopify.github.io/flash-list/docs/)**\n\nThe following NPM packages were installed:\n\n- **[@react-native-firebase](https://www.npmjs.com/package/react-native-firebase)**\n- **[@react-navigation/native](https://www.npmjs.com/package/@react-navigation/native)**\n- **[@shopify/flash-list](https://www.npmjs.com/package/@shopify/flash-list)**\n- **[firebase-admin](https://www.npmjs.com/package/firebase-admin)**\n- **[react-native-paper](https://www.npmjs.com/package/react-native-paper)**\n- **[react-native-screens](https://www.npmjs.com/package/react-native-screens)**\n- **[react-native-sensors](https://www.npmjs.com/package/react-native-sensors)**\n- **[react-native-vector-icons](https://www.npmjs.com/package/react-native-vector-icons)**\n- **[rxjs](https://www.npmjs.com/package/rxjs)**\n\n\nClarifying code snippets from **[W3Schools](https://www.w3schools.com/)**.\n\nVisits to our most beloved **[StackOverflow](https://stackoverflow.com/)** certainly happened, for insight and understanding.\n\nAll user pictures from **[This Person Does Not Exist](https://thispersondoesnotexist.com/)**.\n\n## Part 4: Copyright Disclaimer\n\nThis project may feature content that is copyright protected. Please, keep in mind that this is a student's project and has no commercial purpose whatsoever. Having said that, if you are the owner of any content featured here and would like for it to be removed, please, contact me and I will do so promptly.\n\nThank you very much,  \nMateus Campos.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateusfonseca%2Fmobileapp2_accelerometer_leaderboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmateusfonseca%2Fmobileapp2_accelerometer_leaderboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateusfonseca%2Fmobileapp2_accelerometer_leaderboard/lists"}