Skip to main content

Database

Entity Relationship Diagram (ERD)

 

image-1681204024121.jpg

 

The database does not contain any foreign key constraints. The checking of existence of a record is performed using services wherever necessary.

Common attributes

Every table has these common attributes which are auto generated during database transactions. We can also provide these manually in certain cases where an api is called using this.servicesince the request and response objects are not passed to the functions of the endpoints

  • createdAt :  time of creation of the record. Auto generated during time of creation
  • createdBy: refers to the user that created the record. Auto assigns the uid of the logged in user
  • updatedAt: timestamp of record update. Auto generated during time of the update
  • updatedBy: refers to the user that updated the record. Auto assigns the uid of the logged in user
  • key: Auto generated primary key.

Tables

  • Users:
Attribute Description
email email of the user
type type of login or signup (phone, email etc.,)
password encrypted password
referalCode referral code of the user 
role role of the user (In this app "user")
phoneNumber phone Number of the user
provider name of the provider (google, local etc.,)
google user token in case of google login
facebook user token in case of Facebook login

 

Attribute Description
title title of the category (Facebook, Instagram etc.,)
image icon for the category
order position of category in the order
urls array of url strings containing all valid types of domain name for this category
activeImage name of image file in the system for the icon
isSystem Is category is predefined by the system.

 

  • links:
Attribute Description
title title of the link (scraped from link)
image image for the category (scraped from link)
description description for the category (scraped from link)
categoryId key of the link-category the link belongs to  

 

  • referred-users:
Attribute Description
userId user id of user that referred 
referredUserId user id of user that got referred

 

  • email-templates:
Attribute Description
template email template in html format
from email of the sender
pdfTemplate attachments in the email
templateVariables list of variables in the email template

 

  • emails:
Attribute Description
to email of receiver 
data user or template specific data
expiry expiry time for certain types of email
generateOtp whether to generate otp for the email or not
verificationCode verification in case of otp emails

 

  • about-videos:
Attribute Description
link link to the video
title title of the video