This repository contains the code for the backend of the Helioviewer Timeline Project.
- JDK 8 and set JAVA_HOME to its installation folder.
- Gradle
- Open a terminal, PowerShell, ... and execute
git clone https://github.com/stby4/helioviewer-visualisation.git heliovis-back. - Install the .editorconfig plugin for your preffered editor (we recommend VSCode or IntelliJ).
- Open the
heliovis-backdirectory with your editor. - Execute
gradle runImporterin your terminal, PowerShell, ... to create your database for the first time.
| Project folder | Content |
|---|---|
| api | Web servlet for a data API to the database. |
| config | Stores global settings, e.g. path to database. |
| database | Handles access to the memory mapped files, offers read / write access. |
| importer | Downloads files with X-ray flux data from various sources, updates database. |
| api | Web servlet for a data API to the database. |
gradle runImporterstarts the download of all required data from the NOAA servers. This might take several hours. Only needs to be executed once.gradle runUpdaterupdates the database.gradle appRunDebugstarts an Jetty server for the API.- Alternatively,
gradle tomcatRunDebugstarts a Tomcat server for the API. gradle api:warbuilds /api/build/libs/api.war for deployment on a server.
After starting a server with gradle appRunDebug, you can listen on communicate with the server on port 5005. Use the VS Code debugger and the Debug (Attach) launch configuration to start debugging.
Example request: http://localhost:8080/api/?from=1009843200000&to=1528927023999&points=2926
| Parameter | Description | Valid values |
|---|---|---|
| from | Sets the start date for the time series. | UNIX timestamp in milliseconds, any time |
| to | Sets the end date for the time series. | UNIX timestamp in milliseconds, any time larger than "from". |
| points | Sets the amount of returned data points. This is only a maximum number, the amount of actually returned data points can be lower. | Any integer value larger than 0. |
The response is json formatted:
[
["timestamp in milliseconds", "flux value in Watts/m^2"],
...
]