Skip to content

This project is a fully-featured Blog Management System (BMS) backend built with Node.js, Express, MongoDB, and Redis.

License

Notifications You must be signed in to change notification settings

haidarburaq/bms-backend-mongodb

Repository files navigation

BMS Backend MongoDB 🚀

BMS Backend

Welcome to the BMS Backend MongoDB project! This repository contains a fully-featured Blog Management System (BMS) backend built with Node.js, Express, MongoDB, and Redis.

Table of Contents

Overview

The BMS Backend serves as a robust foundation for building a blog management system. It provides all the necessary functionalities to create, read, update, and delete blog posts, manage users, and handle comments. This project aims to deliver a seamless experience for developers looking to implement a blog management solution.

Features

  • RESTful API: Follow the REST architecture for clean and structured API design.
  • JWT Authentication: Secure user authentication using JSON Web Tokens.
  • Rate Limiting: Prevent abuse by limiting the number of requests a user can make.
  • MongoDB Integration: Store and manage data efficiently with MongoDB.
  • Redis Caching: Improve performance by caching frequently accessed data.
  • User Management: Handle user registration, login, and profile management.
  • Blog Management: Create, update, and delete blog posts easily.
  • Comment System: Allow users to comment on blog posts.

Technologies Used

  • Node.js: JavaScript runtime for building server-side applications.
  • Express: Fast web framework for Node.js.
  • MongoDB: NoSQL database for storing data in a flexible format.
  • Redis: In-memory data structure store for caching.
  • JWT: For secure user authentication.

Installation

To get started with the BMS Backend, follow these steps:

  1. Clone the repository:

    git clone https://github.com/haidarburaq/bms-backend-mongodb.git
  2. Navigate to the project directory:

    cd bms-backend-mongodb
  3. Install the dependencies:

    npm install
  4. Create a .env file in the root directory and set the necessary environment variables. You can refer to the .env.example file for guidance.

  5. Start the server:

    npm start

Your server should now be running on http://localhost:3000.

Usage

After setting up the project, you can interact with the API using tools like Postman or cURL. Make sure to authenticate your requests where necessary.

API Endpoints

Here are some key API endpoints you can use:

  • User Registration: POST /api/users/register
  • User Login: POST /api/users/login
  • Get All Posts: GET /api/posts
  • Create a Post: POST /api/posts
  • Update a Post: PUT /api/posts/:id
  • Delete a Post: DELETE /api/posts/:id
  • Add a Comment: POST /api/posts/:id/comments

Rate Limiting

To prevent abuse of the API, we have implemented rate limiting. Users can make a limited number of requests within a specified time frame. If the limit is exceeded, the server will respond with a 429 Too Many Requests status.

Authentication

The BMS Backend uses JWT for user authentication. Upon successful login, users receive a token that must be included in the headers of protected routes. Here's how to do it:

  1. Log in using the /api/users/login endpoint.

  2. Store the received token.

  3. Include the token in the Authorization header for subsequent requests:

    Authorization: Bearer <your_token>
    

Contributing

We welcome contributions to the BMS Backend project! If you have ideas for improvements or new features, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature.
  3. Make your changes and commit them.
  4. Push to your branch.
  5. Create a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Releases

For the latest updates and releases, please visit our Releases section. Here, you can find the latest versions of the project along with release notes.

Contact

If you have any questions or feedback, feel free to reach out:

Thank you for checking out the BMS Backend MongoDB project! We hope it serves your needs well. For more information, please refer to the Releases section.

About

This project is a fully-featured Blog Management System (BMS) backend built with Node.js, Express, MongoDB, and Redis.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •