You are on page 1of 7

How to Build a Coronavirus Dashboard in Java - DZone Java https://dzone.com/articles/how-to-build-a-coronavirus-dashboard-in-java...

[LIVE WEBINAR] Tuesday, June 9th: Migrating to the cloud? Avoid the business risks & costs Sign Up Now

1 sur 7 29/05/2020 à 22:07


How to Build a Coronavirus Dashboard in Java - DZone Java https://dzone.com/articles/how-to-build-a-coronavirus-dashboard-in-java...

DZone > Java Zone > How to Build a Coronavirus Dashboard in Java

How to Build a Coronavirus Dashboard in


Java
In this article, we discuss how to build a Coronavirus dashboard in Java with Spring Boot, Vaadin,
and an open source REST service as a data source.
by Alejandro Duarte CORE · May. 11, 20 · Java Zone · Tutorial

Experience the power of MariaDB Platform: data security, plus schema flexibility & semi-structured data with JSON and SQL.
the Guide
Presented by MariaDB

This tutorial explains how to create a simple dashboard to track coronavirus data using the Java programming
language. The dashboard is a web application implemented with Spring Boot 2.2.6 and Vaadin 14.1.25. It includes
features of Progressive Web Applications (PWA), such as responsive design and the possibility to install the app
onto the home screen of mobile phones and other devices.

The source code is available on GitHub.

Setting Up a New Project


To set up a new project:

1. Go to https://start.spring.io and generate a new Maven project with JAR packaging and the following
dependencies:

OpenFeign: Declarative REST Client. OpenFeign creates a dynamic implementation of an interface


decorated with JAX-RS or Spring MVC annotations.

Vaadin: Java framework for building rich client apps based on Web Components.

2. Import the Maven project into your favorite IDE. This tutorial uses IntelliJ IDEA.

3. Add the following dependencies to the pom.xml ile:

XML

1 <dependency>
2 <groupId>com.vaadin</groupId>
3 <artifactId>vaadin-board-flow</artifactId>
4 </dependency>
5 <dependency>
6 <groupId>com.vaadin</groupId>
7 <artifactId>vaadin-charts-flow</artifactId>
8 </dependency>
9 <dependency>
10 <groupId>com.vaadin</groupId>

2 sur 7 29/05/2020 à 22:07


How to Build a Coronavirus Dashboard in Java - DZone Java https://dzone.com/articles/how-to-build-a-coronavirus-dashboard-in-java...

3 sur 7 29/05/2020 à 22:07


How to Build a Coronavirus Dashboard in Java - DZone Java https://dzone.com/articles/how-to-build-a-coronavirus-dashboard-in-java...

DZone > Java Zone > Leaning Towards Reactive Architecture

Leaning Towards Reactive Architecture


Learn more about reactive architecture.
by Mansi Babbar · May 29, 20 · Java Zone · Opinion

Site reliability engineering (SRE) and the four golden signals of monitoring create visibility into application and infrastructure health.
about the golden signals and see how SRE teams are using them to improve observability and service resilience.
Presented by VictorOps

Why Reactive Architecture?


Reactive Architecture aims to provide software that remains responsive in all situations. Reactive Systems build user
con idence by ensuring that the application is available whenever the users need it in all conditions.

What Is the Goal of Reactive Architecture?


Be responsive to interactions with its users
Handle failure and remain available during outages
Strive under varying load conditions
Be able to send, receive, and route messages in varying network conditions

What Is Reactive Manifesto?


The Reactive Manifesto is a document that was authored by Jonas Boner, Dave Farley, Roland Kuhn and Martin Thompso
The Manifesto was created in response to companies trying to cope with changes in the software landscape. Multiple
groups or companies independently developed similar patterns for solving similar solutions. So aspects of a Reactive
Systems were previously individually recognized by these groups. So the Manifesto attempts to bring all of these commo
ideas into a single uni ied set of principles, known as Reactive Principles.

What are Reactive Principles?


Responsive: The system consistently responds in a timely fashion. Responsiveness means that problems may be
detected quickly and dealt with effectively. It is the cornerstone of usability and utility. Systems must respond in fas
and consistent fashion if at all possible. This consistent behavior in turn simpli ies error handling, builds end user
con idence, and encourages further interaction.
Resilient: The system stays responsive in the face of failure. Resilience is achieved by replication, containment,
isolation and delegation. Failures are isolated to a single component to ensure that parts of the system can fail and
recover without compromising the system as a whole. Recovery of each component is delegated to external
component.
Elastic: The system stays responsive under varying workload. Reactive Systems can react to changes in the input ra
by increasing or decreasing the resources allocated to service these inputs. Reactive Systems support predictive and
reactive scaling algorithms to support elasticity. Scaling up is done to provide responsiveness during peak load, whi

4 sur 7 29/05/2020 à 22:07


How to Build a Coronavirus Dashboard in Java - DZone Java https://dzone.com/articles/how-to-build-a-coronavirus-dashboard-in-java...

5 sur 7 29/05/2020 à 22:07


How to Build a Coronavirus Dashboard in Java - DZone Java https://dzone.com/articles/how-to-build-a-coronavirus-dashboard-in-java...

DZone > Java Zone > How to Use Java to Build Single Sign-on

How to Use Java to Build Single Sign-on


This article demonstrates how to use Java to build a single sign-on application with two client application
single resource server.
by Andrew Hughes · May 29, 20 · Java Zone · Tutorial

All Development Should be Secure Development! Learn why automation and security testing tools are key components in the implementa
secure development life cycle in this on-demand webinar. Watch now!
Presented by Synopsys

When developing applications, it’s often the case that you have a single resource server providing data to multiple client
Although the apps might have similar users, they likely have different permissions they need to enforce. Imagine a situat
only a subset of users of the irst app should have access to the second (think an admin console application versus a clien
application); what would you do to implement this?

In this article, I’m going to show you how to use Okta and Spring Boot to implement single sign-on with two client applic
a single resource server. I’m also going to discuss how to use access policies to enforce authentication and authorization
and how to restrict access to the resource server based on application scopes.

Before we get into the code, you need to have the proper user authentication con igurations in place. For today, you’ll be
as the OAuth 2.0 and OpenID Connect (OIDC) provider. This will enable you to manage users and groups, as well as easily
options like social and multi-factor log authentication.

First, you’ll need to head over to register and create a free Okta developer account (if you haven’t already). You’ll receive
with instructions on how to complete the setup of your account. Once this has been done, navigate back to your Okta acc
up your web applications, users, resource server, and authorization server. It’s possible that you’ll need to click the yellow
button the irst time you log on to access the developer’s console.

Create Two OpenID Connect Applications


The irst step is to create two OIDC applications. OpenID Connect is an authentication protocol built on top of OAuth 2.0,
an authorization protocol. Each OIDC application de ines an authentication provider endpoint for each web application i

In the Okta developer console, navigate to Applications and click Add Application. Choose Web and click Next. Populat
ields with these values:

FIELD VALUE

Name OIDC App 1

Base URIs http://localhost:8080

Login redirect URIs http://localhost:8080/login/oauth2/code/okta

Click Done.

Scroll down and make a note of the Client ID and Client Secret . You’ll use those values shortly.

Repeat these steps for your second application with these values:

6 sur 7 29/05/2020 à 22:07


How to Build a Coronavirus Dashboard in Java - DZone Java https://dzone.com/articles/how-to-build-a-coronavirus-dashboard-in-java...

7 sur 7 29/05/2020 à 22:07

You might also like