DEV Community

James Perkins
James Perkins

Posted on

A Flexible Node Authentication Boilerplate With Email.

I recently completed a boilerplate for node authentication. I was tired of creating a new authentication for most of my node projects and decided that the community could use boilerplate that is lightweight(minimum amount of node modules) and ready for use for almost any scenario.


Firstly there are two options currently the pure node implementation and then the container version.
Check it out from my GitHub choose docker branch if you want docker and master if you want the pure node.

Please note MongoDB is required for the storing of data. We also need sendgrid API for password resets Sendgrid

Once checked out make sure to make the following changes in the .env


Node Implementation

  1. npm install
  2. npm run dev

Docker implementation

  1. docker build
  2. docker run image

API Routes

All routes run through the following

to run register you need to call a post:


  "companyName": "name",
  "password": "password"

to run login you need to call a post:


  "password": "password"

to run forgot password you need to call a post:



to run reset Password you need to call a post:


  reset_password_token: "reset_token_from_email"

So that's the basics, I tried to keep it as lightweight as possible and hopefully you can find use for it in your next app, idea to speed up your development. Also feel free to fork and make it your own. If you have a problem submit and issue and I will fix ASAP

Top comments (0)