Git Product home page Git Product logo

webclinic017 / user-auth-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ryanbest99/user-auth-boilerplate

0.0 0.0 0.0 1.88 MB

An User Authentication boilerplate that has register with email verification process, login with jwt authentication, sign out, forget password and reset password features with sendgrid email API.

Home Page: https://user-auth-1.herokuapp.com/#/

License: MIT License

JavaScript 81.75% CSS 15.43% HTML 2.82%

user-auth-boilerplate's Introduction

GitHub License Website repo-size


An User Authentication boilerplate that has register with email verification process, login with jwt authentication, sign out, forget password and reset password features with sendgrid email API.
It is a responsive web app aimed at helping people build user authentication features easily by taking the source code in the repository.

User Auth Tech image

Demo

Table of Contents

Features

  • Account Login and Register via email+password and jwt authentication
  • Email verification for sign up users by using Sendgrid
  • Send email that includes JWT for forgot password users
  • Reset Password

Development

Architecture

User Auth Tech Architecture User Auth MERN Architecture

Technologies

The primary libraries and dependencies used in the development of User Auth are shown below. For a complete list of dependencies, consult the package.json files inside client and server folders.

Library Purpose Client or Server?
React.js A JavaScript library for building UIs Client
Bootstrap Allows for CSS-in-JS for a nicer development experience Client
Formik Yup React.js Form Validation Client
React-Tostify Add notifications to your app with ease Client
MongoDB with Mongoose Schema-Based MongoDB Application Data Modeling Server
Express Backend Server Framework Server
Sendgrid Email service for register and forgot password Server
Bcryptjs Hashing Password Server
Jsonwebtoken For Token Based Authentication Server

Usage

(1) Commands (/client) Purpose
npm run start Run Frontend Production Server
npm run dev Run Frontend Locally
npm run build Build Frontend for Production
(2) Commands (/server) Purpose
npm start Run Backend Server
npm run dev Run Backend locally using Nodemon

Configuration

Location Purpose
/client Frontend source directory
../components App Components (React)
../pages Pages directory
../public Static Assets
../utils Frontend Datas
/server Backend source directory
../db MongoDB/Mongoose Connect
../models MongoDB/Mongoose Data Models and Schemas
../controllers MongoDB/Mongoose Data Controllers
../routers MongoDB/Mongoose Data Routers
../utils Sendgrid Email

Development Environment

Before starting the server in your local dev. environment,the following environment variables should be defined:

Variable Name Description
MONGO_URI MongoDB Atlas connection string (e.g. mongodb+srv://MONGO_USER:MONGO_PASSWORD@cluster...)
CLIENT_URL URL for reset password and activate account
EMAIL_FROM Sendgrid Email sender
JWT_ACCOUNT_ACTIVATION JWT secret key for account activation
JWT_RESET_PASSWORD JWT secret key for reset password
JWT_EXPIRED JWT expiration
JWT_SECRET JWT Secret key
SENDGRID_API_KEY To use sendgrid email service, the key is necessary
PORT Server Port (8000 by default for local deploy). In production Heroku will provide its own port.

This is accomplished by including the following in the .env file located in the root of the /server directory. This .env file must never be pushed to GitHub since it contains application sensitive information such as the database username and password.

The /server/.env file must contain the following:

MONGO_URI="mongodb+srv://..."
PORT=8000
CLIENT_URL="http://localhost:3000/#"
EMAIL_FROM="[email protected]"
JWT_ACCOUNT_ACTIVATION="random character string"
JWT_RESET_PASSWORD="random character string"
JWT_EXPIRED="random time"
JWT_SECRET="random character string"
SENDGRID_API_KEY="valid sendgrid api key"

Future Updates

O Auth :

  • Implement Sign in with Google and Facebook.

State Management Update with Redux:

  • Update React code to Redux for clean state management.

Author


Design Advisor


Reference

To Resolve Deployment Issue

user-auth-boilerplate's People

Contributors

ryanbest99 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.