Giter Site home page Giter Site logo

lucas-a-pelegrino / node-bloodboiler-sequelized Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 5.0 1.66 MB

An API boilerplate built on top of ExpressJS

License: MIT License

JavaScript 97.67% Shell 1.70% Dockerfile 0.63%
api-boilerplate expressjs nodejs javascript sequelize rest-api restful rest jest boilerplate

node-bloodboiler-sequelized's Introduction

Sup!

Backend software engineer with six years of experience, having developed over twenty high-quality applications. Excellent problem-solving skills, teamwork driven, and I'm always aiming to do my best work.

What am I doing recently?

  • Currently working as Sr. Software Engineer at Nomad 💰

My todo list:

  • Collect a few AWS certificates
  • Improve my knowledge of the hashicorp solutions

calendly

node-bloodboiler-sequelized's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar eliasrabelomatos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

node-bloodboiler-sequelized's Issues

[FEAT] Get User Endpoint

Description
As a user, I should be able do view another user's complete information or my own information.

Additional Context
This endpoint's response should have all the user's information, except for the password. The parameters of search should be the user's ID

[FEAT] Update User Endpoint

Description
As a user, I should be able to update my own information or another user's information.

Additional Context
This endpoint should validate params and body, following the same rules applied to the endpoint that creates an user.
This endpoint's response body should have the user's updated information.

[FEAT] Codecov Integration

Description
The application should be integrated with Codecov, and should run reports for every Pull Request. Coverage should be 100% and no less.

[EPIC] Users

Description
As a user; I should be able to list other users based on search criteria, view a specific user's information, update the user's information or remove the user from the application.

Additional Context
This epic covers the user resource CRUD and authentication endpoints.

[FEAT] Create User Endpoint

Description
The application should have an endpoint where a user can be created.

This endpoint must have data validation in the body params, if the email used to create the user is already registered in the application, it should return the 409 - Conflict status code stating that the email used is already registered. The password must have a minimum of 8 characters length, and have at least one lower case letter, one upper case letter, one number, and one special character, as for the rest of the fields, the validation should check if the datatype is correct and should return the 400 - Bad Request status code if the data input by the user registering the resource does not pass one or more the validation steps.

Additional Context
A user should have name, email, and password

Continuous Integration

Description
The application should have a CI build setup. Using Github Actions to run the scripts.

Additional Context
The build script should run npm install and npm test commands, then send code coverage report to Codecov, Codacy will review the code on every merge made to the develop and master branch.

Tasks

  • Write Unit/Integration Tests
  • Integrate Project with Codecov
  • Integrate Project with Codacy

[FEAT] List Users Endpoint

Description
The application should have an endpoint to fetch all users registered in the application.
This endpoint must have data validation in the query params.

As a user, I should be able to see a list of registered users in the application, I also should be able to paginate through the list, using query params to filter the amount of data that should be fetched for each page, also I should be able to sort the order in which the users are listed choosing between asc and desc and which field I want it to be sorted by (Defaults to registration date).

Additional Context
This endpoint's response should have a metadata object containing the total amount of users registered, the total number of pages, and the current page. At least, it should have an array of users based on the criteria used in the query params.

[FEAT] Routes Authorization

Description
The user routes should be private, meaning that for a user to make requests to them, it first must be authenticated/authorized in the application, bearing a token in the request header that allows it to make operations to a private route.

Additional Context
All user routes must have the authorization middleware added to them.

[EPIC] Project Setup

Description
The sequelized version of the Bloodboiler should be copied from the original Bloodboiler to maintain the same project structure. The only difference being the database configuration, considering models, repositories, migrations, and seeds.

Additional context
As for the library used to connect with the database, we will use the Sequelize v5 ORM to manage relational databases.

[REQUEST] Adicionar suporte a conteiners

Essa issue tem como objeto solicitar a inclusão de suporte à conteiners ao boilerplate.

Justificativa:

Com a adoção de conteiners gasta-se menos tempo para configurar os ambientes e se perde menos tempo analisando e identificando as diferenças existentes.

O resultado é a integração e unificação dos ambientes de trabalho das equipes de desenvolvimento, que aumentam a produtividade.

Com isso, e dentre outros fatores, os conteiners, entende-se aqui o Docker, permite ciclos de entrega de software mais rápidos.

