Building and Deploying a BLOG Website with Next.js, Sanity, TypeScript, Tailwind CSS, Authjs, CMS, and Vercel
If you’re looking to build and deploy a modern, customizable blog website, you’ve come to the right place. In this article, we’ll walk through how to use Next.js, Sanity, TypeScript, Tailwind CSS, Authjs, a CMS, and Vercel to create a beautiful and functional blog website.
Step 1: Setting Up the Project
First, you’ll need to set up your project using Next.js, a popular React framework for building web applications. You can do this by running the following command in your terminal:
npx create-next-app my-blog
This will create a new Next.js project with all the necessary files and dependencies.
Step 2: Integrating Sanity
Next, you’ll want to integrate Sanity, a headless CMS that allows you to create and manage content for your blog. To do this, you can use the Sanity CLI to create a new project:
npx create-sanity my-blog
Then, you can use the sanity
command in your terminal to start managing content for your blog.
Step 3: Adding TypeScript and Tailwind CSS
Now that you have your project set up and your CMS integrated, you can add TypeScript for type safety and Tailwind CSS for styling. You can install these by running the following commands:
npm install --save-dev typescript @types/react @types/node
npm install tailwindcss
You’ll also need to set up the Tailwind CSS configuration and create a styles file for your blog website.
Step 4: Implementing Authjs for Authentication
If you want to add user authentication to your blog, you can use Authjs, a simple and secure authentication service. You can install and integrate Authjs by following the documentation on their website.
Step 5: Building and Deploying with Vercel
Finally, once your blog website is built, styled, and integrated with your preferred CMS and authentication service, you can deploy it with Vercel, a cloud platform for deploying websites and serverless functions.
You can deploy your project by linking it to your Vercel account and running the deployment command in your terminal:
vercel
And that’s it! You’ve now built and deployed a blog website using Next.js, Sanity, TypeScript, Tailwind CSS, Authjs, a CMS, and Vercel. Your website is ready to go live and start sharing your content with the world.
Thank you for your kindness
I ‘m beginner in all fields including nextjs sanity.
Still I’m slowly following your video, but it’s not progressing after encountering an error at 1:02:47
What’s the problem
The contents of the error are
Unable to resolve image URL from source (undefined)
import Image from ‘next/image’
<Image src={urlFor(post.mainImage).url()!}
.url() this is 😂
This is amazing and I’d love to get started but pls I have one question
How do you write the markup for the body of the post in Sanity?
you saved my time man. keep it up
out of all tutorials this is the best one I have seen so far, everything is explain so much in to the details and I really learned a lot from it. Thanks so much for the effort!
@Noor Mohammad
This is a really helpful tutorial for me. But in the Authentication part, I'm Facing some errors. How to resolve this error please help me because I want to continue this website
Error —>
Server error
There is a problem with the server configuration.
Check the server logs for more information.
can i get the finished app repo ?
hi Noor
you create awesome Blog webiste i have learn more this tutorial
i have an issue forUrl is type error ?
1:32 how did it automatically fetched data from undefined to value.. mine always shows undefined no value onto it ?? any fix did you missed on video ?
Eid mubarak vai❤❤
For me at the form. The id shows but the comments name and email doesn't show. I've tried everything. Thanks for the tutorial anyway
At 30:20 it showing error after copying that.
One question, why when I displayed my page did I get this error?
Server error
There is a problem with the server configuration.
Check the server logs for more information. : /
i following every step in this tutorial, and got error undefined when console.log please helpp
Thanks its amazing video,
Can you please give full app source code including sanity file
for the first part of sanity, How you make the structure of blog in first ?
Boss can u send a link for the updated GitHub repo?. It showing me only white screen after handleUserErr.
Thank you so much for creating this insightful tutorial on building a website with Next.js and Sanity! Your explanations were clear and concise, and I appreciate how you took the time to walk through each step of the process. I'm excited to continue learning from your channel and can't wait to see what other tutorials you have in store
Thanks Noor for that, I will see it after little but I wish you invest in a good mic because the sound is not the best, I want from you to recommend me some good resource to get deeper in Nextjs as I am newbie ?
I always like your videos Brother