Skip to content

A NodeJS and Express CRUD Api with MongoDB Database and JWT authentication

License

Notifications You must be signed in to change notification settings

dhfuzari/task-board-server

Repository files navigation

Task Board Server

A NodeJS and Express Api to create, retrieve, update and delete tasks and projects. It performers user authentication trought JSON Web Tokens and functionalities to register users and reset passwords.

GitHub last commit GitHub issues GitHub

Postman Task Board Server public documentation

Tech used

Frameworks used

Features

  1. CRUD operations for Tasks and Projects entities

  2. User authentication with JSON Web Tokens. Functionalities:

    • User register
    • User authentication
    • Forgot Password
    • Reset Password

This project provides a complete feature to reset passwords throught /auth/forgot_password endponits wich sends an email to the current user containing a token, that will be used later on /auth/reset_password endpoint to validate the user action to reset the password. More details can be found at Postman Task Board Server public documentation

Up and running

To get a development env running, follow these next steps, and next continue to How to use section to have a complete developement environment running:

  1. Clone the repo: git clone [email protected]:dhfuzari/task-board-server.git
  2. Navigate to root folder: cd task-board-server
  3. Then, run npm i to install all required packages and wait a few minutes to complete the process
  4. Then, before to start, you must to create a mailtrap account and replace the current environment xpto variables values from user and pass properties at src/config/mailtrapServer.json file, with the new values created at mailtrap. xpto isn't a valid mailtrap user and isn't even a valid mailtrap password. Now, you're almost ready to go.
  5. This project uses MongoDB as a database in a docker container, so if you're runing this project locally in a Microsoft Windows or Mac OS system, you need to start Docker Desktop before performing the next step.
  6. Now, to start a server listing the door number 3000, run npm run dev
  7. That's it, the server is ready and now you can send requests trought Postman to access the endpoints described below in the next section "How to use?"

How to use?

To test the API locally I like to use Postman. It offers a sleek user interface with which to make HTML requests, without the hassle of writing a bunch of code just to test an API's functionality.

  1. First of all, access our Postman Task Board Server public documentation
  2. Now, you can see all availables endpoints
  3. Click at Run in Postman button, at the top right of the page, and open this collection in your Postman.
  4. Now, you can send requests to registers users, authenticate, retrieve and reset passwords, and perform CRUD operations in the Tasks and Projects entities
  5. If you want to track the data created directly in the database, access the Mongo Express and open the task_board database for more details
  6. Let's go for it.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT.

About

A NodeJS and Express CRUD Api with MongoDB Database and JWT authentication

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published