This repository contains a full-stack blog application built with the MERN stack (MongoDB, Express, React, Node.js). It includes post creation, viewing, comments, favourites, and saved posts. User authentication is implemented manually using MongoDB for user storage.
-
User authentication (manual, with MongoDB + JWT)
- Sign up, log in, log out
- Password hashing with bcrypt
-
Create, edit, and delete blog posts
-
View single post details
-
Add and view comments on posts
-
Mark posts as favourites / remove from favourites
-
Save posts for later reading
-
Contact form / contact page
-
Responsive layout (mobile-friendly)
Frontend:
- React (Vite or Create React App)
- React Router for navigation
- Context API or Redux for global state
- Tailwind CSS or CSS modules for styling
Backend:
- Node.js
- Express.js
- MongoDB + Mongoose ODM
- JSON Web Tokens (JWT) for authentication
- bcrypt for password hashing
git clone https://github.com/aitezazdev/MERN-Blog-App.gitcd MERN-Blog-App
cd ./backend && npm install
cd ./frontend && npm installIn the backend/ folder, create a .env file:
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_key
Backend:
cd backend
npm run devFrontend:
cd frontend
npm run devOpen http://localhost:5173 for the frontend (or port from your setup) and http://localhost:3000 for the backend API.







