Início Profile Projeto
Avatar de

Luis Vinicius Pereira Da Silva


Example API with Email Verification and JWT Authentication


This API provides an example of how to create accounts with email verification and JWT authentication, following best practices. Simply clone this repository and you can start building your project.


  • User registration with email verification
  • Login with JWT authentication
  • Secure password storage with bcrypt
  • Proper error handling and input validation
  • Uses Node.js, Express, and MongoDB

Getting Started

  1. Clone the repository

git clone

  1. Install the dependencies

npm install --legacy-peer-deps

  1. Configure .env file
[email protected]
DATABASE_ADDRESS=mongodb+srv://123:[email protected]
  1. Start the API

npm run start


  - POST '/creationRequest' - creates an account creation request, sending a code to the user's email.
  - POST '/verifyCodeCreation' - checks if the email and account creation code are valid, and if so, it registers the account in the database
  - POST '/login' - receives an email and password, if they exist in the database, returns an access token.
  - GET '/:id' - returns a user based on its id, but access token is required to receive!