Build a REST API in Next.js 13 app directory! Master RESTful techniques and paging w/ Prisma & Auth!

preview_player
Показать описание

📰 Newsletter 📰
Signup for my newsletter, "A Bit of SaaS," to keep you informed, inspired, and engaged with the latest trends, tips, and resources in the ever-evolving SaaS industry.

🔖 Chapters 🔖
00:00 - Intro
00:42 - API Design
02:43 - Restaurants Endpoints
17:27 - Restaurants Menu Endpoints
25:40 - Paging
29:31 - Authentication & Authorization
30:53 - Structuring Responses
35:27 - Outro

📜 Code 📜

👨🏼‍💻 About Me 👨🏼‍💻
I am a principal software engineer and architect who loves building cool cloud software.

Рекомендации по теме
Комментарии
Автор

Thankyou for providing such a great content. Love from India.

anuj
Автор

Amazing..underrated video of new things i learnt that cant get even in 10 hours video tutorial...thank you...

muhamadbadriyusuf
Автор

I am reallay greatful to your valuable content.
Thank you so much from Bangladesh

mironmahmud
Автор

Thank you for this awesome video, it is really a lot of effort for 6k views. I hope your channel gets bigger soon.

georgenabraham
Автор

Thank you for authorization explain and other important items like pagination. I appreciate that.

KelberStuchi
Автор

Hello, very good guide! However i have a question, lets say that there is a page to view the resturant menu and the client does the required requests to the api to render data... lets also suppose that there is a dashboard for the owner of the resturant in which he can view, add and edit more sensitive data like suppliers for a certain product. I would like that that kind of data is visible only if the GET request is made from the owner of the resturant (logged in obviously). Is it a good idea to check for auth inside a GET request and eventually add more sensitive data? There is a better way to do this?

MasterWolFxMotionDesigner
Автор

Nice work. Hypothetically, how would you calculate the most popular dish at a restaurant?

nasarissa
Автор

Could you make a video on how to implement pagination in frontend? I love your content ❤.

Nahary
Автор

Whats the difference between "return NextResponse(...)" and "return new NextResponse(...)"

shawn-skull
Автор

Hello Ethan, just to let to know that the links in your newsletter does not work. Ghost has some issues at this time. cheers.

francais-salvador
Автор

Nice work… a small detail but I would have made menu items a many-to-many relationship to menu since menu items might be able to exist in multiple menus. To get around the floating point issue for price, I always store prices in cents therefore as an integer. E.g. $20.99 is stored as 2099

cb
Автор

please Ethan what is the difference between working with api in the frontend and working directly with db with prisma?
to be more clear what difference between

data=await fetch('/api/restaurants)
vs
data=await prisma.restaurants.findMany()

based on what we go for one or another?

abderrahmaniidrissihamza
Автор

how can we check if user supplied an "apikey", and let the apikey be set in url

kevinfarley
Автор

Hi please I’m having issues working with login page, can you make a video which has login page different from register page ..

Iamroot
Автор

would it be possible for you to do a video about authentication where you implement verification by email using next auth credential not the magic link and go into details about different forms of authentication in next js

speedster
Автор

I appreciate it if you could show me your package.json to see which dependencies you have installed.

amariliodeoliveira
Автор

thank you for the explanation like pagination and others. How to get file in request body in nextjs 13.2 api route

Mr.MaxaaCusub
Автор

If I use server components how can I wrap my application with a client side state management like RTK or react context and still have my app take advantage of server componts, I'm not good at this new mental model, was wondering for things like state for things like dark mode toggling for tailwind

ronaldpaek
Автор

Hi, could you share with us what you are using at 6:35 to view the database? your videos are awesome btw 🎉

hironakae
Автор

Can you please also make a video where how we can seprate the business logic from the routes, so that like creating a service folder that serves the logic. This can create the functions in route.ts files like only barely 2 lines. I have been rejected from a job just as I did not create a service abstraction.

pbdivyesh