Skip to content

Complete modularized auth module in Nodejs with Facebook signin, Google signin, JWT authorization, and many more from scratch.

Notifications You must be signed in to change notification settings

sudheer121/Full-Auth

Repository files navigation

About

This is an auth module built with nodejs.The code is modularized and will be helpful for anyone looking into exploring the below mentioned technologies, learning OAuth2 or MVC architecture in nodejs.
Have a look at https://full-auth.herokuapp.com.

Tech Stack / Tools

Nodejs

jQuery Ejs Express

SQLite MySQL

Features

  • Authentication and authorization using JWT tokens.
  • Google and Facebook Sign In.
  • Uses server side cookies
  • Saves data in SQLite database
  • Model - View - Controller Architecture
  • Responsive

To setup locally


git clone https://github.com/Sudheer121/Full-Auth.git
npm install 
node dbrunonce.js (sets up SQLite database)
  

Change filename .env.example to .env


More Details

Database Tables

registration(uid, email, first_name, last_name, phone_no, signin_type)

transactions(uid, pname, pid, pprice, tdate, ttime)

uid => user id, pname => product name

MySQL database can also be used instead of SQLite, nodejs mysql queries are commented below SQLite queries.

Api Routes

/ 
/login
/register
/api/gsignin
/api/fbsignin
/api/pay

Cookies

The website uses a Cookie called 'grishmat'.


Helpful resources for learners

Learn about JWT here

Learn about integrating Google Signin here

Learn about integrating Facebook Signin here

Issues and PRs are welcome