A full-stack blog platform built with the MERN stack (MongoDB, Express, React, Node.js).
- 📝 Create, edit, and delete blog posts
- � User authentication (JWT)
- 👤 Users can publish their own posts
- 🔍 Search and filter by tags/categories
- 📱 Responsive dark theme UI
- ⚡ Markdown support for blog content
Frontend: React, Vite, Tailwind CSS
Backend: Node.js, Express, MongoDB, JWT
- Node.js v18+
- MongoDB (local or Atlas)
- Clone the repo
git clone https://github.com/yourusername/blogpost.git
cd blogpost- Install dependencies
# Backend
cd server
npm install
# Frontend
cd ../client
npm install- Set up environment variables
# In /server, create .env file
cp .env.example .env
# Edit .env with your MongoDB URI and JWT secrets- Seed sample data (optional)
cd server
npm run seed- Run the app
# Terminal 1 - Backend
cd server
npm run dev
# Terminal 2 - Frontend
cd client
npm run devAfter seeding:
- Admin: admin@blog.com / Admin@123
- User: john@blog.com / User@123
blogpost/
├── client/ # React frontend
│ └── src/
│ ├── components/
│ ├── pages/
│ ├── services/
│ └── context/
└── server/ # Express backend
└── src/
├── controllers/
├── models/
├── routes/
└── services/
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register | Register user |
| POST | /api/auth/login | Login |
| GET | /api/blogs | Get all blogs |
| GET | /api/blogs/:slug | Get single blog |
| POST | /api/blogs | Create blog (auth) |
| PUT | /api/blogs/:id | Update blog (auth) |
| DELETE | /api/blogs/:id | Delete blog (auth) |
MIT