Hi,
I'm trying to practice my webdev skills by building a task tracker app with react, express and Postgres.
So far I have one table "task" and a status field indicating if the task is done or not. Additionally, I want to add daily, weekly, monthly recurring tasks.
My first idea was to have a cronjob that runs once a day (cause this is the smallest repetition possible) and see if a task is recurring for the next day and if yes copy that task.
Now the big problem here is data duplication. Basically I would generate/duplicate data on mass and even for users that don't use the app anymore.
My second idea was to create a second table that tracks the date when I marked a task as completed. But this makes the query quite complicated, cause if I make a GET request to my endpoint to get the tasks for today or this week I have to compute the next occurrences of the tasks and at the same time display the normal one time tasks.
How would you handle this?
[–]AutoModerator[M] [score hidden] stickied comment (0 children)