ggneilc / stat-tracker

Health & Fitness Tracker designed to gamify life to increase motivation, written in react native
0 stars 0 forks source link

Data Syncronization - Code Refactor #16

Open ggneilc opened 9 months ago

ggneilc commented 9 months ago
  1. Bulk meal/weight/sleep/water entry creation
  2. Data sync
  3. Redux Store

I don't think we will actually need anything from the backend at all from the data sync, I think the only thing we need from the backend's part is just being able to handle a list of entries.

in order to sync the data, we will just need to add a boolean flag to keep track of which entries have already been updated, and in app.js, add a useEffect that tries to sync the data from the store that is !synced.


The Redux Store

The redux store will need:

We are then going to need past with these, so we can split up the reducers into the 4 pillars and have the user be slightly bigger:

userSlice:

MealSlice: -userMeals -pastMeals

WeightSlice: -userWeight -pastWeight

WaterSlice: -userWater -pastWater

SleepSlice: -userSleep -pastSleep

ggneilc commented 9 months ago

from here it is fairly obvious which screen need what slices to work correctly:

from there it should be way straightforward development on implementing goal autocalculation from the frontend and adding that table in the backend, and then doing the same with healthscores !!

ggneilc commented 9 months ago

backend todo: