DEV Community

Cover image for Day 01 Designing Database Schema
waqas
waqas

Posted on

Day 01 Designing Database Schema

Lets Design Database Schema For First User Story

As we know from from first episode we have these functional requirements

  1. The user should be able to create an account.
  2. The user must have the ability to add prayers only during the designated prayer times.
  3. Prayer timings must be aligned with the user's time zone, considering the different prayer times in various cities and countries

So the above requirement demonstrates we need to register the user to our system and the user should be able to mark prayers done or if he missed it will be marked missed. To meet requirements we need a user entity and prayer entity but for more granular control and to avoid redundancy, we also need a profile table. note I skipped analytics to
make starting more easier.

database erd

Bit Explanation

I added support of credentials and Google Oauth support in the user table for now I'll add just credentials authentication but later in the next phases, I'll add signIn with Google support. In the profile table which has a one-to-one relation with the user table, I added the user's social information.in the prayer table, I added all necessary fields to track and store user prayer information.

What's Next

In the next episode, we'll implement complete credentials based authentication with a stateless JWT auth mechanism with

Top comments (0)