A feature-rich blog application built with MongoDB, Express.js, React, and Node.js
Features • Demo • Installation • Tech Stack • Contributing
| Feature | Description |
|---|---|
| 📝 Blog Post Summaries | Auto-generated summaries for blog posts displayed in previews |
| 🏆 Author Badges System | Gamification badges that reward authors for achievements (FIXED: Now awards properly!) |
| 🎯 Milestones System | Track long-term progress with 20+ milestones |
| 👑 Admin Dashboard | Complete admin panel to manage users, roles, and view statistics |
Before you begin, ensure you have the following installed:
git clone https://github.com/yourusername/MERN-Blog.git
cd MERN-Blogcd backend
npm installCreate a .env file in the backend directory:
PORT=5000
MONGO_URI=your_mongodb_connection_string
SECRET_KEY=your_jwt_secret_key
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
FRONTEND_URL=http://localhost:5173cd ../frontend
npm installCreate a .env file in the frontend directory:
VITE_API_URL=http://localhost:5000/apicd backend
npm startBackend will run on
http://localhost:5000
cd frontend
npm run devFrontend will run on
http://localhost:5173
Backend Environment Variables
| Variable | Description |
|---|---|
PORT |
Port number for backend server |
MONGO_URI |
MongoDB connection string |
SECRET_KEY |
Secret key for JWT token generation |
CLOUDINARY_CLOUD_NAME |
Your Cloudinary cloud name |
CLOUDINARY_API_KEY |
Your Cloudinary API key |
CLOUDINARY_API_SECRET |
Your Cloudinary API secret |
FRONTEND_URL |
Frontend URL for CORS configuration |
Frontend Environment Variables
| Variable | Description |
|---|---|
VITE_API_URL |
Backend API base URL |
After starting both servers:
- Visit
http://localhost:5173/setup - Click "Initialize All" button
- Wait for success confirmation ✅
- Navigate to
/dashboard/achievementsto see badges and milestones
- ✅ User authentication (register/login)
- ✅ Create, edit, delete blog posts
- ✅ Publish/unpublish blogs
- ✅ Comment on blogs
- ✅ Like blogs and comments
- ✅ User profiles with social links
- ✅ Image uploads via Cloudinary
- 📝 Auto-generated blog summaries - Concise previews on blog cards
- 🏆 Author badges system - 8 achievement badges (First Post, Trending, Top Rated, etc.) ✅ Fixed awarding!
- 🎯 Milestones tracking - 20+ milestones across 5 categories
- 👁️ View tracking - Track total and unique blog views
- 📊 Author statistics - Automatic tracking of blogs, views, likes, comments
- 📈 Progress visualization - Progress bars and completion indicators
- 🎮 Gamification dashboard - Unified view of achievements
- 🔧 Make Admin - Promote any user to admin role
- ⬇️ Remove Admin - Demote admin back to user
- 👥 View All Users - Complete user list with blog/comment statistics
- 📊 Dashboard Stats - Real-time platform metrics
- 🔒 Protected Routes - Admin-only access control
- ⚡ Easy Setup - Simple script to make first admin:
node backend/makeAdmin.js your-email@gmail.com
📦 Complete Tech Stack
Frontend:
- React - UI library
- Redux Toolkit - State management
- Vite - Build tool
- Radix UI - Component library
- TailwindCSS - Styling
- Lucide React Icons - Icons
Backend:
- Node.js - Runtime environment
- Express - Web framework
- MongoDB & Mongoose - Database
- JWT Authentication - Security
- Cloudinary - Image storage
- Bcrypt - Password hashing
Authors can earn these badges:
| Badge | Name | Requirement |
|---|---|---|
| 🏅 | First Post | Publish your first blog |
| 🔥 | Trending Author | Get 100+ views |
| 🚀 | Viral Creator | Get 1000+ views |
| ✍️ | Consistent Writer | Maintain a 4-week streak |
| 📝 | Dedicated Writer | Maintain a 12-week streak |
| ⭐ | Top Rated | Receive 50 total likes |
| 🌟 | Highly Acclaimed | Receive 200 total likes |
| 🧠 | Expert Contributor | Publish 10 posts in one category |
| Category | Milestones |
|---|---|
| 📌 Blogs Published | 10, 20, 50, 100 posts |
| 👁️ Total Views | 100, 500, 1K, 10K, 100K views |
| 💬 Comments Received | 10, 50, 100, 500 comments |
| 📅 Active Time | 1, 3, 6, 12 months |
| 🌍 Global Reach | 10, 50, 100, 500 unique readers |
Contributions are welcome! Please feel free to submit a Pull Request.
-
Fork the repository
git clone https://github.com/Saurabhtbj1201/BuildNotes.git
-
Create your feature branch
git checkout -b feature/AmazingFeature
-
Commit your changes
git commit -m 'Add some AmazingFeature' -
Push to the branch
git push origin feature/AmazingFeature
-
Open a Pull Request
This project is open source and available under the MIT License.
A passionate developer focused on automation, AI, and building scalable solutions for real-world problems.
This project represents my commitment to leveraging modern technologies to streamline e-commerce operations and enhance customer experiences.
Full-Stack Development • MERN Stack • API Integration • Cloud Services • UI/UX Design • Database Management • DevOps • AI & Automation