- 121
- 1 804 990
Hamed Bahram
Canada
Registrace 14. 12. 2011
Modern web dev topics in React and NextJs.
Rate Limiting in NextJs with Middleware, Vercel KV Storage & Upstash
In this video, we'll look at rate limiting your NextJs application using edge middleware functions, Vercel KV (Kay value storage), and the Upstash rate limiting package.
👉🏼 The Ultimate NextJs Course (75% Off)
→ www.hamedbahram.io/courses/nextjs
👉🏼 Project source code
→ github.com/HamedBahram/next-rate-limiting
👉🏼 Vercel KV Quickstart
→ vercel.com/docs/storage/vercel-kv/quickstart
👉🏼 Upstash Rate Limit package
→ github.com/upstash/ratelimit-js
👉🏼 Work with me
→ www.hamedbahram.io/hire
👉🏼 The Ultimate NextJs Course (75% Off)
→ www.hamedbahram.io/courses/nextjs
👉🏼 Project source code
→ github.com/HamedBahram/next-rate-limiting
👉🏼 Vercel KV Quickstart
→ vercel.com/docs/storage/vercel-kv/quickstart
👉🏼 Upstash Rate Limit package
→ github.com/upstash/ratelimit-js
👉🏼 Work with me
→ www.hamedbahram.io/hire
zhlédnutí: 673
Video
Caching in NextJs ft Delba Oliveira from Vercel
zhlédnutí 6KPřed 21 hodinou
In this video, we'll discuss caching in NextJs with Delba Oliveira, developer advocate at Vercel, and the beautiful mind behind NextJs documentation. 👉🏼 The Ultimate NextJs Course → www.hamedbahram.io/courses/nextjs 👉🏼 NextJs caching documentation → nextjs.org/docs/app/building-your-application/caching 👉🏼 Work with me → www.hamedbahram.io/hire
Neon: Serverless Postgres Database
zhlédnutí 27KPřed dnem
In this video, we'll build an expense tracker using Prisma, NextJs 15 RC, and Neon, a serverless Postgres database in the cloud that scales up and down automatically based on your application's workload. 👉🏼 Neon database → fyi.neon.tech/hamed 👉🏼 The Ultimate NextJs Course (75% discount) → www.hamedbahram.io/courses/nextjs 👉🏼 Project source code → github.com/HamedBahram/next-neon 👉🏼 Work with me...
How to build custom UIs on top of Clerk's APIs
zhlédnutí 37KPřed 14 dny
Introducing Clerk Elements, a new set of unstyled components that make it easy to build custom UIs on top of Clerk's API without having to manage the underlying logic. 👉🏼 Clerk elements documentation → go.clerk.com/elements-docs 👉🏼 Clerk website → go.clerk.com/hamed-bahram 👉🏼 New Clerk course → www.hamedbahram.io/courses 👉🏼 NextJs Clerk template → github.com/HamedBahram/next-clerk 👉🏼 Project so...
React Resizable Panels
zhlédnutí 10KPřed 14 dny
In this video, we're going to use React resizable panels to build resizable components in NextJs. 👉🏼 New courses → www.hamedbahram.io/courses 👉🏼 Project source code → github.com/HamedBahram/react-resizable 👉🏼 React resizable panels → react-resizable-panels.vercel.app 👉🏼 Work with me → www.hamedbahram.io/hire Chapters 0:00 Intro 1:00 Project setup 1:46 Adding React resizable 7:30 Shadcn abstract...
In conversation with Colby Fayock from Cloudinary
zhlédnutí 378Před 21 dnem
Join me in a conversation with Colby Fayock from Cloudinary, where we will dive into his journey as a web developer, content creator, and now developer advocate at Cloudinary. 👉🏼 Colby's channel → www.youtube.com/@UC7Wpv0Aft4NPNhHWW_JC4GQ 👉🏼 New courses → www.hamedbahram.io/courses 👉🏼 Let’s talk about your project → www.hamedbahram.io/contact
Serverless Postgres ft Mahmoud from Neon
zhlédnutí 708Před 21 dnem
Join me for a deep dive into Neon, a serverless Postgres database, and Prisma, a type-safe ORM, with Mahmoud, Developer advocate at @neondatabase. 👉🏼 New courses → www.hamedbahram.io/courses 👉🏼 Neon's website → neon.tech 👉🏼 Let’s talk about your project → www.hamedbahram.io/contact
Schema validation using Valibot
zhlédnutí 1,5KPřed měsícem
This video will teach us about Valibot, a type-safe schema validation tool. 👉🏼 New courses → www.hamedbahram.io/courses 👉🏼 Project source code → github.com/HamedBahram/next-valibot 👉🏼 Next shadcn template → github.com/HamedBahram/next-shadcn 👉🏼 Valibot website → valibot.dev Chapters 0:00 Intro 1:00 Installation 7:30 Implementation 16:10 Client side validation 17:50 Recap
The Easiest Way to Add Charts in NextJs
zhlédnutí 2KPřed měsícem
This video will look at adding charts in NextJs using Tremor. 👉🏼 My NextJs Course → www.hamedbahram.io/courses 👉🏼 Project source code → github.com/HamedBahram/next-tremor 👉🏼 Tremor site → www.tremor.so 👉🏼 Work with me → www.hamedbahram.io/hire
Blurred placeholder for dynamic images in NextJs
zhlédnutí 2,8KPřed měsícem
In this video, we’ll look at generating `blurDataURL` to use as a placeholder when lazy loading dynamic images in NextJs using the plaiceholder package. 👉🏼 The ultimate NextJs course → www.hamedbahram.io/courses 👉🏼 Project source code → github.com/HamedBahram/next-image-component 👉🏼 Work with me → www.hamedbahram.io/hire
The New React Compiler
zhlédnutí 1,9KPřed měsícem
In this video, we'll look at the new open-sourced React compiler released in React 19 RC. We'll learn what it does and how to use it in NextJs 15 RC. 👉🏼 New courses → www.hamedbahram.io/courses 👉🏼 Source code → github.com/HamedBahram/next-15rc 👉🏼 React compiler docs → react.dev/learn/react-compiler 👉🏼 React conf 2024 recap → react.dev/blog/2024/05/22/react-conf-2024-recap 👉🏼 Let’s talk about yo...
React Conf 2024 Recap | React 19 RC Release
zhlédnutí 1KPřed měsícem
Reflecting on React conf 2024, this video will review the React 19 RC release and the new features coming to stability. 👉🏼 New courses → www.hamedbahram.io/courses 👉🏼 React conf 2024 → react.dev/blog/2024/05/22/react-conf-2024-recap 👉🏼 React 19 RC → react.dev/blog/2024/04/25/react-19 👉🏼 Work with me → www.hamedbahram.io/hire Chapters 0:00 Intro 4:50 Actions & transitions 12:05 The use API 14:26...
What's New in NextJs 15
zhlédnutí 19KPřed měsícem
In this video, we'll review the latest features in NextJs 15 Release Candidate (RC) before the upcoming stable release. 👉🏼 The ultimate NextJs course → www.hamedbahram.io/courses 👉🏼 React Conf 2024 → czcams.com/users/liveT8TZQ6k4SLE?t=1788 👉🏼 Vercel ship 2024 → vercel.com/ship 👉🏼 Let’s talk about your project → www.hamedbahram.io/contact Chapters 0:00 Intro 2:00 React compiler 3:30 Hydration er...
Animating Background Gradients using Framer Motion
zhlédnutí 2,9KPřed měsícem
In this video, we'll use framer motion to animate our background gradient colors. 👉🏼 New courses → www.hamedbahram.io/courses 👉🏼 Project source code → github.com/HamedBahram/bg-gradient-animation 👉🏼 Work with me → www.hamedbahram.io/contact
Sync Clerk Data to Your Database Using Webhooks
zhlédnutí 47KPřed měsícem
In this video, we'll examine how to sync user data from Clerk to our database using webhooks. We will use Prisma as our ORM to connect to Mongodb for end-to-end type safety. 👉🏼 Clerk Authentication → go.clerk.com/9AXfPV7 👉🏼 Learn Clerk → www.hamedbahram.io/courses 👉🏼 Clerk setup guide → czcams.com/video/aI-tDJxWI6A/video.html 👉🏼 Next-Clerk template → github.com/HamedBahram/next-clerk 👉🏼 Project...
Project Structure and File Conventions in NextJs 14
zhlédnutí 28KPřed měsícem
Project Structure and File Conventions in NextJs 14
Next.js Deep Dive with Lee Rob, VP of Product at Vercel
zhlédnutí 34KPřed 2 měsíci
Next.js Deep Dive with Lee Rob, VP of Product at Vercel
Leveraging NextJs & Prismic CMS | Project Showcase with Studio OBV
zhlédnutí 1,2KPřed 2 měsíci
Leveraging NextJs & Prismic CMS | Project Showcase with Studio OBV
Clerk Keeps Getting Better | Core 2.0 Setup Guide
zhlédnutí 14KPřed 2 měsíci
Clerk Keeps Getting Better | Core 2.0 Setup Guide
The Best Video Infrastructure for Your Application
zhlédnutí 2KPřed 2 měsíci
The Best Video Infrastructure for Your Application
Zeno Rocha: Founder and CEO of Resend | Podcast E4
zhlédnutí 556Před 2 měsíci
Zeno Rocha: Founder and CEO of Resend | Podcast E4
Dynamic Catch-all Routes in NextJs 14
zhlédnutí 15KPřed 3 měsíci
Dynamic Catch-all Routes in NextJs 14
Monetize your API in under 30 minutes
zhlédnutí 1,5KPřed 3 měsíci
Monetize your API in under 30 minutes
Kevin Powell: The CSS King | Podcast E3
zhlédnutí 1,8KPřed 3 měsíci
Kevin Powell: The CSS King | Podcast E3
Build Object Detection Using Free Open-source AI Models
zhlédnutí 2,2KPřed 3 měsíci
Build Object Detection Using Free Open-source AI Models
do I need to buy the subscription in order to use API key ?
Thank you so much for this. I've been building a task management app which is working great but I've not been happy with the readability of my code. The way you have split the actions and todos in the prisma folder is much cleaner and easier to read. I'll be refactoring asap 🙂
This was difficult to learn anything from.
What always gives me hard time is trying to figure out some extra features that would fit into the process because as a pro I tend to get tasks that are easily out of the ordinary use case. For example, I want the user to input his company number on the first step and then not only validate that the input is not empty, but also that the number they provided is real and not made up. Is there a way to run a custom function for each step that would do something before it would let the user go on to the next step?
mux is not free, after 24 hours apparently the delete the videos
That’s right, Mux is not free.
Great video! It really helped me
Glad to hear that!
great explanation! Thanks a lot. Now I am going to use this NextUI
Glad to hear that!
Sorry Hamed, but I have to disagree on this one. No need for Framer and CSR. We can add this animation with simple CSS while still having the benefits of SSR.
Absolutely!
Love the explanation! ❤ Definitely a sub from me. Quick question. Removing the default default locale is good for seo purposes? If a website already has seo, and wants to migrate to nextjs with internationalization?
I'm not sure how removing the default locale would affect the seo, not an expert in that domain.
If anyone has issues where it wont select the correct multiple theme, make sure your custom theme is below :root. I was dumb and had it above so the root theme was constantly overriding my custom theme
Good point!
با این روش کل صفحاتمون Client Side میشه!
Nope it won't!
Thank you, this is very helpful!
You're very welcome!
Does anyone know a good blog or tutorial on revalidating a cached next/image on-demand. I'm using Next 13 and currently when a user uploads a profile picture the first time works but when they update the image with a new one, it registers in Cloudinary but not on the website due to next.js built-in caching functionality. I'm starting to think I may have chosen the wrong tool for the job. I thought I might be able to use revalidateTag if I configured the next config file to enable server actions but that didn't work.
On-demand revalidation should do the job, you can use `revalidatePath` or `revalidateTag` in your server action in response to the user uploading a new image. Watch this video where at the end I show how to use server action via the new `useActioState` hook and `revalidatePath` to purge the cache. czcams.com/video/EB0Nu_e9wCs/video.html
Hey , i have a common loading.tsx file . When i am routing from one page to another server page browser is not fetching the page and using the browser router cache . Thats why i think the loading is not showing on second time routing and due to render delay it is looking ugly . Is there a way it always fetches the new server page every time ? Hope you understand the question .
Watch this video → czcams.com/video/JPX60qarij4/video.html
Great Video, would be nice if you could make with nuxt/next + prisma + supabase (local dev) :)
Great suggestion!
what font are you using please, it's cool
Operator mono
Is it work without vercel? It's paid
You can use it on the free hobby plan as well.
I'm confused; does this really help? If we're doing rate limiting at our own application level, the requests will be considered traffic to our application, and we WILL be charged for those. Also, we're redirecting again at our own app level, so technically they could [D]DOS us by sending millions of requests. In my mind, the rate limiting part should be done BEFORE traffic reaches our app to avoid charges and our sever going down Am I missing something?
That's a good question, you can apply rate limiting at different layers such as a proxy server before you reach your application server, here we're using the edge middleware which runs before and separate from the application (nextjs) server. As far as the response, it's up to you how to handle; you can block with a 429 response instead of redirecting, this was just an example.
Thanks, that's true. My main concern is that it is OUR part of the infra that's handling things The middleware is still running as part of our application, so if someone starts constantly sending requests, and say we're charged based on RPS, they can easily bankrupt us!
and how can i rate limit all my application routes?
Without the config matcher, the middleware function runs for every request. Read more here to exclude static paths from the running the middleware → nextjs.org/docs/app/building-your-application/routing/middleware#matcher
Hey great video , how can i rate limit a server action?
That's a good question! you can implement the same logic inside the server action and limit the response based on the user specific ID or the request.
Fantastic video! Thank you to you both for this one!
Our pleasure!
I'm new and I ran into a problem where Header should be a server component because I need to use another server component (ShoppingCart) inside the client component and because of this absolutely everything is marked as dynamic after the build, is this a bad practice?
Using server components doesn't mean dynamic unless you're using dynamic functions such as `cookies` and `headers` which are request specific. I can't really judge if you're implementation is good or bad with this limited knowledge.
@hamedbahram I use a session-based shopping cart cause I do not have user authentication, and it was the only way to save cart data after closing the browser. And it looks like this: <header> (server component as it's async) <HeaderLogo /> (client component) <Navbar cartItems={<CartItems /> (server component)} (client component) </header> So with this approach, everything is marked as dynamic after I build my app ├ λ /api/cart 0 B 0 B ├ λ /api/post/getCities 0 B 0 B ├ λ /api/post/getStreets 0 B 0 B ├ λ /api/post/getWarehouses 0 B 0 B ├ λ /api/orders/[id] 0 B 0 B ├ λ /api/products 0 B 0 B ├ λ /api/products/[id] 0 B 0 B ├ λ /api/wishlist/info 0 B 0 B ├ λ /availability 1.55 kB 98.3 kB ├ λ /availability/[id] 3.02 kB 93 kB ├ λ /checkout 22.8 kB 120 kB ├ λ /checkout/thanks/[id] 731 B 92.5 kB ├ λ /contacts 929 B 90.9 kB ├ λ /remote-coats-tailoring 149 B 85.1 kB ├ λ /sewing-wedding-looks 149 B 85.1 kB └ λ /wishlist 1.54 kB 98.3 kB + First Load JS shared by all 84.9 kB ├ chunks/69-8c83f0eba123e7da.js 29 kB ├ chunks/fd9d1056-4de4c9f7a62437cd.js 53.4 kB └ other shared chunks (total) 2.53 kB ƒ Middleware 26.8 kB λ (Dynamic) server-rendered on demand using Node.js And I was wondering if it's a good practice to do things like that.
Can u make a video on login with GitHub or Google along with Sign in using email and password in next auth.
Nice. Just wanted the solution and got it.
Glad to hear that!
hello
Hi 👋🏼
she is the best
Absolutely!
Do you think the App Router is still a good choice for apps that don't do any server stuff themselves? Like connecting to an external BFF and interacting with it through client components?
Absolutely! First of all, the app router is not just for using server components, there is nothing wrong with using client components at all. Secondly, even client-side apps have parts that are static and can be served from the server like layouts, with new features like partial pre-rendering I think the app router is the way to go no matter what.
thanks, its work
Welcome 👍
The theme provider adds the dark or light class that then throws this error: Prop `className` did not match. Server: "__className_3a0388 dark" Client: "__className_3a0388" Any help with a fix?
Clone my code and see what you're doing differently. For additional resource read here → github.com/pacocoursey/next-themes?tab=readme-ov-file#avoid-hydration-mismatch
@@hamedbahram Cool I'll check it out. Thank you! Great videos.
@@hamedbahram The solution as far as I can tell was the use of supressHydrationWarning in the <html return of the root layout.ts
Amazing talk. ♥ Thanks
My pleasure!
I can't see the reason why the NextJS team is fighting so hard to keep caching as a default. In my opinion the first and most important goal of any project is to have something working reliably and performance is only secondary.
I agree that reliability should come first and performance second; however, I think NextJs, and specifically caching is pretty stable. I think the problem is more the decoupling of data fetching and rendering work that may have complicated the adoption for some developers who are used to the APIs in the `pages` router.
Congratulations for 111k 🎉 Learned a lot from u and also enjoyed this podcast ❤🤗
Thank you so much 😊 I'm glad you enjoyed the conversation with Delba!
Which theme or font are you using on VsCode? I like it.
Theme: Dark+ Italic and the font is Operator mono
Thx for content Mr. Next js, gr from Netherlands
Absolutely 😅
First time seeing Delba in not black😅😅
That's right! Some shades of blue for the love of React :)
Great content like always!
Appreciate it!
Hi Hamed, I just noticed you passed 100k! Wow, congratulations!
Thank you!
Finally someone talking about custom themes...
There you have it :)
For incase this help anyone: Wanted to pull my hair out because locally (using ngrok) all worked 100, but when deployed to vercel, i did not even see the request coming in (logs) and just failures in Clerk. Turns out if you have Attack Challenge Mode turned on in Vercel (Settings=>Security) it seems to block out incoming request from Vercel (funny enough, I did a little test a while ago scraping my own site with selenium/coypu and could scrape my site with Attack Challenge Mode enabled)
Dear Hamed, having you as a connection on LinkedIn and knowing you’ve been in the English speaking part of the world for only a decade, I find it beyond impressive how fluently and effortlessly you speak the language! Not to mention the impact you have on web devs despite coming from a different background 🎉
Aww thank you, that's very nice, I appreciate that! I'm glad I've been able to help. Who do I have the pleasure of speaking with?
@@hamedbahram It's Nojan 🙂Connected with you in the recent months 🙌
@@tiltMOD My pleasure, Nojan! Glad to have connected with you.
Delba Oliveira looks like she is ever smiling. I watched the podcast instead of listen because of her😂
She is amazing!
Great talk hamed Jan with Oliveira ❤❤❤
My pleasure!
Great talk, thanks 🙏
My pleasure!
Amazing ❤, Thanks to Hamed and Delba😊
Absolutely! Thanks for tuning in!
❤
❤️
Does this component handle the condition to run only in production? or should I put a condition manually to run on prod only? Thank you!
You have to do that manually by excluding the traffic from your dev domains or local host in your Google analytics.
Great stuff. Thank you!
Glad it was helpful!
Thank you Hamed. I really appreciate your clear measured delivery. I have problem I hope you can help me with. Everything works fine up to 16.5. If at that point I change something in the columns.tsx file e.g. header: "name" to header: "Name" and save; I see that the page momentarily re-renders as expected (i.e. with Name) then reverts back to the previous page (i.e. name) and I get a Hydration error "Text content did not match. Server: "Name" Client: "name". "Empty Cache and hard reload" does correct the text or clear the error. I have checked "disable cache" in Developer tools > Network. I have tried deleting .next directory Building and running in production makes the change (i.e. to Name). name to Name is a simple example for illustrative purposes, but I am struggling to develop the code, when in order to test I have to stop the development server, build production and restart development. I am using NextJS v14.2, React 18.3
My pleasure! I'm glad you found it helpful. As far as the hydration error, have you marked the `column.tsx` as a client component?
@@hamedbahram Thank you, yes (columns.tsx is marked 'use client'), I even made a new project and copied the shadUI code exactly. I think it may be a bug. I don't think I can post links here but there is a bug posted on the ShadUI GitHub page "DataTableDemo causes Hydration Error in Nextjs" and I have asked a question on StackExchange "NextJS ShadhUI datatable persistent cache".
SOLVED. I was running my development server 'behind' a proxy server (with cache enabled). I turned the cache off !!!!!
Thank you for the amazing video but if i have optional fields it's not working for that one how to solve it sir
What is an optional field, one that's not required you mean?
Can you help me how to use Swiper in ssr page in Nextjs14?
Swiper requires browser APIs and can only be used in client components.