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

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more