MERN Stack Authentication App

https://github.com/jonathansgardner/express_auth(opens in a new tab)Screenshot of the included test application

A secure, production-ready authentication boilerplate built with the MERN stack. This project serves as a robust starting point for full-stack applications requiring secure user management.

The app is essentially an Express server that exposes a series of RESTful API endpoints for basic user authetication using JWT tokens. Users can sign up for an account, login, logout, and reset their password. The data layer is handled by MongoDB and the popular Mongoose ODM. Password encryption is handled by bcrypt. Nodemailer is used to send password reset emails. Docker is used to set up a protable environment for development and production.

A simple React test client is configured to demonstrate the authentication flow as I imagined it working in a real-world application. Mailslurper is used in the test app as a local SMTP testing environment for password reset emails to avoid having to configuring a full blown email server for development.

Key Features

  • RESTful API enpoints for user registration, login/logout, and password reset functionality
  • Stateless authentication using JSON Web Tokens
  • Salted hashing with bcrypt to ensure user data protection
  • Email Integration and automated password reset emails via Nodemailer
  • Fully containerized Dockr setup for seamless development-to-production parity
  • Includes a React-based demo client to showcase the end-to-end authentication flow

Tech Stack

JavaScriptNode.jsExpressMongooseMongoDBReactNginxDocker