Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

Lyfstory

Prepared On: 10th June 2022

TECHNOLOGY
BACKEND DEVELOPMENT: NODE JS / MONGODB

NEED SOME DISCUSSION


While preparing this document, I realize we are missing a very important point of our
project for discussion, which is the admin panel. We also have to make all requirements about the
admin panel, all modules which manage all data and also have to make requirement
documentation for it. We will discuss this point in the next meeting because it's a very important
point of this project for managing all data which is going to report and user’s report, community
management and lots of stuff which we can think of.

DATABASE DIAGRAM
https://dbdiagram.io/d/62a40e309921fe2a96e1d037
REQUIREMENT

Create account
● Registration
a. Mobile Number
b. Password
c. I Agree
● Verify Mobile Number
a. OTP Verification (Send OTP on Message)
b. Verify with Database
● Generate 2 Profile
a. Normal
b. Alias

Existing mobile number and password


● Login
a. Mobile Number
b. Password
● Generate JWT Token

Forgot Password
● Search Account
a. Via Email
b. Via Mobile Number
● Reset Password

Search Campas
● Search (Limit)
a. Mode
b. Location
c. Campas
d. Topic Category
● Member List
a. View Member Details (Normal Profile)
● List of Campus using Pagination of Search
● Get In (can join campus)

View Campus
● Recent Post List
a. Sort By Most Like (Most voted opinion)
● View Post
a. Post Details
b. Community Opinion
c. Menu
i. Profile
ii. Category option
iii. Report
iv. Remove
● Post Action
a. Read Conversation
b. Like
c. Comment
d. Share - make image and share it in any social media
i. Select Communities to repost
● Add Post (Limit of 5 per hour)
a. Can post using Alias or Normal Profile
i. Get data from Twitter and facebook link
ii. Select any Lyfstory post which recently post
b. Opinion

Communities
● My Communities
● Top Communities
● Suggested communities
● Most liked communities
● Followed Communities
● Deleted Communities

My Communities
● Community
● Person
● Attributes
● Feature
a. List as par Selection
b. Delete (person in your community)
● Send Follow Request
● Create Your Community
a. Profile Pic
b. Fenis (Name of community)
c. Description (Purpose / Motto / Vision)
d. Tagline
e. Add some topics
● Invite Friends in community

Conversations
● List of chats
● Filter of Communities
● Send message (1:1)
a. Send Normal Message
b. Attach Post
c. Emoji
d. Ask Question
i. Share Question
ii. Reply Question
● Menu
a. Rate Conversions
b. Report to person
c. Profile
d. Block
e. Delete
● Action
a. Report
b. Rating
c. Delete

Profile
● Real Profile
a. Details
i. Name
ii. Community
iii. Location
1. Home Location
2. Work Location
3. Zip / Postal Code
4. Location Classification
iv. Date of Birth
v. Age
vi. Gender
vii. Education
1. Add Education
viii. Professional
1. List of Profession - Predefine (Search)
2. Edit Profession
ix. About Me
x. Tagline
xi. Influence Power
xii. Number of Invites
xiii. Tid Bid by friends
1. Received
2. Send
xiv. Predefined reach message
1. Help Message
2. Hiring Message
3. Meeting Message
b. Follow
c. Following
d. My Creation
e. User Verification
f. Edit Image
i. Profile Image
ii. Cover Image
● Alias
a. Same as Real Profile

Notification

Search
● Community
● Person
● Attributes
● Notification
● Feature
a. Filter for search
i. Location
ii. Location Classification
iii. Gender
iv. Age Group
v. Community
vi. Profession
vii. Number of secret superpowers
b. Reach
i. Why reach
1. Help
2. Meet
3. Hiring
4. Other
ii. Reach Card

Category Option

Invitation received

Rate Us

How to Use

Logout
DATABASE STRUCTURE

