Posts

Job Portal

11/02/2025 13:05  moment package :- calculate date and give how many times back it is posted w.r.t to present  k - converter :- this package insures that all the thousands will come under K or like that  Quill :- rich text editor  18/02/25  16:34 mistakes I have done which cause me waste 2.5 days 1. user.js instead of User.js 2. you need to import all the things before deploying it or else you will get error  3. in the logs of vercel you can see why your backend or any code is not working  it should send as home page (API is working in my case) like this things then only its mean its running  4. rgrok is used for tunnelling like what we deployed that is instead of going with long cut it will go in tunnel (short cut ) you have to download and set int PATH of the environment variable   19/02/25  10:20 am What is context in react ??  it' type of container where all the states and props can be hold and provided which ever component...

Edtech backend class 4

 whenever their is concept related to data we have to manage that like in our project called studynotion we required to show the UI based on the different types of user  different UI for the Instructor and different for the Student. from where we get information about the user that is --> backend. we have to manage the state so for that we uses state management library called -- > REDUX. steps  1. install the particular package (redux toolkit) 2. create the store  3. wrapped into provider  :- wrapp app component into the provider as all the state will be treated as global variable,  we have to pass store into the provider 4. create slices 5. add into reducers what we do in reducers folder :- take all the slices and combine them if token === null then show login and signup button if token !== null then show add to cart like features frontend -> button -> services -> controller Optional parameter in function --> Order matters a lot 

Edtech Backend class 1

 how otp works ?? first user come to the website -- >  enters the data -- > redirected to OTP page -- >  OTP is sent via mail  -- > enters the OTP -- > if Correct then user created in DB. so we want user only create after mail sent . we have to use pre middleware/hook class 3 :-  how course created  every course have tags(catalog) assign to them which is used in searching and filtering purpose  create tag authority only have Admin --> we can make protected route using isAdmin method course content :- have section :- which have subsection  everything is CRUD operation in backend  create course and getAllcourse before course creation there should be tag available by the admin lecture flow -> tag controller -> course -> section -> subsection  in course we 

Auth Class 3

  header is the most secured way compare to all we but we have to follow the syntax of this that is key ->"Autherization" and value -> "Bearer " with space the token which we pass from body that is less secured  avoid doing this  HW  ? why bearer token is more secured  cookie hijecking and token hijecking https://chatgpt.com/share/6784be42-3904-8006-ae19-0009ed309190 Protected route is used for the purpose of authentication or authorization also   how to sends token practically ??? 1. cookie : - res.cookie.token      But for this there is pre requisite that you have to install cookie-Parser  then only it will run 2. body :-  req.body.token     But for this there is also pre requisite that you have to install body parser (like express.json())  In below method you have to give space after Bearer       -- > Syntax :( 3. Header method :- there is 2 ways to doing this i. Raw method...

Authentication and autherization class 1

 we can authorize and authenticate user using both the methods  cookies JWT both things are sent from server to the client to know user more correctly and understand user more correctly  like we often see in the e-commerce website that whenever add some products in add to cart button  then after restarting browser we can able to see the added cart items  internally this things happen because of cookies only class 2  we can fetch or send also token from  body cookie header  --> it is most secured way to send the token its not necessary all 3 have the token  but from where you wanted to send you can send the token and access that we can user middleware as for the authentication and authorization   like isAdmin, isStudent aur auth we can  do definitely so that's where middleware is used till this date in my knowledge  how we achieve authentication and autherization we send jwt token of user once user is sign up into the ac...

BD Class 4 Data Association

 Data Association: -  It is the linkage or co-ordination between two data how they are related to each other and how one data affects other how data is linked to one or other form how we can manage that In blog application we can have 3 schema 1. post 2.like 3.comment this 3 schema can have different values in that  1. post --> title,body,like,comment title and body is independent but like and comment  is referencing to their object/Schema  we can have array of likes and comments so that we can get to know that how many likes one particular post contains similarly with comment 2. like -- > post [array] , user [array] 3. comment --> post[array], user[array]

BD class 2

 mount is nothing but fancy word for add/append what is api/v1  v1 stands for version 1 this means when older user is requesting for the API then they are using v1 but after some changes in the code then it requires to give the hint that the API has been changed so we can simply mount with api/v2