A full-stack blogging platform built with the MERN stack (MongoDB, Express.js, React.js, Node.js).
- Create and publish blog posts with images
- Form validation for all inputs
- Responsive design using Bootstrap
- Modern UI with custom CSS styling
- Image upload and storage
- View all blog posts in a grid layout
- Real-time updates
- Node.js (v14 or higher)
- MongoDB (v4.4 or higher)
- npm or yarn package manager
- Clone the repository:
git clone <repository-url>
cd mern-blog-platform- Install backend dependencies:
npm install- Install frontend dependencies:
cd client
npm install
cd ..- Create an
uploadsdirectory in the root folder:
mkdir uploads-
Start MongoDB service on your machine
-
Start the backend server (from the root directory):
npm run dev- In a new terminal, start the frontend development server:
npm run clientThe application will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
mern-blog-platform/
├── client/ # React frontend
│ ├── public/
│ └── src/
│ ├── components/ # React components
│ ├── App.js # Main App component
│ └── App.css # Custom styles
├── models/ # MongoDB models
├── routes/ # Express routes
├── uploads/ # Image upload directory
├── server.js # Express server
└── package.json # Project dependencies
-
Frontend:
- React.js
- React Router
- Bootstrap
- Axios
- Custom CSS
-
Backend:
- Node.js
- Express.js
- MongoDB
- Mongoose
- Multer (for file uploads)
GET /api/posts- Get all blog postsPOST /api/posts- Create a new blog postGET /api/posts/:id- Get a specific blog post
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request