Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/navaneeth-21/worko-user-management-api

This is an user management API which consists of all api requests that can be send to user using postman or any api request extensions. In this each api request is authenticated using JWT . The testing was done by using jest and supertest tools and the data validation is done by a joi module.
https://github.com/navaneeth-21/worko-user-management-api

jest joi-validation jwt monggose mongodb rest-api

Last synced: about 1 month ago
JSON representation

This is an user management API which consists of all api requests that can be send to user using postman or any api request extensions. In this each api request is authenticated using JWT . The testing was done by using jest and supertest tools and the data validation is done by a joi module.

Awesome Lists containing this project

README

        

# Worko API

## Getting Started

### Prerequisites

- Node.js
- MongoDB
- jest
- supertest
- JWT
- joi(validation)

### Installation

1. Clone the repository:
```sh
git clone https://github.com/navaneethgade07/Worko_Backend_api_setup.git
cd worko
```

2. Install dependencies:
```sh
npm install
```

3. Create a `.env` file in the root directory with the following content:
```env
PORT=3000
DB_URL=mongodb://localhost:27017/worko
JWT_SECRET=your_secret_key
```

4. Start the server:
```sh
npm start
```

5. Api requests :
- Send all api requests using postman or thunderclient extension in vscode.
- For **POST** request send the required details to create a user.
- For **GET** request(listallusers) you can retrieve the all the user details in the database.
- For **GET** request(getuser) to retrieve a user by its userID.
- **PUT** request to replace the whole existing data with the updated data.
- **PATCH** request to update the existing data with the optional data.
- **DELETE** request to soft delete a user by it's userID.

### Running Tests

```sh
npm test