Skip to content

The server-side application of the MERN Blog Website, utilizing Node.js and Express. This project handles API requests, manages database interactions, and provides backend support for blog post creation and management.

Notifications You must be signed in to change notification settings

asheint/mern-stack-blog-website-backend

Repository files navigation

MERN Stack Blog Website - Backend

A robust RESTful API backend for a blog website built with Node.js, Express.js, and MongoDB as part of a full MERN stack application.

🚀 Features

  • RESTful API - Clean and organized API endpoints
  • JWT Authentication - Secure user authentication
  • MongoDB Integration - NoSQL database with Mongoose ODM
  • File Upload - Image upload functionality with Multer
  • Password Hashing - Secure password storage with bcryptjs
  • CORS Enabled - Cross-origin resource sharing
  • Error Handling - Comprehensive error handling middleware

🛠️ Technologies Used

  • Node.js
  • Express.js
  • MongoDB
  • Mongoose
  • JWT (JSON Web Tokens)
  • bcryptjs
  • Multer
  • CORS
  • dotenv

📦 Installation

  1. Clone the repository:
git clone https://github.com/asheint/mern-stack-blog-website-backend.git
cd mern-stack-blog-website-backend
  1. Install dependencies:
npm install
  1. Create a .env file in the root directory:
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
PORT=5000
  1. Start the development server:
npm run dev

The server will run on http://localhost:5000

🔗 API Endpoints

Authentication

  • POST /api/users/register - Register new user
  • POST /api/users/login - User login
  • GET /api/users/profile - Get user profile

Posts

  • GET /api/posts - Get all posts
  • POST /api/posts - Create new post
  • GET /api/posts/:id - Get single post
  • PUT /api/posts/:id - Update post
  • DELETE /api/posts/:id - Delete post

🔗 Frontend Repository

This backend works with the MERN Stack Blog Website Frontend: https://github.com/asheint/mern-stack-blog-website

🤝 Contributing

Contributions, issues, and feature requests are welcome!

⭐ Show Your Support

If this project helped you, please consider:

📝 License

This project is licensed under the MIT License.


Star this repo if it helped you!

About

The server-side application of the MERN Blog Website, utilizing Node.js and Express. This project handles API requests, manages database interactions, and provides backend support for blog post creation and management.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published