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