Coder Social home page Coder Social logo

dockerdemoserver's Introduction

Authentication Implementation

overview

1. Created Server using express on PORT 5000.

2. Connected with mongoDb using mongoose

3. Implemented Logics

* Login
* SignUp
* Update Password
* Get all users
* Get user by Id
* Send token with httpOnly cookies

4. Proper Error handling

* Created my own Error Class (AppError) for molding errors
* Created Higher Order function to handle errors in async functions.
* programming error vs operational errors
* developement vs production error handling
* handled Uncaught promises

5. Used Best practices for Scalability

6. Used Environment variables.

Available Scripts

In the project directory, you can run:

npm install

To install all dependencies

npm start

Runs the app in the development mode.

npm run start:prod

Runs the app in the production mode.

API's ( USED POSTMAN TO TEST ALL API'S)

POST signp

http://localhost:5000/api/signup

POST login

http://localhost:5000/api/login

POST logout

http://localhost:5000/api/logout

POST refreshToken

http://localhost:5000/api/refresh

GET get-all-users

http://localhost:5000/api/users

PATCH update Password

http://localhost:5000/api/updatePassword

GET get-user-by-id

http://localhost:5000/api/users/{id}

dockerdemoserver's People

Contributors

adkood avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.