Giter Club home page Giter Club logo

mern-auth-starter's Introduction

User account starter template

A MERN stack boilerplate with authentication and authorization functionality

Features

The demo site is here: mern-auth-starter

screenshot of site

  • Registration with email, username and password
  • Email verification
  • Resend email verification
  • Login with email or username and password
  • Forgot password/reset password pages
  • Update profile

File structure

In a MVC structure, the server side files and folders is at the root folder. It is made in Nodejs with Express. It communicates with the database using moongoose as MongoDb object model.

The frontend is stored in the client folder and built with Reactjs which serves as the view.

Setting up on your locals

backend

# clone from github
git clone https://github.com/petrepan/mern-auth-starter.git
# Change directory into root
cd mern-auth-starter
# install NPM dependencies
npm install

.env file contains:

  • MONGO_URI: environmental variable for mongodb. You can set yours up locally or in the cloud.
  • JWT_SECRET: This is a secret random string of your own for jsonwebtoken
  • SENDGRID_API_KEY: Register on Sendgrid and set up an api key key
  • EMAIL_FROM: email for sending emails
  • CLIENT_URL: This is your frontend URL. it could be localhost:3000 for development. Production variable will differ.
# Then simply start your app
npm run dev

you can deploy your backend on your preferred host platform so as to fetch from the frontend

Frontend

# Change directory into client
cd client
# install NPM dependencies
npm install
# Then simply start your app
npm run start

in the client folder, change the URL value in the /src/action/user.js to your backend URL

Inspiration

My inspiration for building this is the proshop_mern by Brad Traversy

mern-auth-starter's People

Contributors

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