Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 8 days ago
JSON representation
Authentication microservice built with Node.js that follows Clean Architecture + TDD + SOLID + DDD + functional programming principles
- Host: GitHub
- URL: https://github.com/AdilsonFuxe/auth-microservice
- Owner: AdilsonFuxe
- License: mit
- Created: 2021-08-12T04:17:36.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-03T21:25:41.000Z (almost 2 years ago)
- Last Synced: 2024-08-01T19:41:38.204Z (4 months ago)
- Topics: clean-architecture, ddd, docker, docker-compose, k8s, kubernetes, nodejs, nodemailer, solid, stateful-components, swagger, tdd, typescript
- Language: TypeScript
- Homepage:
- Size: 664 KB
- Stars: 55
- Watchers: 1
- Forks: 16
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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
{}
```