Kurakoo is an online community of people providing answers to questions just like Quora site. Kurakoo is especially for school-college students, people from around the different colleges visit Kurakoo to ask questions from a community of people who answer them.
Once the folder structure for the back-end is created and some basic boilerplate code is added, we start the back-end development part and create some APIs and work with data which we retrieve from or add into the database. To work with the database, we initially create a skeleton/blueprint of what the related data should look like for eg. what all fields should be there in the details of all the users, questions, etc and what should be their data types and so on. Schema does this task for us hence we need a blueprint for the user details written in the form of a schema.
Description
Create a mongoose schema for the user details which will contain the fields:
Name - String
Email id - String
Password - String(hashed password using bcryptjs)
Year/sem - Number
College - String
friends - array(initially empty) of ObjectIds which will look into the 'User' model specified in the ref option.
Some other fields such as questions asked, answers given, etc can be added later when the schema for questions is created so the user schema is subject to changes in the future.
Problem/Context
Once the folder structure for the back-end is created and some basic boilerplate code is added, we start the back-end development part and create some APIs and work with data which we retrieve from or add into the database. To work with the database, we initially create a skeleton/blueprint of what the related data should look like for eg. what all fields should be there in the details of all the users, questions, etc and what should be their data types and so on. Schema does this task for us hence we need a blueprint for the user details written in the form of a schema.
Description
Create a mongoose schema for the user details which will contain the fields:
Some other fields such as questions asked, answers given, etc can be added later when the schema for questions is created so the user schema is subject to changes in the future.
References/Acknowledgement
Issue #3 for user details