Uploaded October 2024 | Updated December 2026, 3 hours ago
In this video, we'll build a Medium clone using NextJs, Convex, and Clerk. We'll use the Convex real-time database to get immediate updates and file storage to store our images conveniently. We'll integrate Clerk with Convex to access the auth context in our Convex functions. We'll also use a webhook to store user data in our Convex database.
👉🏼 Project source code
→ hamedbahram.io/notes/medium-clone
👉🏼 NextJs Clerk starter template
→ github.com/HamedBahram/next-clerk
👉🏼 Live demo
→ https://medium-clone-eight-ebon.vercel.app
👉🏼 Convex
→ https://convex.dev/c/hamed
👉🏼 Clerk auth
→ clerk.com
👉🏼 My courses
→ hamedbahram.io/courses
👉🏼 Work with me
→ hamedbahram.io/contact
Chapters:
00:00:00 Intro
00:05:00 Setting up Clerk
00:15:30 Setting up Convex
00:28:10 Adding Clerk auth to Convex
00:35:25 Storing user data in Convex
00:43:30 Defining users schema and functions
00:59:00 Creating an HTTP endpoint
01:06:00 Defining posts schema and the create post form
01:30:00 Uploading a file to Convex storage
01:37:50 Defining posts query functions
01:49:50 Creating dynamic slug page
01:53:50 Using convex in server components
01:59:34 Building the home page
02:11:00 Recap
In this video, we'll build a Medium clone using NextJs, Convex, and Clerk. We'll use the Convex real-time database to get immediate updates and file storage to store our images conveniently. We'll integrate Clerk with Convex to access the auth context in our Convex functions. We'll also use a webhook to store user data in our Convex database.
👉🏼 Project source code
→ hamedbahram.io/notes/medium-clone
👉🏼 NextJs Clerk starter template
→ github.com/HamedBahram/next-clerk
👉🏼 Live demo
→ https://medium-clone-eight-ebon.vercel.app
👉🏼 Convex
→ https://convex.dev/c/hamed
👉🏼 Clerk auth
→ clerk.com
👉🏼 My courses
→ hamedbahram.io/courses
👉🏼 Work with me
→ hamedbahram.io/contact
Chapters:
00:00:00 Intro
00:05:00 Setting up Clerk
00:15:30 Setting up Convex
00:28:10 Adding Clerk auth to Convex
00:35:25 Storing user data in Convex
00:43:30 Defining users schema and functions
00:59:00 Creating an HTTP endpoint
01:06:00 Defining posts schema and the create post form
01:30:00 Uploading a file to Convex storage
01:37:50 Defining posts query functions
01:49:50 Creating dynamic slug page
01:53:50 Using convex in server components
01:59:34 Building the home page
02:11:00 Recap








![Protecting routes in NextJs using Clerk middleware [6/6]
Using Clerk middleware to protect your routes in NextJs. The clerkMiddleware() integrates Clerk authentication through NextJs middleware.
👉🏼 Clerk auth
→ https://go.clerk.com/s1mVa9u
👉🏼 Learn Clerk
→ https://www.hamedbahram.io/courses/clerk Protecting routes in NextJs using Clerk middleware [6/6]](https://i.ytimg.com/vi/CCdf-TBbRmA/mqdefault.jpg)

