Skip to content

ChrisHilborne/Madrid-Covid-Radar

Repository files navigation

Header

CircleCI codecov

Table of contents

General info

This project is a Spring Boot web server that fetches Covid-19 data from The Ayunamiento de Madrid, processes it, and serves it as a REST API.

Technologies

Project is created with:

  • Java 11
  • Spring Boot
  • Spring JPA/MongoDB

Setup

Certain secrets are encrypted by Jasypt with a key stored in an enviroment variable. You therefore can not run this project without making changes to the follwing files in /src/main/resources/:

  • application.properties: Remove or comment out jasypt.encryptor.password=... if you do not wish to encrypt any properties, or include your own key.

  • application-dev.properties: To connect to your own MongoDB instance you must edit the spring.data.mongodb properties to your requirements.

Once you have changed the .properties files according to your setup, use the following command to install the program:

$ mvn install -Pdev

Now that it is installed navigate to the ./target folder and run the program with the following command:

$ java -jar covidradar-madrid-1.0.jar

Consuming the API

Once you have started the program, you will be able to make GET requests to fetch Covid-19 data for Healthwards (zona basic de salud) in Madrid:

  • To get all Healthward data:
curl http:localhost:8080/api/all
  • To get a list of all Healthward names and geocodes:
curl http:localhost:8080/api/names&geocodes
  • To get data for only one Healthward:
curl http:localhost:8080/api/geocode/{geocode}

Dataflow

The below diagram illustrates the flow of data through the program and to the client.

Licence

MIT