Skip to content

dondvdlaan/Weather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Weather App


V1:

Simple weather app based on React FE and Java BE. The Java BE contacts 2 API site, one to obtain the longetude and latitude of the city reuired and one to retrieve the weather report per city.

Communication to the remote APIs is over Spring synchronous RestTemplate.

V2:

App has been split up in to different modules: composite, location, conditions and shared. The shared module is used for common models and constants.

Modules communicate with each other by way of the Spring RestTemplate.

V3:

Modules have been dockerized, communication between the modules is by means of Spring Reactor WebFlux, while communication with the remote APIs is using the synchronous RestTemplate and the asynchronous WebClient.

A scheduler is implemented at the composite module, which is triggered by the frontend. The scheduler receives the city to be trended from the frontend, requests the city weather from the remote API´s and sends the result via Kafka to the asynchronous MongoDB.

Maven has been replaced by Gradle.

V4:

Spring Security with JWT Authentication has been added to the composite module, which actually serves as a gateway for the app too. The frontend app will not continue till a valid user and password have been entered. After correct authentication, a JWT token is generated and with a refresh token, they are sent back to the user. Both tokens have expiration dates, the refersh token later than the JWT token.

When the JWT token expires, the backend will send an Unauthorized 401 error back to the frontend, which is intersepted by frontend. The frontend will request a new JWT token by way of the refresh token. If the refresh token is accepted, both a new JWT and a new refresh token are generated and sent back. If the refresh token has also expired, the backend will respond with a Forbidden 403 error and the frontend will show the log in screen again to the user.

User credentials and refresh tokens are stored in separate databases.

Summary:

  • Java 17
  • Spring Boot Web, Reactor, WebFlux, Security
  • React
  • Grommet UI, Bootstrap
  • Docker
  • Kafka

About

Simple weather app per city based on 2 APIs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published