This is a full-stack blogging application developed using the MERN stackβMongoDB, Express, React, and Node.js. It allows users to securely register and log in, create blog posts, edit existing content, and delete posts when needed.
The application implements JWT-based authentication to protect user data and restrict access to authorized actions. It also features dynamic routing for seamless navigation between pages, along with a responsive and user-friendly interface.
π Live Site URL : Click Here
- Frontend: GitHub Pages
- Backend: Render
- Database: MongoDB Atlas
- Frontend: React, React Router, Context API, Axios
- Backend: Node.js, Express.js
- Database: MongoDB (with Mongoose)
- Authentication: JSON Web Token (JWT)
- Secure user authentication with registration and login
- Full CRUD functionality for blog posts
- Detailed individual post view
- JWT based Authentication and Authorization
- Context-based state management for posts and notifications
- Fully Responsive User Interface
- Support for Light and Dark themes
- Like system for posts
- Reusable global loader component
- Menu dropdown for quick access to profile, dashboard and logout options
- Account deletion option with confirmation handling
Blog-Post-App/
βββ backend/
β βββ controllers/
β β βββ authController.js
β β βββ commentController.js
β β βββ dashboardController.js
β β βββ postController.js
β β βββ profileController.js
β βββ middleware/
β β βββ authMiddleware.js
β βββ models/
β β βββ Comment.js
β β βββ Post.js
β β βββ User.js
β βββ package-lock.json
β βββ package.json
β βββ routes/
β β βββ authRoutes.js
β β βββ commentRoutes.js
β β βββ dashboardRoutes.js
β β βββ postRoutes.js
β β βββ profileRoutes.js
β βββ server.js
βββ frontend/
β βββ context/
β β βββ AuthContext.jsx
β β βββ LoaderContext.jsx
β β βββ NotificationContext.jsx
β β βββ PostsContext.jsx
β β βββ ThemeContext.jsx
β βββ eslint.config.js
β βββ index.html
β βββ package-lock.json
β βββ package.json
β βββ screenshots/
β β βββ AddPostPage.png
β β βββ Comment_Section.png
β β βββ EditPostPage.png
β β βββ HomePage.png
β β βββ HomePage_Login.png
β β βββ LoginPage.png
β β βββ PostDetails.png
β β βββ RegisterPage.png
β βββ src/
β β βββ App.jsx
β β βββ components/
β β β βββ Avatar/
β β β β βββ Avatar.css
β β β β βββ Avatar.jsx
β β β βββ Comment/
β β β β βββ Comment.jsx
β β β β βββ CommentList.jsx
β β β β βββ CommentStyles.css
β β β βββ Loader/
β β β β βββ Loader.css
β β β β βββ Loader.jsx
β β β βββ Navbar/
β β β β βββ Navbar.css
β β β β βββ Navbar.jsx
β β β βββ Notification/
β β β βββ Notification.css
β β β βββ Notification.jsx
β β βββ main.jsx
β β βββ pages/
β β β βββ CreatePost/
β β β β βββ CreatePost.css
β β β β βββ CreatePost.jsx
β β β βββ Dashboard/
β β β β βββ Dashboard.css
β β β β βββ Dashboard.jsx
β β β β βββ StatisticCard.jsx
β β β βββ EditPost/
β β β β βββ EditPost.css
β β β β βββ EditPost.jsx
β β β βββ HomePage/
β β β β βββ HomePage.css
β β β β βββ HomePage.jsx
β β β βββ Login/
β β β β βββ Login.css
β β β β βββ Login.jsx
β β β βββ PostDetails/
β β β β βββ PostDetails.css
β β β β βββ PostDetails.jsx
β β β βββ Profile/
β β β β βββ Profile.css
β β β β βββ Profile.jsx
β β β βββ Register/
β β β βββ Register.css
β β β βββ Register.jsx
β β βββ styles.css
β β βββ utils/
β β βββ axios.js
β β βββ formatDate.js
β β βββ formatTime.js
β βββ vite.config.js
βββ README.md
git clone https://github.com/VRYeshwanth/Blog-Post-App.git
cd Blog-Post-Appcd backend
npm installcd frontend
npm installPORT=3000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_keycd backend
npm run devcd frontend
npm run devThe app will run on :
- Frontend:
http://localhost:5173 - Backend:
http://localhost:3000
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Register a new user |
| POST | /api/auth/login |
Log in an existing user |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/profile |
Get the logged-in user profile |
| PATCH | /api/profile |
Update the profile details of the logged-in user |
| DELETE | /api/profile |
Delete the user account |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/posts |
Fetch all posts |
| POST | /api/posts |
Create a new post |
| PATCH | /api/posts/:id |
Update an existing post |
| DELETE | /api/posts/:id |
Delete a post |
| PATCH | /api/posts/:id/like |
Like or unlike a post |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/comments/:postId |
Fetch all comments of a given post |
| POST | /api/comments |
Add a comment to a post |
| PATCH | /api/comments/:id |
Update an existing comment |
| DELETE | /api/comments/:id |
Delete a comment |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/dashboard |
Fetch dashboard overview data |
Here are some screenshots of the MERN Blog App in action:
Before Login:
After Login:
Contributions are welcome!
If you'd like to improve this project:
- Fork the repository
- Create a new branch
- Make your changes
- Submit a pull request









