API RESTfull that manage authentication and data persistence on Focus application
Prerequisites • Goals • technologies • Author
Before starting, you will need to have the following tools installed on your machine: Git and Node. Besides, it's good to have an editor to work with the code like VSCode
- To build this API I used the S.O.L.I.D principles and clean code.
- All the authentication is made with JWT and refresh-token strategy. First I made an authentication endpoint that receives the email and password in the request and respond with user's information, an access token and a refresh-token, but the refresh-token is sent in a httpOnly cookie for more security. In all the requests a middleware intercepts and verify the access token and after a successful verification the request go on. When the refresh-token expires there's an endpoint "/refresh-token" that send back a new access token.
- To manage and persist Tasks creation, modification in status, modification in content, deletion and listing I used PostgreSQL and TypeORM
The following tools were used in building the project:
Tiago Araujo 🚀
Made by Tiago Araujo 👋🏽 contact!