/User_PRODUCT_API_with_JWT_Auth

This is a Node.js server project built using the Express framework and MongoDB database. The project allows for the creation of users and products, as well as authentication using JSON Web Tokens (JWT).

Primary LanguageJavaScript

User and Product Creation, and JWT Authentication Backend

This is a Node.js server project built using the Express framework and MongoDB database. The project allows for the creation of users and products, as well as authentication using JSON Web Tokens (JWT).

Table of Contents

Technologies Used

  • Node.js
  • Express
  • MongoDB
  • JSON Web Tokens (JWT)
  • bcrypt
  • Validator(Joi)

Installation

To install and run the project, follow these steps:

  1. Clone the repository to your local machine.
  2. Install dependencies using npm install.
  3. Start the server using npm start.

Usage

The user and product creation functionality allows for the creation, retrieval, updating, and deletion of users and products. The user creation includes user registration with a unique email and password, as well as user login with validation checks and error handling. The product creation includes adding, updating, and deleting products with validation checks for required fields.

The JWT authentication feature allows users to securely access the application using a token-based authentication system. This includes generating a JWT token upon user registration or login, verifying the token on protected routes, and handling token expiration and invalidation.

The project is built with a modular and organized code structure, making it easy to customize and extend. It also includes robust error handling and validation checks to ensure data integrity and security.

Contributing

Contributions to the project are welcome and encouraged. To contribute, please follow these steps:

  1. Fork the repository to your own GitHub account.
  2. Create a new branch with your changes.
  3. Submit a pull request to merge your changes into the main branch.

Author

Evans Elabo