A full-stack blog application built with the MERN stack (MongoDB, Express.js, React.js, Node.js).
- User authentication and authorization
- Create, read, update, and delete blog posts
- Responsive design
- Rich text editor for blog posts
- Comment system
- User profiles
- Search functionality
- Frontend: React.js, Material-UI, Redux
- Backend: Node.js, Express.js
- Database: MongoDB
- Authentication: JWT (JSON Web Tokens)
📦 mern-blog-website/
├── 📄 LICENSE.txt
├── 📄 README.md
├── 📂 blog-frontend/
└── 📂 blog-backend/
📂 blog-frontend/
├── 📄 package.json
├── 📄 package-lock.json
├── 📄 README.md
├── 📄 .gitignore
│
├── 📂 public/
│ ├── 📄 index.html
│ ├── 📄 favicon.ico
│ ├── 📄 manifest.json
│ └── 📄 robots.txt
│
└── 📂 src/
├── 📄 App.js
├── 📄 App.css
├── 📄 App.test.js
├── 📄 index.js
├── 📄 index.css
├── 📄 logo.svg
├── 📄 reportWebVitals.js
├── 📄 setupTests.js
│
├── 📂 components/
│ ├── 📄 Footer.js
│ ├── 📄 Header.js
│ └── 📄 Post.js
│
└── 📂 pages/
├── 📄 About.js
├── 📄 CategoryPosts.js
├── 📄 Contact.js
├── 📄 Home.js
├── 📄 PostDetail.js
├── 📄 PostList.js
├── 📄 Privacy.js
└── 📄 Terms.js
📂 blog-backend/
├── 📄 package.json
├── 📄 package-lock.json
├── 📄 server.js
│
├── 📂 models/
│ ├── 📄 Category.js
│ └── 📄 Post.js
│
└── 📂 routes/
├── 📄 categories.js
└── 📄 posts.js
- Node.js (v14 or higher)
- MongoDB
- npm or yarn
- Clone the repository
git clone https://github.com/HARIHARANS24/mern-blog-website.git
cd mern-blog-website
- Install backend dependencies
cd blog-backend
npm install
- Install frontend dependencies
cd ../blog-frontend
npm install
- Create a
.env
file in the backend directory with the following variables:
MONGODB_URI=your_mongodb_uri
JWT_SECRET=your_jwt_secret
PORT=5000
- Start the backend server
cd blog-backend
npm start
- Start the frontend development server
cd blog-frontend
npm start
MONGODB_URI
: MongoDB connection stringJWT_SECRET
: Secret key for JWT token generationPORT
: Backend server port (default: 5000)
REACT_APP_API_URL
: Backend API URL
POST /api/auth/register
- Register a new userPOST /api/auth/login
- Login userGET /api/auth/profile
- Get user profile
GET /api/posts
- Get all postsGET /api/posts/:id
- Get single postPOST /api/posts
- Create new postPUT /api/posts/:id
- Update postDELETE /api/posts/:id
- Delete post
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- 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 licensed under the MIT License - see the LICENSE.txt file for details.
- HARIHARANS24 - Initial work - GitHub Profile
- Thanks to all contributors who have helped shape this project
- Special thanks to the MERN stack community for their excellent documentation and support