Collection: users
Description: Save login details on users collections, mobile number and
password, all user’s reference on this _id, anywhere into the database or data
structure, if there is store any user’s reference id then it’s only users collection’s
_id. There are a number of methods to password encrypt, I gave 2 methods here,
which are used by most of the developers.

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
mobile_number String For Login Use
email String For Login Use
password Encrypted String Use MD5 or AES method for encrypt
active boolean 0 - deactivate
1 - active
block boolean 0 - account is active
1 - account blocked
mobile_verify boolean 0 - mobile number not verified,
1 - mobile number verified
email_verify boolean 0 - email not verified
1 - email verified
created_at timestamp Time when user is created
updated_at timestamp Time when user is update their account
Collection: otp_verification
Description: This collection is used for message otp verification. When users sign
up, they will get only OTP in their phone, so that OTP will be generated by the
server and sent to the user's phone via message APIs. OTP will expire in 10 or 30
minutes whatever time we can pick for that, we will just store timestamp into the
database when this OTP is going to expire. After that time record will be deleted
automatically (default feature of mongodb we can set expired time while we are
going to save this record).

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
user_id ObjectId Reference of user table
type String Email / Mobile
otp number 6 digit number
created_at timestamp Time when user is created
expired_at timestamp OTP when going to expired
Collection: profile
Description: On this collection, we will save 2 records for one user, as per type
wise, 1st record for the Real Profile and 2nd for the Alias Profile, and some basic
information which users can add manually as per our requirement.

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
user_id ObjectId Reference of users table
profile_type VARCHAR(5) Real / Alias
profile_pic VARCHAR Profile Picture
cover_pic VARCHAR Cover Picture
age INT Age of users
gender VARCHAR(6) Male / Female
about_me STRING Details about me
tagline STRING Show into top of profile
location VARCHAR Location of users
created_at TIMESTAMP Time when user is created
updated_at TIMESTAMP When last user update their account
Collection: users_location
Description: Into the user’s profile there is one option which can save multiple
locations for the user, so we made one more collection to save this all data in
different collections to manage all records smoothly.

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
user_id ObjectId Reference of users table
type VARCHAR(5) Home / Work
location STRING User’s location in details
pin_code VARCHAR Pincode / Postcode
city VARCHAR Both Profile City - Real / Alias
district VARCHAR Both Profile District- Real / Alias
state VARCHAR Both Profile State - Real / Alias
country VARCHAR Both Profile Country - Real / Alias
created_at TIMESTAMP Date when this record is created
updated_at TIMESTAMP Date when this record is updated
Collection: users_education
Description: Into the user’s profile there is one option which can save multiple
education history for the single user, so we made one more collection to save this
all data in different collections to manage all records smoothly.

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
user_id ObjectId Reference of users table
type VARCHAR School, College, High Education
year_of_passing VARCHAR Education completion year
specialization VARCHAR What they study in specialization
grade VARCHAR Grade
stream VARCHAR stream
created_at TIMESTAMP Date when this record is created
updated_at TIMESTAMP Date when this record is updated
Collection: profession_type
Description: It will be pre define list which can manage only by admin, admin will
add this list into database and API will fetch this record and send it to client side as
per required filters of search feature.

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
name VARCHAR Name of Profession
status BOOLEAN 0 - DELETED
1 - ACTIVE
created_at TIMESTAMP Date when this record is created
updated_at TIMESTAMP Date when this record is updated

Collection: users_professinal
Description: Into the user’s profile there is one option which can save multiple
profession history for the single user, so we made one more collection to save this
all data in different collections to manage all records smoothly.

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
user_id ObjectId Reference of users table
profession_id ObjectId Reference of profession_type table
created_at TIMESTAMP Date when this record is created
updated_at TIMESTAMP Date when this record is updated
Collection: community
Description: This will be a very important and most commonly used collection into
this application. We can say the heart of the application where this project is
running around. When any user will join this application it must be to join any
community and we store this community information on this collection.

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
user_id ObjectId Reference of users table, Admin of
community group
type VARCHAR vamtas, xchange, candid
profile_pic VARCHAR Profile picture of community
name VARCHAR Name of community
vision VARCHAR Description of vision why this
community started
tagline VARCHAR Tagline of community
topics VARCHAR
created_at TIMESTAMP Date when this record is created
updated_at TIMESTAMP Date when this record is updated

Collection: posts
Description: All Community posts or any reshare post will be going to store on this
table, we will calculate all counts of like, share, comment and opinion. We made a
separate table as well for showing history of like, share, comment and opinion by
which user and when with timestamp. That collection name is posts_opinion,
posts_comments, posts_like, posts_share.
KEY VALUE - DATA TYPE Description
_id ObjectId Unique & Primary key
user_id ObjectId Reference of users table
community_id ObjectId Reference of community table
type INT 0 - Community Post
1 - Opinion
profile_type VARCHAR Real / Alias
title VARCHAR Post title / topic
image VARCHAR Post Image
link VARCHAR Link to get video url or any post url form
lyfstory, facebook, youtube
topics VARCHAR Predefine topic and can select other
and then type it’s own
question String Ask question when post
opinion_count INT Count of opinion which get by current
post
comment_count INT Count of comment which get by current
post
like_count INT Count of like which get by current post
share_count INT Count of share which get by current
post
ref_id ObjectId If there is any share then it’s shows
reference here, otherwise it’s empty
status BOOLEAN Post is like or not
0 - Deleted, 1 - Live
created_at TIMESTAMP Date when this record is created
updated_at TIMESTAMP Date when this record is updated
Collection: predefine_question
Description: When any user is going to post, at that time, we are asking a question
to the user, so the user needs to select an option form this predefined list, and just
change his word and fill black as part of his question.

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
question String Question with black space
answer1 VARCHAR Answer 1. Like, Yes, Agree,
answer2 VARCHAR Answer2. Like No, Disagree
created_at TIMESTAMP Date when this record is created
updated_at TIMESTAMP Date when this record is updated
Collection: community_member
Description: All members list will be stored in community_member collection
which will join any community. There is more than one record for one user
because users can join multiple communities as we know. I added one more field
to this collection which is status. These fields stand for if we are going to block any
user or we are making disable where the user can’t make any post or can say not
giving any access for view of that community post.

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
user_id ObjectId Reference of users table
community_id ObjectId Reference of community table
status INT 0 - not active
1 - active
2 - blocked
created_at TIMESTAMP Date when this record is created
updated_at TIMESTAMP Date when this record is updated
Collection: posts_opinion
Description: This collection details are given into posts collection description
With opinion which is sent by fronted.

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
user_id ObjectId Reference of users table
post_id ObjectId Reference of posts table
opinion String Description which given by users
answer String Give answer which ask into post
profile_type VARCHAR Real / Alias
type VARCHAR Post / opinion
comment_count INT Count of comment
like_count INT Count of like
share_count INT Count of share
created_at TIMESTAMP Date when this record is created
updated_at TIMESTAMP Date when this record is updated
Collection: posts_comments
Description: This collection details are given into posts collection description with
comment which is sent by fronted.

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
user_id ObjectId Reference of users table
post_id ObjectId Reference of posts table
comment String Description which given by users
profile_type VARCHAR Real / Alias
type VARCHAR Post / opinion
created_at TIMESTAMP Date when this record is created
updated_at TIMESTAMP Date when this record is updated

