In this post we setup OAuth between a NextJS client and an Express API. I have assumed knowledge of JavaScript, Nodejs and Expressjs in this post. I, however, explain things well enough for anyone to catch up and understand things.

This post is composed of two parts.

  1. - Involves the REST API backend part which has the OAuth collection of endpoints and a delete profile endpoint. This will involve creating REST endpoints, a GitHub OAuth and a MongoDB database for storing user details.
  2. - This part includes setting a Nextjs Server Side Rendered application that has a single…


Imagine the component below that renders Hello James when the value of in is . Since the value is not owned by it is passed to it by the decorator High Order Component called . This is common when using libraries that don't yet use React's context API.

And the name decorator is like this.

The above relationship between and is very common because it is used to achieve many things in Reactjs. …


I first wrote JavaScript after a few months of learning C and its async nature just twisted my head and threw me off the grid most of the time. I struggled to get the code to do what I wanted to do and write quality code. I could spend time debugging complicated callbacks and unhandled promises rejections. You may also have had this experience or just having it So I have decided to draft this reference on async JS to document what I understand and use on a daily basis.

Let’s start from where it all started.

Async Code

JavaScript is Asynchronous


The world is evolving so fast, and we have to evolve with it in every sense. The goal is to be part of the future always. The internet has so much content to offer. We don’t have to wait to afford material to learn.

This is a story is mostly about me, about how I taught myself how to code and why I have decided to study Data Science through to Machine learning and how I am going to do it. I am writing this story to always remind myself of where I am going and to inspire anyone who…


By definition, NodeJS is an event-driven non-blocking runtime environment for JavaScript that has become very popular on the server-side. This is because Nodejs has an event-driven architecture capable of asynchronous I/O. This post explores what this event-driven architecture is like and how to exploit the event-driven nature of Nodejs in a very simple and basic way.

Who is this post for?

If you already have been programming in Nodejs, this post is for you because with the available libraries and frameworks in the npmjs community, most developers never get the necessity to experience the core driving capabilities of Nodejs. If you are new to Nodejs…


In this post, you will learn how to use Storybookjs and Jest with your react project. Reactjs is a UI library by facebook while Storybookjs is a testing tool for components by representing different states of the component and Jest is another cool unit testing tool by the creators of reactjs for javascript including reactjs. The code used in this setup is available here. If you don't know about reactjs, this article by Hackernoon is good for you.

Why Storybookjs?

Well, there are a number of cool things I think are notable about storybookjs, just to mention a few.

  1. Lets you describe…

Danstan Onyango

Software Engineer: Elixir, JavaScript ~ NodeJS- ReactJS, PostgreSQL,MongoDB. Unix Enthusiast. AI, ML and Data Science Aspirations. A believer of Tech.

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