A modern, fully responsive blog platform built with Next.js, Sanity CMS, Tailwind CSS, Shadcn-UI, and TypeScript. The platform allows you to manage and publish content dynamically, with a sleek UI and optimized performance for all devices.
You can see a live demo of this blog platform here.
Follow these instructions to set up and run the project locally.
Clone the repository:
git clone https://github.com/your-username/your-blog-repo.git
cd your-blog-repo
Install dependencies:
pnpm install
Set up the Sanity CMS backend:
Install Sanity CLI if you don’t have it:
npm install -g @sanity/cli
Initialize Sanity:
sanity init
Follow the prompts to set up the project with your preferred settings.
Configure environment variables:
Create a .env.local
file in the root directory and add the following:
NEXT_PUBLIC_SANITY_PROJECT_ID=your-project-id
NEXT_PUBLIC_SANITY_DATASET=your-dataset-name
SANITY_API_TOKEN=your-sanity-token
Run the development server:
pnpm dev
Your blog should now be running at http://localhost:3000.
.
├── sanity # Sanity CMS configuration
├── src
│ ├── components # UI components built with Shadcn-UI
│ ├── pages # Next.js pages (Home, Blog, Post, etc.)
│ ├── styles # Global and Tailwind CSS styles
│ ├── types # TypeScript types and interfaces
│ └── utils # Utility functions (API fetch, helpers)
├── public # Static assets (images, fonts)
├── .env.local # Environment variables (not tracked)
└── package.json # Project dependencies and scripts
This project is set up to deploy on Vercel. Follow these steps to deploy:
Install the Vercel CLI:
npm i -g vercel
Link your project to Vercel:
vercel
Follow the prompts to link your Vercel account and project.
Deploy:
vercel --prod
You can modify the design and layout easily using Tailwind CSS. The tailwind.config.js
file allows you to extend or customize the default settings.
To add or update blog content, use the Sanity Studio UI. You can customize the schemas in the sanity/schemas
folder to add more content types or fields.
The UI components are built using Shadcn-UI. You can modify the design by editing the component files in the src/components
folder.
The project is built with TypeScript, ensuring better code reliability, improved developer experience, and fewer runtime errors. You can add or modify types and interfaces in the src/types
folder.
If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.
git checkout -b my-feature
git commit -m 'Add my feature'
git push origin my-feature
This project is licensed under the MIT License - see the LICENSE file for details.
This README.md
now reflects the use of TypeScript. Feel free to adjust it as needed!