Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/AdilsonFuxe/auth-microservice

Authentication microservice built with Node.js that follows Clean Architecture + TDD + SOLID + DDD + functional programming principles
https://github.com/AdilsonFuxe/auth-microservice

clean-architecture ddd docker docker-compose k8s kubernetes nodejs nodemailer solid stateful-components swagger tdd typescript

Last synced: 2 months ago
JSON representation

Authentication microservice built with Node.js that follows Clean Architecture + TDD + SOLID + DDD + functional programming principles

Awesome Lists containing this project

README

        


Build Status
Coverage Status
Auth Microservice
License





Node.js Authentication Microservice


A simple API built with Node.js that follows Clean Architecture + TDD + SOLID + DDD principles


## Table of Contents

- [Table of Contents](#table-of-contents)
- [About The Project](#about-the-project)
- [Built With](#built-with)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Endpoints](#endpoints)
- [SignUp](#signup)
- [SignIn](#signin)
- [Forgot Password](#forgot-password)
- [Reset Password](#reset-password)
- [me](#me)
- [signout](#signout)

## About The Project

### Built With

- [NodeJs](https://nodejs.org/)
- [Typescript](https://https://www.typescriptlang.org/)

## Getting Started

to run the project you need to have npm installed on your machine and
the mongo DB

### Prerequisites

to get the npm https://www.npmjs.com/get-npm

### Installation

1. Clone the repo

```sh
git clone https://github.com/AdilsonFuxe/clean-auth-microservice.git
```

2. Server configuration

Enter into the server folder

```sh
cd clean-auth-microservice
```

3. inside the server folder run the following command to install all dependencies

```sh
npm install or yarn
```

4. to generate the build of the project run

```sh
npm run build or yarn build
```

5. to run the server

```sh
npm start or yarn start
```

6. to run the unit tests and the integration tests

```sh
npm test or yarn test
```


## Endpoints


### SignUp

**POST** `https:/localhost/api/v1/signup`

##### output example

```json
// POST https:/localhost/api/v1/signup

// Request Body
{
"firstName": "any_name",
"lastName": "any_name",
"email": "[email protected]",
"password": "any_password",
"passwordConfirmation": "any_password"
}

// Response Body
{
"accessToken": "any_access_token"
}
```


### SignIn

**POST** `https:/localhost/api/v1/signin`

##### output example

```json
// POST https:/localhost/api/v1/signin

// Request Body
{
"email": "[email protected]",
"password": "any_password"
}

// Response Body
{
"accessToken": "any_access_token"
}
```


### Me

**GET** `https:/localhost/api/v1/me`

##### output example

```json
// Get https:/localhost/api/v1/me
// HEADER x-access-token = any_access_token

// Response Body
{
"id": "any_id",
"firstName": "any_name",
"lastName": "any_name",
"email": "[email protected]"
}
```


### Forgot Password

**Patch** `https:/localhost/api/v1/forgot`

##### output example

```json
// Patch https:/localhost/api/v1/forgot

// Request Body
{
"email": "[email protected]"
}
```


### Reset Password

**Patch** `https:/localhost/api/v1/reset-password`

##### output example

```json
// Patch https:/localhost/api/v1/reset-password

// Request Body
{
"email": "[email protected]",
"accessToken": 092498,
"password": "new_password"
}
```


### Signout

**Delete** `https:/localhost/api/v1/signout`

##### output example

```json
// Delete https:/localhost/api/v1/signout
// HEADER x-access-token = any_access_token

// Request Body
Status Code 204
{}
```