Uploaded December 2022 | Updated November 2026, 3 days ago
Learn how to connect your NextJs app to MongoDB without exhausting your connection pool and organize your database query functions.
β‘οΈ The Ultimate NextJs Course
π hamedbahram.io/courses/nextjs
Learn how to connect your NextJs app to MongoDB without exhausting your connection pool and organize your database query functions.
β‘οΈ The Ultimate NextJs Course
π hamedbahram.io/courses/nextjs




![Build a Fullstack App with Authentication & Rate-limiting in NextJs 14
In this video, weβll build an AI blog generator powered by OpenAI GPT-4 and DALL.E 3, Supabase backend for database and storage, Clerk authentication, Zuplo for our API Gateway, and NextJs 14 as our frontend application.
ππΌ The Ultimate NextJs 14 Course
β https://www.hamedbahram.io/courses/nextjs
ππΌ Project source code, links, and notes
β https://www.hamedbahram.io/notes/ai-blog-generator
ππΌ Work with me
β https://www.hamedbahram.io/hire
Chapters
0:00 Intro
2:30 High-level architecture
4:00 Setting up supabase
6:20 Setting up NextJs
8:30 Connecting to supabase
11:00 Header, home page & form component
14:00 Adding form action
16:40 Adding server action
20:00 Using OpenAI SDK
23:45 Using supabase storage
26:25 Using supabase db
28:30 Add form pending state
30:00 Creating dynamic blog [id] page
34:50 Adding the Recent blog section
39:00 Adding Clerk authentication
45:10 Adding Clerk UI components
51:00 Adding API Gateway
1:01:00 Updating NextJs to use the API Gateway
1:03:10 Quick review
1:04:40 Server function timeout setting
1:06:24 Recap Build a Fullstack App with Authentication & Rate-limiting in NextJs 14](https://i.ytimg.com/vi/n5dsBONfwjE/mqdefault.jpg)





