# user-auth-microservice

> User Authentication Microservice

Latest version **3.1.0** (published 2022-09-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install user-auth-microservice
pnpm add user-auth-microservice
yarn add user-auth-microservice
bun add user-auth-microservice
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.0 |
| Published | 2022-09-30 |
| First published | 2022-08-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 19 |
| Unpacked size | 285.6 KB |
| Known vulnerabilities | 0 (+8 in 4 direct dependencies) |
| Install scripts | no |
| Author | Shadab Azam Ansari |
| Maintainers | shadab1995 |

## Links

- npm: https://www.npmjs.com/package/user-auth-microservice
- npm.io page: https://npm.io/package/user-auth-microservice

## Dependencies (19)

- [cors](https://npm.io/package/cors.md) ^2.8.5
- [uuid](https://npm.io/package/uuid.md) ^7.0.3
- [config](https://npm.io/package/config.md) ^3.3.8
- [dotenv](https://npm.io/package/dotenv.md) ^8.2.0
- [moment](https://npm.io/package/moment.md) ^2.29.4
- [morgan](https://npm.io/package/morgan.md) ^1.10.0
- [twilio](https://npm.io/package/twilio.md) ^3.82.1
- [express](https://npm.io/package/express.md) ^4.18.1
- [request](https://npm.io/package/request.md) ^2.88.2
- [winston](https://npm.io/package/winston.md) ^3.8.2
- [bcryptjs](https://npm.io/package/bcryptjs.md) ^2.4.3
- [gravatar](https://npm.io/package/gravatar.md) ^1.8.2
- [mongoose](https://npm.io/package/mongoose.md) ^5.13.15
- [strategy](https://npm.io/package/strategy.md) ^1.1.1
- [compression](https://npm.io/package/compression.md) ^1.7.4
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.5.1
- [otp-generator](https://npm.io/package/otp-generator.md) ^4.0.0
- [express-validator](https://npm.io/package/express-validator.md) ^6.14.2
- [generate-password](https://npm.io/package/generate-password.md) ^1.7.0

## Recent versions

- 3.1.0 (latest) — 2022-09-30
- 3.0.0 — 2022-09-30
- 2.9.0 — 2022-09-30
- 2.7.0 — 2022-09-30
- 2.6.0 — 2022-09-30
- 2.5.0 — 2022-09-30
- 2.4.0 — 2022-09-30
- 2.3.0 — 2022-09-30
- 2.2.0 — 2022-09-26
- 2.1.0 — 2022-09-26
- 2.0.0 — 2022-09-26
- 1.9.0 — 2022-09-26
- 1.8.0 — 2022-09-26
- 1.7.0 — 2022-09-26
- 1.6.0 — 2022-09-26
- … 4 more at https://npm.io/package/user-auth-microservice/versions

## README

<img src="https://github.com/sazamansari/node.js-_microservices/blob/main/user.png"/>
 <hr></hr>
<p align="center">
  <samp>
# User-Auth-Microservice

Express.js is a framework of Node.js  for building efficient, scalable Node.js server-side applications. It uses modern JavaScript, is built with JavaScript (preserves compatibility with pure JavaScript) and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).

Under the hood, Node.js makes use of Express, but also, provides compatibility with a wide range of other libraries, like e.g. Moongoose, allowing for easy use of the myriad third-party plugins which are available.

In recent years, thanks to Node.js, JavaScript has become the “lingua franca” of the web for both front and backend applications, giving rise to awesome projects like Angular, React and Vue which improve developer productivity and enable the construction of fast, testable, extensible frontend applications. However, on the server-side, while there are a lot of superb libraries, helpers and tools for Node, none of them effectively solve the main problem - the architecture.

User_Auth Microservices aims to provide an application architecture out of the box which allows for effortless creation of highly testable, scalable, loosely coupled and easily maintainable applications. The architecture is heavily inspired by Node.js.

## Acknowledgements

 - [Express.js](https://expressjs.com/)
 - [Node.js](https://nodejs.org/en/)
 


## INSTALL

locally, usually for use as a module:

```bash
npm i user-auth-microservice
```


## Authors

- [@Md Shadab Azam Ansari](https://md-shadab-azam-ansari.vercel.app/)


## License

[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)


## API Reference

#### Get all items

```http
  GET /api/items
```

| Parameter | Type     | Description                |
| :-------- | :------- | :------------------------- |
| `api_key` | `string` | **Required**. Your API key |

#### Get item

```http
  GET /api/items/${id}
```

| Parameter | Type     | Description                       |
| :-------- | :------- | :-------------------------------- |
| `id`      | `string` | **Required**. Id of item to fetch |

## Mongooose Connect 

config/db.js 

```jsx
import mongoose from "mongoose";

const connectDB = async () => {
  let uri = process.env.MONGO_URI;

  try {
    await mongoose
      .connect(uri, {
        useNewUrlParser: true,
        useUnifiedTopology: true,
        useCreateIndex: true,
      })
      .catch((error) => {
        console.log("connection in error:::", error);
      });

        console.log("mongo DB connected");


      mongoose.set('debug', function(collectionName, method, query, doc, options) {

        console.log(collectionName + '.' + method, JSON.stringify(query), doc)
    
        // log.info({
        //     dbQuery: set
        // });
    });

  } catch (e) {
    console.error(e, "error");
  } finally {
    // await client.close();
  }
};

export default connectDB;
/>

#### Get all items


#### add(num1, num2)

Takes two numbers and returns the sum.




## To Run The Project

To Run The Project

```bash
  npm run dev
```


## Contributing

Contributions are always welcome!

See `contributing.md` for ways to get started.

Please adhere to this project's `code of conduct`.


## 🔗 Links
[![portfolio](https://img.shields.io/badge/my_portfolio-000?style=for-the-badge&logo=ko-fi&logoColor=white)](https://shadab-azam-ansari.vercel.app/)
[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/shadab1995/)



## Tech Stack

**Server:** Node.js, Express.js Auth, JwToken
### Examples
```jsx
import CONSTANTS from '../constants/index.js';

import UserRoutes from '../modules/user/user.routes'

const routes = (app)=>{
   
app.use(`${CONSTANTS.API_URI}/user`,UserRoutes);

// console.log(app , "::dddddddddd")
}
export default routes;
/>

---
_Source: https://npm.io/package/user-auth-microservice · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
