Giter Club home page Giter Club logo

manishtmtmt / blog-management-api Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 49 KB

This Node.js project is a backend service for a Blog Management Platform, providing essential functionalities for user management and blog post management. It utilizes Express.js, Bcryptjs, Jsonwebtoken, and Mongoose for efficient development.

Home Page: https://blog-management-api-nwkl.onrender.com/

JavaScript 100.00%
bcryptjs chai expressjs jsonwebtoken mocha mongodb mongoose nodejs supertest-mocha-chai validator

blog-management-api's Introduction

Blog Management Backend Service

This Node.js project is a backend service for a Blog Management Platform, providing essential functionalities for user management and blog post management. It utilizes Express.js, Bcryptjs, Jsonwebtoken, and Mongoose for efficient development.

Base url: https://blog-management-api-nwkl.onrender.com/

Functionalities

1. User Management:

  • Sign up a new account
  • Sign in with username and password
  • Get specific user details

2. Blog Post Management:

  • Create a new blog post
  • Get all blog posts
  • Get a specific blog post
  • Update a specific blog post
  • Delete a specific blog post

API Endpoints

User Management

Methods Urls Actions
POST /api/auth/sign-up Sign up a new user account.
POST /api/auth/sign-in: Sign in with a username and password.
GET /api/auth/{userId}: Get specific user details.

Blog Post Management

Methods Urls Actions
POST /api/posts: Create a new blog post.
GET /api/posts: Get all blog posts.
GET /api/posts/{postId}: Get a specific blog post.
PATCH /api/posts/{postId}: Update a specific blog post.
DELETE /api/posts/{postId}: Delete a specific blog post.

Technology Stack

  • Express.js: A web application framework for Node.js.
  • Bcryptjs: A library for hashing and salting passwords.
  • Jsonwebtoken: A library for creating JSON Web Tokens for user authentication.
  • Mongoose: An ODM (Object Data Modeling) library for MongoDB.

How to Run

Follow these steps to run the project locally:

1. Clone this repository.

git clone https://github.com/manishtmtmt/blog-management-api.git

2. Navigate to the project folder using your command line interface.

cd blog-management-api

3. Install the project dependencies by running the following command:

npm install

4. Start the development server with:

npm run dev

Documentation

The project is documented with Swagger, providing detailed information about the available endpoints and their usage. You can access the Swagger documentation by visiting /api-docs when the server is running.

Additionally, a Postman collection is provided, allowing you to test the API endpoints easily.

Using the Postman Collection

  • Click here to access the Postman collection.
  1. Make sure you have Postman installed and registered.
  2. Click the Postman collection link above to open it in Postman.
  3. In Postman, click the "Import" button to add the collection to your workspace.

Signup a new user account [POST - /api/auth/sign-up]

Screenshot (73)

Sign in with a username and password [POST - /api/auth/login]

Screenshot (76)

Get specific user details [GET - /api/auth/{userID}]

Screenshot (79)

Create a new blog post [POST - /api/posts]

Screenshot (81)

Get all blog posts [GET - /api/posts]

Screenshot (84)

Get specific blog post [GET - /api/post/{postId}]

Screenshot (85)

Update a specific blog post [PATCH - /api/posts/{postId}]

Screenshot (88)

Delete a specific blog post [DELETE - /api/posts/{postId}]

Screenshot (89)

Endpoint Usage

For detailed usage and examples of each API endpoint, please refer to the Swagger documentation or the Postman collection provided with this project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.