A clean, modern, and responsive blogging platform.
Built with Next.js 14, MongoDB Atlas, Tailwind CSS, and React-Quill.
Test Admin Account:
Email:[email protected]
Password:admin@123
- πΌοΈ Beautiful UI: Glassmorphism, smooth animations, mobile-first
- π Secure Admin Auth: NextAuth.js + bcrypt, JWT sessions
- βοΈ Rich Content: WYSIWYG editor, SEO-friendly slugs
- ποΈ Full CRUD: Publish, update, delete posts (admin)
- β‘ SEO & Performance: SSR, image optimization, dynamic meta tags
- π¨βπ» Dev Experience: TypeScript, clean architecture, error handling
Show Setup Instructions
- Node.js v18+
- MongoDB Atlas (free-tier)
- Git
git clone https://github.com/thefznkhan/nextblog.git
cd nextblog
npm install
Create .env.local
:
MONGODB_URI=your-mongodb-connection-string
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-32-byte-secret
NEXT_PUBLIC_BASE_URL=http://localhost:3000
npm run dev
Visit http://localhost:3000
Tool | Purpose |
---|---|
Next.js 14 | Full-stack React framework |
React 18 | Frontend library |
MongoDB | Cloud database |
Mongoose | MongoDB ODM |
NextAuth.js | Authentication |
React-Quill | Rich text editing |
Tailwind CSS | Styling |
bcryptjs | Password hashing |
Show API Endpoints
GET /api/posts
β List all postsPOST /api/posts
β Create post (admin)GET /api/posts/[slug]
β Get single postPUT /api/posts/[slug]
β Update post (admin)DELETE /api/posts/[slug]
β Delete post (admin)
GET /api/admin/setup
β Check if admin existsPOST /api/admin/setup
β Create initial admin
- MongoDB: Whitelist your IP in Atlas
- NEXTAUTH_SECRET: Must be consistent for sessions
- Tailwind: Customize in
tailwind.config.js
- MongoDB connection error: Check
.env.local
, whitelist IP - NextAuth JWT errors: Ensure
NEXTAUTH_SECRET
is set, clear cookies - Tailwind issues: Run
rm -rf .next
and restart
- Fork the repo
- Branch:
git checkout -b feat/your-feature
- Develop & Test
- Lint/Test:
npm run lint && npm test
- Pull Request
This project is MIT licensed β see LICENSE.
Thanks to the Next.js, MongoDB, Tailwind CSS, and React-Quill communities!
Made with β€οΈ by THEFZNKHAN.
If you enjoy this project, please β star on GitHub!