Secure Authentication Service for MERN Stack using ReactJs and NestJs
A progressive Node.js framework for building efficient and scalable server-side applications.
React ·
![PRs Welcome](https://camo.githubusercontent.com/7f745fb7dd2a22f68fe03adcdb977963ada4c8265675e572c629b29b9b34af2b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5052732d77656c636f6d652d627269676874677265656e2e737667)
React is a JavaScript library for building user interfaces.
MongoDB is an open source, nonrelational database management system (DBMS)
This is a very basic example of signIn and signUp in Node.js and NestJs framework . I have applied REST based API recommendations .
From front-end i have used ReactJs starter setup . Check images in docs.
Database Used : Mongodb And ORM as Mongoose .
Have used eslint | prettier modules for finding and fixing problems/linting issues in my code .
For Authentication I have used Passport jwt strategy.
For validation : Express validation
As per business needs i have used winston logger for logs.
Test cases will be written in Upcoming days using testing framework Jest https://jestjs.io/ .
NodeJs , NestJs , winston, Postman, ReactJs, Typescript, Javascript, PassportJs, MongoDb, Mongoose, Eslint, etc
Getting Started :
i have use node version v16.15.0 & npm verion 8.5.5 .
npm, MongoDb
Clone the repo take git pull .(Master branch is the final one)
Install NPM packages
npm install ( npm i ) for both modules separately (We can move modules in different cloud services)
For Backend :
#cd ./nest-js-auth/ then
npm i
#type in terminal
npm run start:dev
open your postman(preferred)
And type:
localhost:8000
My Postman API collection public link below : https://www.postman.com/gladiator-dev/workspace/anzar-dev/collection/5511458-440a63fb-80ba-4a65-96c1-ec3e48b373c9?action=share&creator=5511458
Below is a list of the required API's for the application.
-
POST
/auth/signup
- for Sign up -
POST
/auth/signin
- for sign In -
GET
/auth-dev-testing
- It was just to check working of JWT authentication .
For UI front-end :
#cd ./react-js-auth/
#type in terminal
npm i
npm start
if you want to change environment variables <here i have pushed my .env file too>