Refreshing JWT Token and recommended settings for production environment

You can find the first part of this tutorial here. In the first part of the tutorial, we have built a functioning frontend and backend app that allows users to authenticate via Google login.

Refreshing a JWT Token

We are not done yet! Even though our app can authenticate a new user correctly, our still Nuxt app cannot refresh its JWT token. When the token is expired, and the token refresh is failed, the user will be logged out unexpectedly. This would be a bad experience for your user.

Let’s simulate a token expiry by setting the token lifetime duration to 1 second in…

Build end-to-end Social Login screen in Nuxt & Django

Photo by Taras Shypka on Unsplash

Overview

Over the past few weeks, I’ve been working on a side project. One of the requirements is to enable the user to sign in to the application using Google social login. The web app is built using Nuxt for the frontend and Django REST Framework for the backend.

Initially, building the social sign in flow was not hard at first, but I struggled with refreshing the JWT token in the web app. Most of the resources on the internet do not discuss how to refresh the JWT token. …

It has caused a lot of frustrations among Malaysians to book their vaccine appointment

This story is originally published here.

This article is inspired by Jonathan Lin’s post on the same topic and how Nike handles their Sneaker Drop sale.

Background

On 26th May 2021, the Malaysian government opens up vaccination slots to everyone in Kuala Lumpur and major cities in Malaysia. The registration form opens at 12 pm local time. Due to that, thousands (or perhaps millions) of Malaysians are getting ready in front of their computer to fight for the vaccination slot. Only ~1M slots are available to grab among 30M unvaccinated Malaysians.

At the end of the session, everyone was frustrated with…

Personal technology preferences after building many projects in the past

This story is originally published here.

Photo by John Schnobrich on Unsplash

Over the past few months, I’ve been building many side projects in my free time for learning apart from working full-time as a software engineer for the past 3 years. When building the side projects, I intentionally use many different technology stacks that I’m not familiar with in order to learn and make more informed choices in the future.

Over that period, I’ve developed my preferences towards the tech stacks of choice and approaches on how I’m gonna build my next project.

  • Prefers API-first development that automatically generates API documentation for you. It’s always…

This is how I plan my future, and you should do it too!

This article is originally published here.

Planning my future be like…

Twenty-five years old is quite a young age for software engineers. Mostly, 25 years old engineers are Computer Science graduate students who just graduated from university or have 1 to 2 years of experience. So am I. We are still in the early stage of our career.

I have plenty of time to pursue what I like. I have plenty of time to make mistakes and learn from them. More importantly, I have plenty of time to identify what I want and what I don’t in life. Apart from that, a young engineer like…

I am amazed by how easy to build a web app using Django

This post is originally posted here.

Photo by Faisal M on Unsplash

For the past three months, I’ve been writing a web application using Django for our company’s new project. It hasn’t launched yet, so I couldn’t disclose too much information about it. However, I’ve learned a ton while working on this project while working on it along with the team.

Previously, I have been working with Flask, Cherrypy, and Bottle to build a small and simple web app for a particular need. I was shocked after a few weeks of writing the…

My journey to relearn JavaScript after so many years and how you can start too

YAFIG Feed page

The picture above shows you what I’ve built after learning Vue.js and Nuxt.js in one week.

I am building an Instagram clone project called “Yet Another Free (OSS) Instagram Clone” (YAFIG). The front-end site is built entirely in Vue.js and Nuxt.js, in a week.

Who Am I

I am a full-time software engineer working on CDN products. I spent my entire professional career (~three years) working with back-end services, primarily in Python, Java, and Lua.

Sometimes I also work with DevOps toolchains (Jenkins, Docker, Kubernetes, Puppet, etc.). I have decent experience writing a server-side web app using Flask and Django.

However, one of…

Write your first event-driven workers

This article was originally published on my personal blog here.

Photo by Hal Gatewood on Unsplash.

What Is a Message Queue in the First Place?

Message queues (MQ) are a fundamental concept in programming and software development. In a distributed system, a message queue is the backbone of the system. A message queue allows inter-process communication between services/applications in your system (eg. Service A can talk to Service B).

In MQ terminology, the service that emits the message is called the producer worker, while the service that listens and reacts to messages is called the consumer worker. This is how communication happens between the services.

You can scale up or down the number of producer…

One of the most instructive ways to wrap your head around a new language

This blog is originally published on my personal blog.

Illustration by Mohamed Hassan on Pixabay

Why Golang?

I’ve wanted to learn Golang for a long time. According to a Stack Overflow survey, Golang was the third-most wanted programming language in the year 2019. Coming from a Python background, learning a new programming language like Golang gives me a unique perspective on how to write code.

I was inspired by a helpful tutorial by Keiran Scot. The following tutorial is heavily influenced by Keiran’s tutorial but is made to use MySQL instead of Mongo as part of my exercise to learn Golang.

Prsonally, I believe Golang is the…

Mohamad Fadhil

Software Engineer, building tiny part of CDN. See me on fadhil-blog.dev

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store