Skip to main content

Database

Entity Relationship Diagram (ERD)

 

image-1702378917099.drawio.png

 

NOTE : 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
name name of the category 
active active to users or not
order position of category in the order
parentCategory key of parent category

 

  • products:
Attribute Description
sku 6 digit unique code for each post
cost cost of the product
currency currency of the cost
categoryId category of the product
subCategoryId subcategory of the product
description description of the product
images images of the product
active whether the product is visible to other users
views views of the product
hashtag hashtags to identify the product
  • events:
Attribute Description
sku 6 digit unique code for each post
cost cost of the event in case of paid event
currency currency of the cost
categoryId category of the event
subCategoryId subcategory of the event
description description of the event
images images of the event
active whether the event is visible to other users
views views of the event
hashtag hashtags to identify the event
minAge minimum age to register
maxAge maximum age to register
address address of the event if not online
pincode pincode of address
startDate start date of the event
endDate end date of the event
lastDate last date of the registration of event
paid paid or free event
online online or in person event
enrollmentLink link for registration in case of online event
  • configuration:
Attribute Description
type type of value (html,image,text,boolean)
value value of the configuration
encrypted encrypted value or not
description description for the configuration key

 

  • 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

 

  • view-history:
Attribute Description
pid key of event or product
uid uid of the user viewing the post

 

  • user-bookmarks:
Attribute Description
storeId uid of the store (user) bookmarked