Form Validation
After having added user authentication, I went on to tackle Tasks. They will be the core of many features in Socio, so I really want to get it right and make sure it's scalable. Having consulted my AI colleague, we agreed that splitting up tasks into several objects would be the most scalable approach.
The Task
object usually contains createdBy
(the user that created the task), createdAt
(when the task was created), completed
(if the task is complete true
or not false
), and so on. This won't work if I want the task to be completed multiple times.
If I have a collection of tasks as a morning routine, then I want every task to reset every day. This requires a separate TaskList
object for grouping tasks together, a TaskListRelationship
object for keeping track of which tasks are available in a task list, and finally a TaskCompletions
object that is created every time a user completes a task. To me, this sounded very complex, but I managed to implement it without any "where is it going wrong" moments.
Today I started working on the UI for tasks. I am a frontend developer who specializes in design systems and reusable components, so I really thought this was going to be the easy part. I was wrong. Fetching tasks and lists that are already in the database was easy. Transforming the data so that lists have an array of tasks inside was easy. Even making sure that those tasks have an array of completions inside went off without a hitch. Adding forms that allows the user to create new lists and tasks... Now, that part is not easy.
I already spent hours today trying to facilitate all nav menu items in a single file. Maybe that drained me to the point that form validation feels painful. I need fresh air. Going out in the sun seems like a good way to reset. Maybe I'll get some ice cream