Giter VIP home page Giter VIP logo

mern-authentication's Introduction

๐Ÿš€ MERN authentication with email verification, hooks and docker (prod/dev).

capture du 2018-12-16 13-57-42

๐ŸŽฎ Demo: https://mern-auth-client.herokuapp.com/login

โš ๏ธ CSS styles, Google Captcha, Sentry usage and some other not essential dependencies like notifications are only in the demo. This repository aim to have a fast to use boilerplate.

โญ The project if it helped you!

๐Ÿณ Docker

Boilerplate now is fully usable with docker, it integrate the MongoDB database, the React/Redux frontend and NodeJS/Express backend.

If you do not have docker: https://docs.docker.com/get-docker/

Docker allows to deloy the app in docker containers in one line in the CLI.

Environment variables

In both docker-compose.yml and docker-compose-prod.yml file you have to set the following environment variables:

  • SENDGRID_API_KEY, the backend uses Send Grid to send emails, you can register and get a free key on their website: https://sendgrid.com/. โš ๏ธ You cannot use the app without a key. Validation links are sent in http not https, you can modified that in server/routes/auth.js if you want to go https in deployment.

  • SESSION_KEY, it is the secret key that is used to compute the hash of sessions. It is important to use a strong key: https://cloud.google.com/network-connectivity/docs/vpn/how-to/generating-pre-shared-key.

  • SENDING_EMAIL, email address that sends emails in the app. Has to be set.

Development

in the root directory:

docker-compose up --build

It supports hot reloading for both the frontend and backend.

Production

in the root directory:

docker-compose -f docker-compose-prod.yml up --build

Frontend app uses an Nginx server to deliver static files.

You may want to use the flag --remove-orphans

To deploy on Heroku refer to their documentation: https://devcenter.heroku.com/categories/deploying-with-docker

๐Ÿ’ป Boilerplate

MERN Stack with advanced authentication :

  • Email verification (Token Based) with resend/reset option, Login with forgot password feature.

  • Server side sessions.

  • Docker for development and production with hot reloading.

  • Mongodb.

  • Express.

  • React/Redux based on Create React App.

  • React Hooks.

  • Nodejs.

  • Passport-js local.

  • Sendgrid API for emails.

๐Ÿ”’ Security

This repository is scanned with snyk and code scanning from github for vulnerabilities. Do not use this code blindly, audit it first.

โ„น๏ธ How to ?

mern-authentication's People

Contributors

dependabot[bot] avatar flaviuse avatar snyk-bot avatar ujjwal-kr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.