Giter Club home page Giter Club logo

jwt-refresh-token-node-js-mongodb's Introduction

This is a fork of the original project. It's intended to set as a codebase for the final task for the students of the course 4 of Pilar Tecno.

You have the freedom to use any free or open API for your project. You may use as many as you need/want.

Some suggestions are:

You can browse more API's here.

Keep in mind some API's will need some registration and/or are free for trial purposes only.

The final task consists in you making three or more endpoints that must consume one external service API (like the ones listed before).

It is required that you pay special attention to the structure used for the endpoint. Make sure to use:

  • Routes.

  • Controllers.

  • Services.

  • Environment variables for sensitive data (like API keys or DB access).

In one of the three endpoints you code, it is required that you save the response to a Mongodb collection. You can use MongoDB Atlas for easy setup, or a local instance if you want.

It is required that the endpoints are protected with a JWT Token. The endpoints should only allow users with the role "user" to use the endpoint.

Node.js JWT Refresh Token with MongoDB example

JWT Refresh Token Implementation with Node.js Express and MongoDB. You can know how to expire the JWT, then renew the Access Token with Refresh Token.

For instruction, please visit:

Node.js JWT Refresh Token with MongoDB example

The code in this post bases on previous article that you need to read first:

Node.js + MongoDB: User Authentication & Authorization with JWT

User Registration, User Login and Authorization process.

The diagram shows flow of how we implement User Registration, User Login and Authorization process.

jwt-token-authentication-node-js-example-flow

And this is for Refresh Token:

jwt-refresh-token-node-js-example-flow

More Practice:

Node.js, Express & MongoDb: Build a CRUD Rest Api example

Server side Pagination in Node.js with MongoDB and Mongoose

Associations:

MongoDB One-to-One relationship tutorial with Mongoose examples

MongoDB One-to-Many Relationship tutorial with Mongoose examples

MongoDB Many-to-Many Relationship with Mongoose examples

Fullstack:

Vue.js + Node.js + Express + MySQL example

Vue.js + Node.js + Express + PostgreSQL example

Vue.js + Node.js + Express + MongoDB example

Angular 8 + Node.js + Express + MySQL example

Angular 8 + Node.js + Express + PostgreSQL example

Angular 8 + Node.js + Express + MongoDB example

Angular 10 + Node.js + Express + MySQL example

Angular 10 + Node.js + Express + PostgreSQL example

Angular 10 + Node.js + Express + MongoDB example

Angular 11 + Node.js Express + MySQL example

Angular 11 + Node.js + Express + PostgreSQL example

Angular 11 + Node.js + Express + MongoDB example

React + Node.js + Express + MySQL example

React + Node.js + Express + PostgreSQL example

React + Node.js + Express + MongoDB example

Integration (run back-end & front-end on same server/port)

Integrate React with Node.js Restful Services

Integrate Angular with Node.js Restful Services

Integrate Vue with Node.js Restful Services

Project setup

npm install

Run

node server.js

jwt-refresh-token-node-js-mongodb's People

Contributors

tienbku 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.