A complete authentication system which can be used as a starter code for creating any new application
Home Page:
Sign-Up:
-
Sign-In page contains four fields name, email, password ans confirm password.
-
On submit user redirect to sign-in page.
-
User also can use google for sign-in.
-
User also get Welcom mail from us.
-
Google reChapcha V3 is also use here.
Sign-In:
-
Sign-In page contains two fields email and password.
-
User can sign in using Google.
-
Google reChapcha V3 is also use here.
-
If user forget password he can use his email to get new password.
-
Mail is send to the verified user which contains a random password which he/she can use to reset password.
Profile:
Reset-Password:
-
If user want to rest his/her password so he can reset his password.
-
Mail is send to the verified user which contains a random password which he/she can use to reset password.
-
User can also rest his password using google.
- Assets: It contains all static file CSS, JS, Images.
- Config: It contains connection to Database, Authentication etc.
- Controller: It redirect the webpage according to user action.
- Mailer: It contains different mailing config.
- Models: It contains Database Schema.
- Routes: It contains all routes.
- Views: It contins all file which render UI to browser.
- Clone the project.
- Go to folder.
- Run following command.
npm install bcrypt npm install body-parser npm install connect-flash npm install connect-mongo npm install cookie-parser npm install crypto npm install ejs npm install express npm install express-ejs-layouts npm install express-session npm install mongoose npm install nodemailer npm install passport npm install passport-google-oauth npm install passport-local npm install request
- Connect to mongodb.
- Give user credentials in
config > passorport-google-outh2
. - Give your mail credentials in
config > nodemailer
- Also change google reChapcha site key and seceret key.
- Run command:
npm start
- Go to https://localhost/8000 to use the application.
- Happy Learning