Skip to content

Analyze and visualize the most updated Covid related data from Italy

Notifications You must be signed in to change notification settings

albertominetti/covid-italia-oggi

Repository files navigation

Daily graphs on Italian Covid data

The project born as a simple standalone R script to analyze and visualize the most updated Covid related data that the Italian health ministry publish daily. In March 2020 the idea was mainly forecasting using time series analysis with HoltWinters (link1, link2) and SARIMA (link), and everything was running from my PC. During November 2020 some friends asked me to provide the graphs in a better usable way. So I decided to create a cloud native application that can run in the most famous hosting platform like AWS, Azure, etc.

Demo

The application is currently hosted on a VPS hosting and on Heroku, the latter without the images generated by R.

The following images are screenshots.

home
Homepage of the application
home
Graphs by region
intensive care national
Intensive care patients in Italy, generated by R
intensive care regional
Intensive care patients in Italy by regions, generated by R

Technologies

At the beginning, the application consists of an R script running on my local PC, of course R does not provide a production ready web server. So I decided to use Spring Boot as orchestrator for calling the R scripts, download the data, trigger the scheduled batches and serve the frontend. As frontend, I chose VueJs, because of the separation of concerns between frontend logic and graphic template. Instead of javascript, I use typescript that allows a cleaner syntax and compile time warnings.

Challenges and ToDo list

  • retrieve data and generate graphs with R
  • usa spring-boot as server and integrate Java with R
  • deploy the application on a remote Virtual Private Server
    • run as a service
    • log with syslog and log rolling
    • reverse proxy with nginx
    • expose in https with a verified certificate
  • integrate a Vue frontend with spring-boot
  • generate interactive graphs with a Vue using data from the underlying API
  • localization
  • if R is not available on the system, avoid the R specific features
  • automate the deployment from github to the destination server

Run the app

You can compile and run with the following command

mvn clean package && java -jar dist/target/*.jar

The webapp is available at localhost:8080.

To generate the images with R you need to query the endpoint /admin/generate-images.

Installation details

Here you can find details for the requirements if you are interested to install on your server.

Credits