Now that users can log in, we want their data to persist by storing it in a database on a server instead of local storage.
Approach
[ ] Set up routes for:
[ ] GET goals
[ ] POST goals
[x] Install Prisma ORM
[x] Set up a Prisma goals adapter
[x] Check if a user is authenticated - if so, use Prisma adapter. Otherwise, use the JSON local habits adapter.
Notes
During this process, we can also update the outdated naming conventions like changing HabitService to GoalService.
We can update the JSON habit adapter naming in another task, but it makes sense to make the new files follow a better naming convention.
If there is both local storage and remote storage, how do we want to deal with that? Migrate local to remote if a user confirms on a prompt?
Need to simplify this task as it's been a behemoth of a job. Break it down more and figure out what's actually needed for a baseline.
Removed the single goal route - don't need to do updating of a goal for now because we don't actually have a UI for viewing or updating goals even though the data exists for it.
Summary
Now that users can log in, we want their data to persist by storing it in a database on a server instead of local storage.
Approach
Notes
During this process, we can also update the outdated naming conventions like changing
HabitService
toGoalService
. We can update the JSON habit adapter naming in another task, but it makes sense to make the new files follow a better naming convention.If there is both local storage and remote storage, how do we want to deal with that? Migrate local to remote if a user confirms on a prompt?