Add authentication and authorization to Next.js 8 serverless apps using JWT and GraphQL

Click for: original source

An article describing how to deploy a Node.js Express JWT service for authenticating requests to Hasura GraphQL Engine. Written by Praveen Durairaj.

Hasura is an open-source engine that gives you realtime GraphQL APIs on new or existing Postgres databases, with built-in support for stitching custom GraphQL APIs and triggering webhooks on database changes.

The author relies on Next.js 8 for building the sample serverless react app, Apollo client for GraphQL querying, Node.js server for JWT authentication, Hasura GraphQL Engine for GraphQL APIs with permissions.

The author describes:

  • Tech stack
  • Deploy Hasura
  • How to run JWT server
  • Configuration of JWT with Hasura
  • Authenticated Query
  • Authorization using JWT
  • Deploying using now.sh

The author also has put together a boilerplate so that you can get started quickly! It is available on GitHub. Good read!

[Read More]

Tags nodejs javascript web-development