Live Demo: piedev.herokuapp.com
A mern stack authentication system featuring tons of errors handling, form validation with transactional email sending e.g: account activation, password reset link, and protecting routes and AppBar.
Features and Errors handling
- 100% Responsive with nice a drawer and little animation
- Form Validation
- Create user
- Sending email verification link
- Resend Verification Link
- Protecting root
/route from unverified email - Protecting root
/router if user not signed in - Controlling signin state
httpOnlycookie - Sending forget password link and updating
You may get emails on spam folder as the SMTP only for served for demo purpose
-
npm or yarn. I prefer
yarn.npm install npm@latest -g npm install --global yarn -
Clone the repo
git clone https://github.com/pieeee/MERN-Stack-Authentication.git -
Navigate to
serverfolder and install dependencies viayarnornpm install. -
Navigate to
clientfolder and install dependencies viayarnornpm install. -
Find the
.env.localinserverdirectory and fill it with your variables.JWT_SECRET = MONGO_URI = SMTP_USER = SMTP_PASS = NODE_ENV = -
On ther server directory run
yarn devto start server onhttp://locahost:4000in the development mode. -
On ther client directory run
yarn startto run application onhttp://locahost:3000in the development mode.
Client
┣ client
┃ ┣ src
┃ ┃ ┣ Assets
┃ ┃ ┣ Components
┃ ┃ ┃ ┣ Errors
┃ ┃ ┣ Config
┃ ┃ ┣ Helpers
┃ ┃ ┣ Pages
┃ ┃ ┃ ┣ ForgotPass.js
┃ ┃ ┃ ┣ Home.js
┃ ┃ ┃ ┣ Register.js
┃ ┃ ┃ ┗ Signin.js
┃ ┃ ┣ Utils
┃ ┃ ┣ App.js
┃ ┃ ┣ Custom.scss
┃ ┃ ┣ index.js
┃ ┣ package.json
Server
┣ server
┃ ┣ src
┃ ┃ ┣ configs
┃ ┃ ┣ resources
┃ ┃ ┃ ┗ users
┃ ┃ ┃ ┃ ┣ user.model.js
┃ ┃ ┃ ┃ ┗ user.router.js
┃ ┃ ┣ utils
┃ ┃ ┃ ┣ emails
┃ ┃ ┃ ┃ ┣ views
┃ ┃ ┃ ┃ ┗ index.js
┃ ┃ ┃ ┗ auth.js
┃ ┃ ┣ index.js
┃ ┃ ┗ server.js
┃ ┣ .babelrc
┃ ┣ package.json
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch
- Commit your Changes
- Push to the Branch
- Open a Pull Request
- Review and Help me to refactoring code.
Distributed under the MIT License. See LICENSE for more information.
Email: info@piedev.tech
Project Link: MERN-Stack-Authentication