[FEAT] Reset Password Endpoint

Description
As a user, I should be able to reset my password using the link I received in my email with the reset token.

Additional Context
This service must find the user based on its reset password token if so, it should update the user's password with the new password it informed in the request body.
If the operation is successful, it should return a status code of 204 - No Content.
If the token is not found, it should return a status code of 404 - Not Found and feedback stating the token was not found.
If the token has expired, it should return a status code of 403 - Forbidden and feedback stating the token have expired.

[EPIC] User Authentication

Description
As a user, I should be able to register myself in the application, sign in, send forgotten password requests, and reset my password.

Additional Context
The application should have an authentication flow and a middleware that authorizes the user to make requests to private endpoints.

[FEAT] User Registration Endpoint

Description
As a user, I should be able to register myself in the application, giving my name, email, and a password for sign in.

Additional Context
The endpoint's request body must have name, email, and password and must go through the data validation middleware rules and must return 400 - Bad Request status code.
For a successful response, the response must be a 201 - Created status code.
If the email used for registration is already used by another user in the application, the response must be a 409 - Conflict status code and message feedback stating the email is already in use.

[FEAT] Forgot Password Endpoint

Description
As a user, I should be able to send a forgotten password request. For that, I must inform the email I used in my registration, I should expect for an email from the application with a link containing the generated token used to reset my password.

Additional Context
This endpoint should try and find the user by it's email and if no user is found, it should return a 404 - Not Found status code with feedback stating that no user was found.
If successful, it should generate a token with expiration time of 30 min and send the user an email containing a link with the token so it can reset its password. The response for a successful operation should be 204 - No Content

[FEAT] Database Setup

Description
The library used to connect with the database should be the Sequelize v5 ORM to manage relational databases.

Additional context

  • Uninstall the Mongoose ODM from the project;
  • Install the Sequelize ORM in the project;
  • Install the Sequelize CLI to be able to create the database, generate models, migrations, and seeds;
  • Setup sequelize config file at the project root folder to meet the project's structure;

[FEAT] Integration Tests

Description
All integration tests should be reviewed and refactored to work with Sequelize. Keeping coverage at 100%.

Additional Context
Resource fixtures should also be reviewed since they use Mongo related data to be used on the tests.

[REQUEST] Adicionar suporte ao Docker

Essa issue tem como objeto solicitar a inclusão de suporte a conteiners ao boilerplate.

Justificativa:

Com a adoção de conteiners gasta-se menos tempo para configurar os ambientes e se perde menos tempo analisando e identificando as diferenças existentes.

O resultado é a integração e unificação dos ambientes de trabalho das equipes de desenvolvimento, que aumentam a produtividade.

Com isso, e dentre outros fatores, os conteiners, entende-se aqui o Docker, permite ciclos de entrega de software mais rápidos.

[FEAT] Project Documentation

Description
Before publishing the release of the Bloodboiler Sequelized, the README file should be reviewed and updated.

Additional Context

  1. [README] Change Database feature details from Mongo to Sequelize;
  2. [README] Include a link to the original Bloodboiler;
  3. Review CONTRIBUTING document;
  4. Review Swagger Docs to make it fit with a sequel database application;
  5. Review Postman Collection to make it fit with a sequel database application;

[FEAT] User Sign In

Description
As a user, I should be able to sign into the application using the credentials used for registration, these credentials should be the email and password used.

Additional Context
If the request operation is successful, the response body must have an authorization token, used to authorize the user to make requests to private endpoints.
If the email used to sign is not found in the application, the response must have a 404 - Not Found with feedback stating that a user was not found for the email used.
If the password used to sign in is invalid, the response must have a 401 - Unauthorized status code with feedback stating that the password is invalid.

[FEAT] Delete User Endpoint

Description
As a user, I should be able to delete another user from the application, this user must be completly deleted from the database, and not just deactivated.

Additional Context
The endpoint's response for a succesful operation should be the 204 - No Content status code.
The search criteria for deleting a user should be it's ID.
If the ID used to find the user to be deleted is not found, the endpoint's response should be the 404 - Not Found status code.

[FEAT] Query Builder

Description
The query builder from the original Bloodboiler is based on MongoDB and it will not work with Sequelize, so it must be refactored to be used alongside Sequelize methods.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.