What is OAuth?

OAuth is an authorization delegation protocol uses for authorize services, which requests coming from an external services. And giving them granular permission for specified APIs. What does that means? Assume you want to signup for some website. The below of the signup page, there is signup via the google button. Definitely you should prior experience regarding signup or/and sign in via google account.

Step by steps

In this tutorials we are using class component. So in class component we need to extend React.component and also need to implement render method, which returns the view html elements. Class components can have local state and lifecycle hooks, unlike functional components.

Step 1:

Create the component package inside the ‘src’ folder.

A ‘bootstrap’ is one of the most famous CSS framework, which gives rich features for mobile responsive designs using pre-built CSS and java script libraries.

A ‘reactstrap’ is a library which specially design for react. which gives pre-built bootstrap 4 components, which gives flexibility and usability.

Installing bootstrap

npm install bootstrap

yarn add bootstrap

Installing reactstrap

npm install reactstrap reactpopper — — save

yarn add reactstrap reactpopper

Adding to the project

Once we install the bootstrap library, we can use bootstrap.min.css file to the index.js. It is better import a bootstrap.min.css file before the index.css …

As you may know for the most cases, we can use environment variables for different environments rather than hard coding the API URLs, API Keys, and other config stuff. The mostly using environments are development and production. 😆

This is another use case, which may want to use environment configurations.

I wanted to change the theme according to the environment. Same app for two or more different vendors. 😃 This is the best solution, if the same app gives to different customers, they may delightfully, if the app has same theme which mapping to their business theme.


A simple node…

As a developer, I think writing unit testing on my own code is an essential part of my job role. Which ensure that my code is working properly and I feel confidence on that. But sometime, developers (including me) want to skip that due to busy timeline and pressure on work load.

Other thing is I saw lot of stuff on internet regarding unit testing, but some of them are not worked or not suited for my tasks.

So I want to show what are the mostly used things when writing unit testing for spring boot and Kotlin.

before that…

Arrow functions were introduced with ES6 (ECMAScript 6). Generally, the arrow function declared by a constant variable.


const function_name = () => {



Case Study

This is a simple form that collects student data. React works with components, which are reusable, and independent code blocks, which returns HTML code block. This example contains two components. Which are a header component and a student form component.

Figure 1

What is WebClient?

You can use WebClient to call REST calls. Traditionally Spring provides RestTemplate to do that, but when comparing to the WebClient it is fully reactive. That means you can send asynchronous non-blocking requests to the remote APIs. So WebClient uses fewer threads and less memory when comparing to the RestTemplate.

If you want to use WebClient, you have to add spring-web flux dependency into your classpath.

The API exposes Reactor is using two types. They are Flux and Mono. …


SQS (Simple Queue Service) is a fully manages queuing service that enables you to decouple your application. You can use SQS to send, receive, and store messages. There are two types of queues in SQS. They are Standard and FIFO. Here we are focusing on the Standard queue. If you want to learn more about SQS, please refer: https://aws.amazon.com/sqs/

Data flow

Figure 1

Step 1: create SQS (queue) in AWS

Type SQS in the search bar and select SQS (see Figure 2).

This tutorial explains about how to deploy spring boot application using docker in AWS EC2 instance.


As simply we are going create image locally and push it to docker hub. Then that image pull and deploy on Amazon EC2 instance.

figure 1


Docker desktop
Maven installed on local machine
GIT installed on local machine
Docker hub account
AWS account

Step 1

Clone the sample spring boot project from GitHub https://github.com/KavinduGayan/ec2-docker.git or you can create your own spring boot project from spring initializr or any other prefer method.

git clone https://github.com/KavinduGayan/ec2-docker.git

Step 2

Run and verify the project, working or not.

In java scheduling, Basically there are two classes involving. They are,

Timer Class

TimerTask Class

Timer Class

A facility for threads to schedule tasks for future execution in a background thread. Tasks may be scheduled for one-time execution, or for repeated execution at regular intervals.

This class scales to large numbers of concurrently scheduled tasks (thousands should present no problem). Internally, it uses a binary heap to represent its task queue, so the cost to schedule a task is O(log n), where n is the number of concurrently scheduled tasks.

class methods

cancel() — Terminates this timer, discarding any currently…

Kavindu Gayan

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