This is a next-blog app that allows users to create, edit, and publish their own blog posts, as well as browse and comment on other posts. The blog app also features a responsive design, a user authentication system, and a rich text editor. This app is built with Next.js, Tailwind CSS, TypeScript, and MongoDB.
This project uses the following technologies:
- [Next.js]: A React framework for building fast and scalable web applications.
- [Tailwind CSS]: A utility-first CSS framework for rapidly building custom designs.
- [TypeScript]: A superset of JavaScript that adds static types and other features.
- [MongoDB]: A document-based database that stores data in JSON-like format.
- [NextAuth.js]: A library for implementing authentication and authorization in Next.js apps.
- [React Query]: A library for fetching, caching, and updating data in React apps.
- [React Hook Form]: A library for building forms with React hooks.
- [Redux toolkit]: A library for managing and centralizing application state.
- Create, edit, and delete blog posts using Markdown
- Preview your blog posts before publishing
- Add tags and images to your blog posts
- Follow topics and authors that interest you
- Comment on blog posts and join discussions
- React to blog posts with emojis
- Bookmark blog posts for later reading
- View your profile and stats
- Edit your profile and settings
- View the latest, top, and trending blog posts
To run this project locally, you need to have Node.js, npm, and MongoDB installed on your machine.
- Clone this repo to your local machine using
git clone https://github.com/tehseen01/nextjs-blog.git
- Navigate to the project directory using
cd nextjs-blog
- Install the dependencies using
npm install
- Create a
.env
file in the root directory and add the following variables:MONGO_URI
: The connection string to your MongoDB databaseJWT_SECRET
: The secret key for JSON Web Token authenticationCLOUDINARY_URL
: The connection string to your Cloudinary account for image uploading
- Start the development server using
npm run dev
- Open your browser and go to
http://localhost:3000
to view the app
To use this app, you need to create an account or log in with an existing one.
To create a new blog post, follow these steps:
- Click on the create a post button on the top right corner of the homepage
- Enter a title and write your content using Markdown syntax
- Add tags and an image to your post if you want
- Click on the Preview button to see how your post will look like
- Click on the Save draft button to save your post as a draft or click on the Publish button to publish your post
To edit or delete an existing blog post, follow these steps:
- Go to your profile page and click on the Dashboard tab
- Find the blog post you want to edit or delete and click on the Edit or Delete button
- Make the changes you want or confirm the deletion
To follow topics or authors, follow these steps:
- Go to the homepage and click on the Topics tab
- Browse through the topics and click on the ones you want to follow
- Go to any blog post and click on the author's name or profile picture
- Click on the Follow button on their profile page
To comment on blog posts or join discussions, follow these steps:
- Go to any blog post and scroll down to the Comments section
- Write your comment in the text box and click on the Submit button
- Reply to other comments or react with emojis
To bookmark blog posts for later reading, follow these steps:
- Go to any blog post and click on the Bookmark icon on the bottom right corner of the post
- Go to your profile page and click on the Reading list tab
- View your bookmarked posts and click on them to read them
To view your profile and stats, follow these steps:
- Go to your profile page by clicking on your profile picture on the top right corner of any page
- Click on the Profile tab to see your basic information, bio, skills, social links, etc.
- Click on the Stats tab to see your post views, reactions, comments, followers, etc.
To edit your profile and settings, follow these steps:
- Go to your profile page by clicking on your profile picture on the top right corner of any page
- Click on the Settings tab to see your account settings, email preferences, notifications, etc.
- Make the changes you want and click on the Save changes button
To view the latest, top, and trending blog posts, follow these steps:
- Go to the homepage and click on the Latest, Top, or Trending tabs
- Browse through the blog posts and click on them to read them
This project is open for contributions. If you want to contribute to this project, please follow these guidelines:
- Fork this repository and create a new branch for your feature or bug fix.
- Write clear and descriptive commit messages and pull request titles.
- Follow the code style and conventions of the project.
- Commit and push your changes to GitHub
- Test your code before submitting a pull request.
- Respect the code of conduct and be kind to other contributors.
This project is licensed under the MIT License - see the LICENSE file for details.
If you have any questions or feedback about this project, feel free to contact me at [email protected].