Build Rest APIs in Next.js 14 - Middlewares | Protected APIs | MongoDB | Database Design

  Рет қаралды 8,681

Programming with Umair

Programming with Umair

Күн бұрын

Let's build full stack apps in next.js 14 now. Learn building rest api routes in next.js 14 using app directory. In this video, you will learn how to setup, structure and create CRUD apis in next.js 14. Learn how to connect with mongodb and create mongoose modals to create relationship between data modals.
I will create api routes for users, notes and dynamic note id. Finally you will learn how to protect whole backend using middleware and how to use multiple middleware for api routes in next.js 14.
00:03 Overview
01:30 Create first GET api route
04:00 Setup Mongo Altas
07:55 Connect to MongoDB
12:50 Create mongoose Schema for User
16:10 Create mongoose Schema for Notes
18:30 User GET api route
23:00 User POST api route
30:00 User PATCH api route
38:40 User DELETE api route
44:30 Notes GET api route
50:20 Notes POST api route
57:40 Notes PATCH api route
01:03:50 Notes DELETE api route
01:08:30 Note Dynamic api route
01:14:00 Protect api routes with middleware
01:23:10 Logging middleware for notes api routes
#restapis #nextjs14 #postman #mongodb #api #database
Follow Whatsapp Channel:
whatsapp.com/c...
React tutorials:
• React.js Tutorials
JavaScript Tutorials and Projects:
• JavaScript Tutorial an...
Angular Tutorials:
• Angular 16 Life Cycle ...
Docker Tutorials & CI/CD:
• Docker Tutorials & CI/CD
Angular 16 Crash Course For Beginners:
• Angular 16 Crash Course
Tech Tutorials - Random:
• Postman Tutorial - Tes...
Complete Next.js 13 Tutorials: • Next.js 13 Tutorials -...
Next.js 14 Tutorials:
• Next.js 14 Tutorials -...
Node Express MongoDB Bootcamp: • Build REST API with No...
ChatGPT Tutorials: • ChatGPT
Join our facebook group:
/ 996305460498149
Contact us for development services 🤝:
/ umair-jameel-24aa5368
Github Repository Link (Give it a Star ⭐️):
github.com/uma...

Пікірлер: 22
@babil-it
@babil-it Ай бұрын
I loved your fun and simple explanation ❤
@affankhan3563
@affankhan3563 8 ай бұрын
We re looking for a practical guide on integrating a real project with the front end, focusing on avoiding repeated code and implementing complex logic efficiently, especially in the context of a database.js file and routes please bring some practical project with mongodb atlas like Crud application search by id proper convention make it simple for us that we create full stack application and I appreciate your effort but for me it's useless whole code and try to run project on terminal also teach us diff technique to deploy full stack next js application these things we want from youtube
@learn2code1
@learn2code1 2 ай бұрын
Thanks for the easy to understand tutorial. It would be more better if you told me how to add jeson web token and a simple client side to actually test the api. I came from react js and next js is so much different
@ricardomartinez9320
@ricardomartinez9320 5 ай бұрын
Umair, this is one of the best videos I have seen on this topic. Thank you.
@ProgrammingwithUmair321
@ProgrammingwithUmair321 5 ай бұрын
Thank you. Don’t forget to Share.
@capybara0612
@capybara0612 4 ай бұрын
Why throw again the same message in the catch block? The only reason you would do this is to format the error to something user friendly.
@luckysampson6682
@luckysampson6682 7 ай бұрын
Such a detailed explanation. Thank you for this.
@SK_Covers
@SK_Covers 5 ай бұрын
Returning empty or null, while fetching the data. Any solution?
@sebastianvind3558
@sebastianvind3558 2 ай бұрын
Really good video, amazing how beginner friendly you make it. Will be headed straight to the next video after this!
@sujoyghosh7152
@sujoyghosh7152 8 ай бұрын
Hi, following you for a couple months now. thanks a lot for these awesome tutorials. these are really informative and high quality stuff. I need help with a couple of things. can you please make a detailed video on that? In one of my personal project I need to create a cron job that runs 1st of every month. vercel provides a way to automate stuff by creating vercel.json file. can you please tell how can i protect that api route so noone else can spam that api. and is the second thing is, is there a way to get static ip in vercel? so only the vercel hosting can access my mongodb database.
@riyanali3667
@riyanali3667 4 ай бұрын
Thanks a lot sir, I have been stuck in an error and this video helped me .... willing to connect with you.
@MAHanif-mp8eh
@MAHanif-mp8eh 7 ай бұрын
プリズマに関するビデオを提供してください
@niklausmikaelson7332
@niklausmikaelson7332 5 ай бұрын
In post request how we will send our fields data do we need to create a function and call it and pass values?
@lobsanggyatso6280
@lobsanggyatso6280 8 ай бұрын
can you please add next auth as well with (access token and refresh token). that will be really helpful
@southmovie-v8x
@southmovie-v8x 8 ай бұрын
do the video product tittle image and description display in front end using next.js sir
@Akshaykumar-kh2gj
@Akshaykumar-kh2gj 8 ай бұрын
Male a api using server action GET, POST, PATCH AND DELETE PLEASE SIR 😊
@ProgrammingwithUmair321
@ProgrammingwithUmair321 8 ай бұрын
Check my video on server actions and this one combined. You will get an idea how to do it.
@oussma1785
@oussma1785 5 ай бұрын
thank you for this video
@melkhywong7594
@melkhywong7594 8 ай бұрын
literally googling this yesterday LOl... thanks!
@JavierDiaz-jh7ly
@JavierDiaz-jh7ly 8 ай бұрын
+1 😂
@prashlovessamosa
@prashlovessamosa 8 ай бұрын
Thanks Umair sir.
@ap_information7679
@ap_information7679 4 ай бұрын
Amzing
Being Competent With Coding Is More Fun
11:13
TheVimeagen
Рет қаралды 82 М.
From Small To Giant Pop Corn #katebrush #funny #shorts
00:17
Kate Brush
Рет қаралды 70 МЛН
How To Get Married:   #short
00:22
Jin and Hattie
Рет қаралды 22 МЛН
How to use Mongoose with Next js 14 +?
26:20
AyyazTech
Рет қаралды 10 М.
5 Tips and Tricks To Make Your Life With Next js 14 Easier
17:11
developedbyed
Рет қаралды 39 М.
Good APIs Vs Bad APIs: 7 Tips for API Design
5:48
ByteByteGo
Рет қаралды 237 М.
Microservices with Databases can be challenging...
20:52
Software Developer Diaries
Рет қаралды 47 М.
What’s Up with Laravel? It’s Everywhere, and Here’s Why!
6:22
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 198 М.
Next.js App Router Authentication (Sessions, Cookies, JWTs)
11:31