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.
Project is created with:
- Java 11
- Spring Boot
- Spring JPA/MongoDB
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 outjasypt.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 thespring.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
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}
The below diagram illustrates the flow of data through the program and to the client.