Handling the user
The goal of the app is to allow for individual metrics to be tracked and viewed, so for that purpose, we need to make sure that we can identify our users. Supabase supports authentication out of the box, and we’re going to use a very basic method: a magic link.
A magic link allows you to sign up and sign in with just a valid email address. On logging in, the service sends an email containing a unique identifier, and when clicked, the user is verified to that email address. In our case, the backend handles verifying whether it’s a new user or an existing one, which is perfect for our use case.
Since we can identify users, we need to connect our app to retrieve information that Supabase provides. We can also introduce authentication to make sure that users have access to parts that they want to use or visit.
User store
We will want to have access and the ability to update the status of the user at all times, so we’ll set up a user store...