A simple API built with Node.js that follows Clean Architecture + TDD + SOLID + DDD principles
to run the project you need to have npm installed on your machine and the mongo DB
to get the npm https://www.npmjs.com/get-npm
- Clone the repo
git clone https://github.com/AdilsonFuxe/clean-auth-microservice.git
- Server configuration
Enter into the server folder
cd clean-auth-microservice
- inside the server folder run the following command to install all dependencies
npm install or yarn
- to generate the build of the project run
npm run build or yarn build
- to run the server
npm start or yarn start
- to run the unit tests and the integration tests
npm test or yarn test
POST https:/localhost/api/v1/signup
// POST https:/localhost/api/v1/signup
// Request Body
{
"firstName": "any_name",
"lastName": "any_name",
"email": "anyemail@mail.com",
"password": "any_password",
"passwordConfirmation": "any_password"
}
// Response Body
{
"accessToken": "any_access_token"
}
POST https:/localhost/api/v1/signin
// POST https:/localhost/api/v1/signin
// Request Body
{
"email": "any_mail@mail.com",
"password": "any_password"
}
// Response Body
{
"accessToken": "any_access_token"
}
GET https:/localhost/api/v1/me
// 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": "anyemail@mail.com"
}
Patch https:/localhost/api/v1/forgot
// Patch https:/localhost/api/v1/forgot
// Request Body
{
"email": "any_mail@mail.com"
}
Patch https:/localhost/api/v1/reset-password
// Patch https:/localhost/api/v1/reset-password
// Request Body
{
"email": "any_mail@mail.com",
"accessToken": 092498,
"password": "new_password"
}
Delete https:/localhost/api/v1/signout
// Delete https:/localhost/api/v1/signout
// HEADER x-access-token = any_access_token
// Request Body
Status Code 204
{}