Logic building | Register controller

  Рет қаралды 50,128

Chai aur Code

Chai aur Code

6 ай бұрын

Visit chaicode.com for all related materials, community help, source code etc.
Welcome to chai aur code, a coding/programming dedicated channel in Hindi language. Now you can learn best of programming concepts with industry standard practical guide in Hindi language.
All source code is available at my Github account:
github.com/hiteshchoudhary
Our Open-Source Project is here: freeapi.app
Join me at whatsapp: hitesh.ai/whatsapp
for community discord: hitesh/ai/discord
Instagram pe yaha paaye jaate h:
/ hiteshchoudharyofficial
HTML video series: • HTML and VSCode - gett...
Complete javascript series: • Javascript for beginne...
Complete Reactjs series: • React JS roadmap | cha...
Javascript and react interview series: • 1 call se shuru hui pl...
Backend development with Javascript: • Javascript Backend Roa...

Пікірлер: 819
@GauraV-uc2oi
@GauraV-uc2oi 2 ай бұрын
Finally all the pieces are coming together. It's like watching movie where someone is trying to solve a mystery. Thank You Sir for this amazing explanation.
@abhimanyupayasi
@abhimanyupayasi 6 ай бұрын
00:03 Logic building is achieved through real-world software projects 02:06 Logic building exercise helps in breaking down problems into small steps 05:40 Validation and file checking are important steps in register controller. 07:36 Extract URL from the response and check for successful avatar upload 11:23 The user details are extracted from the request body with a destructure operation 13:19 Testing the data using Postman 17:16 To use the uploaded file in the register route, add the upload middleware and use the 'fields' option to accept multiple files. 19:01 Creating an array with two objects for accepting avatar and cover image files. 22:36 Using the dot sum method to check if fields are empty 24:24 Checking validation and user registration in a JavaScript code 27:57 Retrieve user email based on username 29:47 Logic building for registering controller 33:22 Upload cover image and avatar image 35:15 Upload your file on cloud using a method 38:49 Creating an entry in the database with Avatar object 40:41 Ensure validation of cover image and handle cases when it is missing. 44:07 Use Find by ID to find a user and ensure successful creation 46:04 Creating a properly structured API response 49:44 Creating a new object with given status code and data 51:33 Register controller and bug fixes
@user-dk1ns1ih8c
@user-dk1ns1ih8c 6 ай бұрын
are you using merlin for comment?
@abhimanyupayasi
@abhimanyupayasi 6 ай бұрын
@@user-dk1ns1ih8c yes bro !!
@mrgtxgamerz1
@mrgtxgamerz1 5 ай бұрын
1. first the user send the data 2. then we have to take the data from body 2.1, check if all required fields are available or not 3. then in our regsiteration model we have to find the user if present in it then we return without registering the user 4. if user not present we create the user in the database 5. then we sent the message that user created successfully
@mysterious_billionaire
@mysterious_billionaire 4 күн бұрын
Wow the most in depth user registration video ever......
@collegeprofsirki
@collegeprofsirki 7 күн бұрын
step 1 : sabse pehle name and apni info ko data base mein store karega step 2: uske baad phir ham uski image profile wagira ko handle karenge step 3: then fir woh apna content wagaira upload kar sakta hai step 4: or woh jo bhi activities karenga usko ham data base mein sav ekarenge
@zia-kayani
@zia-kayani 5 ай бұрын
Hitesh sir , i have been learning coding from many indian channels but your way of teaching and selection of words is unique and next level.. now a days i only visit chai aur code + hitesh choudhary . thanks and love from pakistan 💓
@dheerajsahni8073
@dheerajsahni8073 6 ай бұрын
Sir aap jabse hindi language me aaye ho, aapne bawaal hi macha diya hai market mein ❤❤😮
@user-hy4zt1bs3v
@user-hy4zt1bs3v 6 ай бұрын
Bilkul shi kaha bro 🎉
@Prakash-Raut
@Prakash-Raut 6 ай бұрын
I saw your first video at the college wallah channel and I must say I've never met anyone like you before I've been a fan of your teaching style from day one and I started following you and till now I've watched all your videos. Thank you so much for the amazing content. Love You 3000 ❤
@afzalhamdulay
@afzalhamdulay 11 күн бұрын
gajab deep coding thi video mai! kuch code difficult th samajhne mai, par worth it hai full on!
@madhavvijay5173
@madhavvijay5173 2 ай бұрын
Best Development Series I have seen till yet with great level of work. Hats off to you 👍👍
@mirzafirozuddin173
@mirzafirozuddin173 6 ай бұрын
steps: 1. Get required fields from user. 2. Validate the received fields. 3. Check user already present in db or not. If yes don't save data to db and send a response to user. 4. If not then hash the password and save data to database. 5. Generate access token 6. send response with status code
@Shriramkrishnhari
@Shriramkrishnhari 6 ай бұрын
I can say after analysing my way, Anyone can learn as calmly U say.. I have watched a video U made one day U R respected as well as "they" 🌟🌟🌟🌟🌟😊
@ozge-yagizfan
@ozge-yagizfan 6 ай бұрын
Sir big fan of you , never stop teaching us , In Sha Allah aap k subscribers bohot barh janay hain, ap ki serires seriously best serires hain, love from Pakistan
@chandrashekarv2397
@chandrashekarv2397 5 күн бұрын
1.take all required values for registrering (if required,do validations) 2.call the function which handle register user 3.inside the function call the api to create user
@HassanMurtaza571
@HassanMurtaza571 3 ай бұрын
bohat achay lectures hain ap k sir .... post man main jahan ap url type kr ray hain us k agay cancel ka button hai responce ko stop krnay k lia or agar server restart krtay hain tab b post man ka request standing process stop ho jata hai ... baki love you sir g production level ka parhanay k lia😍😍😍😍😍
@henilchhipani
@henilchhipani 5 ай бұрын
sir amazing videos i am not building this same project just learn from this project and apply it to my project. by the way I am building CRM system enjoying your work.
@anuragdubeydubeyji6783
@anuragdubeydubeyji6783 6 ай бұрын
Best series of javascript backed on youtube... Aag laga di bhaiya ji 🎉
@hamzazafar7999
@hamzazafar7999 2 күн бұрын
Best video sir ❤❤. Finally i got to know that why we were writing code for diffrent utilities like multer and cloudinary and Api response etc ....... 🤣🤣❤❤
@shoaibhasan4026
@shoaibhasan4026 6 ай бұрын
In paid courses you can't get this treasure. Hats off Sir ❤
@hunterYoutuber29
@hunterYoutuber29 6 ай бұрын
I just wanna say that your videos are best for a beginner.....best to start with any course....the context it provides is straight forward that i find confusing elsewhere...i don't get the things at first but watching your videos your tutorials does provide the confidence that I can do it...and that just means more than anything to me.... Thankyou ❤
@princeyadav5667
@princeyadav5667 Ай бұрын
shortest video i ever seen. I didn't realize where the one hour goes. Thankyou so much sir...
@AbheyKhurana-tc6be
@AbheyKhurana-tc6be 18 күн бұрын
Sir you have such in depth knowledge of every topic, Thanks for sharing all of it
@user-kx1sv7lq4k
@user-kx1sv7lq4k 12 күн бұрын
outstanding explanation sir har ek word samajh aaya : )
@codewithhasnain_17
@codewithhasnain_17 25 күн бұрын
best educational channel in the world ❤
@ArjunSingh-wo1tg
@ArjunSingh-wo1tg Ай бұрын
Again ,The most beautiful line of this vedio is - "jitna code likhne me time nhi bitate us se jyade debugging me aap time bitate hai"🙏🙏❤
@anujchhikara-zy4mx
@anujchhikara-zy4mx 2 ай бұрын
1. First we try to get the user data from req.body 2.then once we got data we can validate it with some middleware if data we are getting is in correct format 3. Then import user from model to create new user and store it in our database and use try and catch 4. If success then send status of 200 and some messages like successful register 5. If not then some status code like internal server error or failed to register
@dopaminesero6390
@dopaminesero6390 6 ай бұрын
your experience is next level sir, they way you teach fundamentally..
@user-lf8jq5cz9p
@user-lf8jq5cz9p 2 ай бұрын
From Bangladesh 🇧🇩! Thanks to Bollywood for teaching me hindi.....this course is soo insane, I can't believe its free. Thanks Hitesh Sir!
@DheerajShrivastav
@DheerajShrivastav 6 ай бұрын
best course in terms of explanation, and how he is not wasting time in explaining js instead focusing on explaining the actual logic and db related terms 🔥🎉
@alexdsdebasis
@alexdsdebasis 2 ай бұрын
Bahat bahtat dhanyavad sir , itna indepth jaake aur bahat asanise samjha diye itne sare chijj. mnai user registration sikha tha ajj images upload karna bhi aagay.Thank You #HiteshSir
@VikashRoshan
@VikashRoshan Ай бұрын
a big thanks for covering all the intricacies in such a beautiful way
@SarveshKumar-08
@SarveshKumar-08 6 ай бұрын
Fantastic tutorial on logic building and register controller! This video provides a clear, step-by-step guide to mastering problem-solving skills in software projects. Highly recommended for anyone looking to enhance their coding knowledge.
@DeepakKumar-oz5ky
@DeepakKumar-oz5ky 2 ай бұрын
for regestration we will take data from frontend ,where we can take data like name,username,email, and password. second from my view it will check this user is exist or not if that user is existed it shows some thing like this use has benn already created .so we make condition for that or write code for that . this user is unique so we wll take his password and hash. and then it shows users has been created . this much i have think. in my first view, now its time to check what hitesh sir will teaches us.
@MayankSharma-vi1ok
@MayankSharma-vi1ok 4 ай бұрын
Thoda sa chota rakhenge is video ko bolkr 1 ghnte ka lecture bna dete ho Sir hamesha 😂😂. Btw hats off to your efforts and Thank you very much sir for this great production level content.
@maniishbhandari
@maniishbhandari 2 ай бұрын
1. Ask the user Data from FE 2. Access the data in BE 3. check if all required field are given with correct format 4. check if the user is already created 5. if not create a new user 6. send the user message that he has been created
@prabhatchandela3959
@prabhatchandela3959 2 ай бұрын
Step 1: user data lenge based on our user schema Step 2: condition checking Step 3 : sending response Step 4 : error handling
@saketg07
@saketg07 15 күн бұрын
Awesome video for making any type of controllers
@seemadeshmukh7079
@seemadeshmukh7079 Ай бұрын
Excellent course !!! It is one of the best so far.
@pgrAbhilash
@pgrAbhilash 6 ай бұрын
24:34 We can also check the fields whether it is empty or not in this way if(!fullname || !username || !email || !password) { throw new ApiError(400, "All fields are required!"); }
@patiljay956
@patiljay956 5 ай бұрын
LCO course method
@sahilpawar5152
@sahilpawar5152 4 ай бұрын
Better way can be to check it in some() function `if( [username,fullName,email,password].some((field) => field?.trim() === "" || field === undefined) ){ throw new ApiError("Please fill all fields",400); }` i was confused bcz of this for 4 days🥲
@atharvadeshmukh6328
@atharvadeshmukh6328 Ай бұрын
This is the best backend series online!!
@chaiaurcode
@chaiaurcode Ай бұрын
Thanks 🤗☕️
@GagandeepSingh-ip8dm
@GagandeepSingh-ip8dm 3 ай бұрын
1. send data from th user. 2. check if the required fields are there. 3. check if there is any duplicate entry for the unique fields in the database. ( we can send the required message if anything missing or duplicate entry) 4. If all data is fine, then we save the user in the database, and send the success message.
@vishal-shinde
@vishal-shinde 2 ай бұрын
3:58 // 1. taking fields required for register by req.body // 2. check if user already exists in the database // 3. password validation // 4. hashing the password // 5. save the avatar and coverimage to local server and then to cloudinary // 6. save the data to mongodb
@divasbhadani9225
@divasbhadani9225 Ай бұрын
chai aur code me hi possible h, chota rahte h video bol ke 52:48 min ka padhaa diya apne sir ji aur pata v nai laga Hats off to you sir ji You rock, i tried to learn backend but i stopped multiple time but your playlist is soo amazing, just wanted to watch next video and learn. Thank you soooo much for such a free course 🙏
@KattameediVishnuvardhan
@KattameediVishnuvardhan 5 ай бұрын
for rgistering the user 1.take the data from the user 2.validate the given data 3.if the data is valid then store it your DB 4.then send response to client that registration is succesfull
@neerajrawat0275
@neerajrawat0275 3 ай бұрын
first step make middle ware that trigger the route. ex. app.use("/register", routename) step 2 handle the route like give method post in the routname.js and give the function that will execute using the contrroler function step 3 write a controller function logic means the mongodb.connect import mongodb to save the data import the schema of the user login so that the monogodb can be connect and for the lmage we have 2 use the utility of the cloudinarry that we already made the earlier
@techjagat4714
@techjagat4714 29 күн бұрын
Thank you Sir making this series very simple and Informative ❤❤
@aniksaha8108
@aniksaha8108 2 ай бұрын
Such a nice video on controller. I learnt how to think properly, when you asked us to pause and think I paused and only made 4 steps but there is so much more to do. Such a beautiful logic written
@harshitkaushal1584
@harshitkaushal1584 20 күн бұрын
This was made so understandable becuz of your efforts! hats off to you.💖💖
@user-hh5jx7in6d
@user-hh5jx7in6d 6 ай бұрын
Big fan sir Your teaching is very help full to me. Big respect for you sir🙏🙏🙏
@pikundas9639
@pikundas9639 6 ай бұрын
Thank you Sir!!!! areee sab jaldi se comment ta target pura kardoo
@TW-uk1xi
@TW-uk1xi 4 ай бұрын
Thanks for making this tutorial. please don't stop this series.
@Dev-Phantom
@Dev-Phantom 2 ай бұрын
finale is coming closer. Best lecture ever
@spdwivedi5925
@spdwivedi5925 16 күн бұрын
In depth video sir , thanku
@user-mc1rq4pw1o
@user-mc1rq4pw1o 3 ай бұрын
learned so many new methods to validate, Thank You!
@tipssedlife
@tipssedlife 6 ай бұрын
Very very optimized video, and you have taught every single bit of code in a flow. 🤝
@awesomeguy6427
@awesomeguy6427 6 ай бұрын
Purane log hi jaante hi Hitesh Sir ke purane mongodb wale lessons yaad agya wo time dekhke english accent mei haha, hopefully u read this.
@vishal-shinde
@vishal-shinde 2 ай бұрын
Very good detailed video on register api route! took time to understand properly
@ankishkhandelwal1061
@ankishkhandelwal1061 3 күн бұрын
Congratulation Sir 300K subs Done
@ravisingh5906
@ravisingh5906 6 ай бұрын
now, after 12 videos , it is making sense , thanks for so much efforts sir
@the_haryannvi_coder
@the_haryannvi_coder 6 ай бұрын
Will binge watch on Sunday!!
@izharulhaque43
@izharulhaque43 6 ай бұрын
Thanks for amazing tutorial. 16:01 Please click on CANCEL button in postman to stop response.
@rahulgurjar6402
@rahulgurjar6402 5 ай бұрын
1. get the required fields for the registration user 2. check the user is already present or not 3. hash the password and save in database 4.send response to the user
@shekhar_ranjan
@shekhar_ranjan 3 ай бұрын
बहुत बढ़िया वीडियो 🙏
@JeetuKumar-wd1uw
@JeetuKumar-wd1uw 5 ай бұрын
Sir seriously maaza aagaya😊😊
@azeemdeveloper4815
@azeemdeveloper4815 3 ай бұрын
topnotch content series, I have no words sir for you
@dub161
@dub161 5 ай бұрын
loved it brilliantly explained.
@user-wy9zi5op9l
@user-wy9zi5op9l 6 ай бұрын
very deep and simple explanation. First time found something like this♥😍
@RohitChhabirajYadav
@RohitChhabirajYadav 3 ай бұрын
2hrs nhi 3month baad aa rah hu #thankyou sir #jsbackend
@wasimshariff9701
@wasimshariff9701 6 ай бұрын
sir the level of knowledge you have is really unmatchable.....👌👌❤❤..
@PrashantKumar-rc5hl
@PrashantKumar-rc5hl 6 ай бұрын
this video made my day thank you sir, agr possible hota me aapke liye jmin se upr hmesa chlne ka intejam kr deta.
@Codewithrasheed
@Codewithrasheed 6 ай бұрын
Thank you much sir for giving us this best series ❤
@yanshmoradiya
@yanshmoradiya 6 ай бұрын
Great work 👍
@rendevous9253
@rendevous9253 6 ай бұрын
Best video on logic building.
@adityayambal1756
@adityayambal1756 Ай бұрын
Best Unpaid course which is far better than paid courses.. Thank You Sir
@devanand4269
@devanand4269 5 ай бұрын
Thanks sir amazing video .. Feeling confident please continue this series and stay motivated❤
@Dev-Phantom
@Dev-Phantom 2 ай бұрын
Multiple new things to learn in this Lecture.
@Talha_75
@Talha_75 5 ай бұрын
best channel, keep going, we are with you
@user-vm7fe8fs6c
@user-vm7fe8fs6c Ай бұрын
great explanation in on nod js and best channel...
@devanand4269
@devanand4269 5 ай бұрын
Thank you sir kaafi chize samjh aayi tbh jada mza backend me ara hai frontend se❤❤
@salimrazaraza1048
@salimrazaraza1048 4 ай бұрын
Best video in KZbin thankyou sir
@bhaskarmoger1160
@bhaskarmoger1160 3 ай бұрын
thank you sir for being a tech teacher 💌
@rakeshbhetariya
@rakeshbhetariya 5 ай бұрын
In this video I feel I am learning backend maja aagay sir ❤
@chaiaurcode
@chaiaurcode 5 ай бұрын
Glad to hear that😊☕️
@aarishfaiz7880
@aarishfaiz7880 Ай бұрын
Amazing Video Sir
@pranav5273
@pranav5273 5 ай бұрын
I am enjoying this!!
@webdevankit4285
@webdevankit4285 6 ай бұрын
Hitesh bhaiya .you aree the bestt❤
@san29sh
@san29sh 6 ай бұрын
Bahut kuch naya sikhne mila thank you
@paramraval134
@paramraval134 6 ай бұрын
Great teacher!!
@user-ly9qv8oe9o
@user-ly9qv8oe9o 3 ай бұрын
Ram Ram Sir G ye video dekh kar to maja hi aa gya
@Mayanksingh-ij4yl
@Mayanksingh-ij4yl Ай бұрын
4:00 1. Agar hame register karna hai user ko to sabse pehle user ka data hona chahiye jo ki form ya postman se post method ke through aa gayi let's say, yaha tak to waise frontend waalon ko dekhna hai data kaise bhejenge. 2. Achha ab data aa gayi hai to kya directly save kar de mongo db me ya kuchh aur operation perform karne ki jarurat??? data me avatar aur user ki image bhi aayegi ab vo data ham directly mongodb me save to kar nahi rahe, usse ham pehle server ke disk storage pe save kar rahe hain and then cloudinary pe save kar rahe hain, to jab bhi ye data aayegi uske liye ek check lagakar(basic if statement) ham multer aur cloudinary waala middleware run kar lenge. 3. Ab password save karne ke liye userSchema me jo pre methods hain wo run karne honge(kaise hoga ye to video dekh ke hi pata chalega). 4. Mujhe lagta hai hamne sab kar liya hai ab tak, to ab data save kar lete hain. req.body se data le liya aur save karte gaye aur password, avatar aur image ko save karte waqt dhyan rakhna hoga kyunki waha hashed password aur url save karni hai. Mera logic to filhaal itna hi keh raha hai baaki video dekh ke samajh aayegi, aisi aur kya chizein hain jo miss ho gayi. BTW mujhe bohot jyada darr lagta thha production ke code se, MVC pattern use karke jab bhi likhte hain samajh hi nahi aata but through this playlist abhi tak aisi koi dikkat aayi nahi hai aur ab hitesh sir pe aur khud pe bharosa hai aage bhi aisi koi dikkat aayegi nahi.
@tgrpolai
@tgrpolai Ай бұрын
bro thankyou yaar
@mantragor8150
@mantragor8150 3 ай бұрын
Great Efforts sir
@sayan418
@sayan418 4 ай бұрын
True sir. I appreciate your thoughts. I also think that real world projects are best to learn ❤
@rushikeshkatkar4659
@rushikeshkatkar4659 3 ай бұрын
Thanks for this. Just implement in my project .
@Kuch-Bhi-Ho-Raha
@Kuch-Bhi-Ho-Raha 6 ай бұрын
Currently pursuing your Chai and React series, will soon start with backend
@nomanhossain8421
@nomanhossain8421 6 ай бұрын
best backend series of youtube
@jenilmangukiya525
@jenilmangukiya525 6 ай бұрын
Great Video Sir Keep it one ❤
@utkarshgupta9030
@utkarshgupta9030 6 ай бұрын
Thank you so much sir..watching the series..bas jaldi khatam hojaye ab😅
@chaiaurcode
@chaiaurcode 6 ай бұрын
Abhi to kaaft time lagega, bht concepts sikhne h professional level pe
@LearnAlongFaizan
@LearnAlongFaizan 5 ай бұрын
Loved your style of teach, the way you look at things is awesome. ♥from Bangalore
@chaiaurcode
@chaiaurcode 5 ай бұрын
Thanks a ton
@adamyasharma_0135
@adamyasharma_0135 4 күн бұрын
thank you so much for this amazing content!
@faisalahmed4054
@faisalahmed4054 6 ай бұрын
always fan of your tutorial brother
@suryapratap_bit
@suryapratap_bit 6 ай бұрын
Code quality is next level. 🎉
How to use postman for backend
36:13
Chai aur Code
Рет қаралды 48 М.
狼来了的故事你们听过吗?#天使 #小丑 #超人不会飞
00:42
超人不会飞
Рет қаралды 63 МЛН
Black Magic 🪄 by Petkit Pura Max #cat #cats
00:38
Sonyakisa8 TT
Рет қаралды 36 МЛН
Access Refresh Token, Middleware and cookies in Backend
1:02:45
Chai aur Code
Рет қаралды 58 М.
How to build logics in programming
10:04
Chai aur Code
Рет қаралды 283 М.
Complete guide for router and controller with debugging
29:35
Chai aur Code
Рет қаралды 46 М.
Как узнать волю Божью
0:35
Пастор Стивен Фуртик
Рет қаралды 9 М.
HTTP crash course | http Methods | http headers
24:19
Chai aur Code
Рет қаралды 74 М.
Why our ecosystem is NOT producing better software engineers ?
13:54
Форчан ищет Флаг (Финал) 🍀
0:46
i11ushenka
Рет қаралды 2,2 МЛН
Luck decides who wins 🍀😅#shorts #funny #viral
0:24
Uma NOOB
Рет қаралды 19 МЛН
Китайка и Пчелка 4 серия😂😆
0:19
KITAYKA
Рет қаралды 1,5 МЛН
ХАН АТА НАЛЕТЕЛ НА ХАСАНА
0:45
RFC Fighting Championship
Рет қаралды 276 М.