Collection: posts_like
Description: This collection details are given into posts collection description.

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
user_id ObjectId Reference of users table
post_id ObjectId Reference of posts table
profile_type VARCHAR Real / Alias
type VARCHAR Post / opinion
created_at TIMESTAMP Date when this record is created
updated_at TIMESTAMP Date when this record is updated
Collection: posts_share
Description: This collection details are given into posts collection description.

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
user_id ObjectId Reference of users table
post_id ObjectId Reference of posts table
opinion String Description which given by users
profile_type VARCHAR Real / Alias
type VARCHAR Post / opinion
created_at TIMESTAMP Date when this record is created
updated_at TIMESTAMP Date when this record is updated
Collection: friends
Description: This collection stores data of friends list which is made into this app,
it will be stored list of friends id which we made.

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
user_id ObjectId Reference of users table
contact String Contact list of users
created_at TIMESTAMP Date when this record is created

Collection: invite_in_community
Description: As we know users can make their own community as well. So after
that, creating new community users can invite or can say request his / her friends
which made into this app, and they can join this community, so we store that
request data in this collection.

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
user_id ObjectId Reference of users table
invite_id ObjectId Reference of users table
community_id ObjectId Reference of community table
status BOOLEAN 0 - request pending
1- request accepted
created_at TIMESTAMP Date when this record is created
updated_at TIMESTAMP Date when this record is updated
Collection: notification
Description: Store notification list which we are going to send to users.

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
user_id ObjectId Reference of users table
type VARCHAR Reference of users table
message String Notification message which we are
going to display into application
read BOOLEAN 0 - unread
1 - read
data Array If need any data for perform onclick
event then store that data in this Object
Like. if there is notification for like or
give opinion on post then it that post id
will store here, or like got any invitation
then store invitation_id on this params
created_at TIMESTAMP Date when this record is created
updated_at TIMESTAMP Date when this record is updated
Collection: message
Description: Chat between 2 users will be stored here, once we get
acknowledgement from the front side, that data is received we will delete it from
the server, Group chat data will be stored on the server. It will use only a socket
for chat.

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
user_id ObjectId Reference of users table
sender_id ObjectId Reference of users table
community_id ObjectId Reference of community table
type VARCHAR vamtas, xchange, candid
chat_type BOOLEAN 0 - One to One Chat
1 - Group Chat
profile_type VARCHAR Real / Alias
ref_type VARCHAR community, post
ref_id ObjectId Reference of posts table
message String Notification message which we are
going to display into application
read BOOLEAN 0 - unread
1 - read
report BOOLEAN 0 - Not reported
1 - Reported
report_by ObjectId Reference of users table
created_at TIMESTAMP Date when this record is created
updated_at TIMESTAMP Date when this record is updated
Collection: message_report
Description: All reported messages will show hare, admin will respond and take
action as needed.

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
message_id ObjectId Reference of message table
report_by ObjectId Reference of users table
message String Message which is reported
report String User will write this response what is
wrong in this reported message
status BOOLEAN 0 - unread
1 - read
created_at TIMESTAMP Date when this record is created
updated_at TIMESTAMP Date when this record is updated

Collection: users_block
Description: Blocked user list will be stored on this collection.

KEY VALUE - DATA TYPE Description


_id ObjectId Unique & Primary key
user_id ObjectId Reference of users table
block_id ObjectId Reference of users table
created_at TIMESTAMP Date when this record is created
updated_at TIMESTAMP Date when this record is updated

You might also like