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
httpOnly
cookie - 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
server
folder and install dependencies viayarn
ornpm install
. -
Navigate to
client
folder and install dependencies viayarn
ornpm install
. -
Find the
.env.local
inserver
directory and fill it with your variables.JWT_SECRET = MONGO_URI = SMTP_USER = SMTP_PASS = NODE_ENV =
-
On ther server directory run
yarn dev
to start server onhttp://locahost:4000
in the development mode. -
On ther client directory run
yarn start
to run application onhttp://locahost:3000
in 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: [email protected]
Project Link: MERN-Stack-Authentication