Posts Tagged "Guide"

How to setup a GraphQL server in Next.js with API endpoints using TypeScript, type-graphql and apollo-server-micro

I have been learning GraphQL for a while now, and I love Next.js for the benefits it comes with. So, one morning, I decided to try and combine the two and see if I can make it work. The journey was not as smooth as I expected it to be, so I decided to document my approach.

(Part 2) How to configure social authentication in a Next.js + Next-Auth + Django Rest Framework application

This is the second part of a two-part series where I show you a way to connect your Django Rest Framework backend with a Next.js + Next-Auth app. Building on top of the previous article, I go over topics such as automated refreshing of access tokens and discussing the pitfalls of useSession() hook (as of Apr 30, 2021).

(Part 1) How to configure social authentication in a Next.js + Next-Auth + Django Rest Framework application

Authentication has always been a gigantic pain in the you-know-where, at least for me. I come from a Node.js, Express.js background, where I used passport.js to handle authentication schemes. I started learning Django and Django Rest Framework (DRF). However, Django (and DRF, for that matter) does a lot of heavy lifting behind the scenes, which is why it seems quite perplexing (again, most likely only to me) to do many things. I want to know the answer to the following: "Is it possible to use a Next.js frontend with Next-Auth for the authentication, but at the same time have a separate backend (in my case, DRF) so that I can essentially have the best of both worlds in my web application?"