Project Title: Java Project to provide API's to save/fetch continuous stream of temperature data from sensor.
Technology/Framework Used: Java, SpringBoot, Hibernate, Maven, JUnit 5
Features: Application exposes endpoints to do the following activities.
- Save the continous stream of Temperature data from temperature Sensor.
- Provide hourly average of the Temperature data.
- Provide daily average of the Temperature data.
The Application Read performance is enhanced by using Materialized Views.
Installation:
- Install JAVA JDK 11, MAVEN in your machine.
- Install PostMan client to test the Endpoints.
- Install POSTGRESQL and PGAdmin Client.
API Reference: POST : http://localhost:8080/saveTemperature GET : http://localhost:8080/getHourlyData GET : http://localhost:8080/getDailyData
Sample JSON for POST Request save_temperature.json
Tests: Please run 'mvn install' or 'mvn test' from the root folder to execute the Test Cases.
How to use:
-
Clone this repository in your local machine by using GIT tool.
-
Setup the Database and configure the JDBC URL in application.properties.
- Create the schema as per the scripts uploaded qardio_schema.sql , using PGAdmin 4 client.
- Install the dependencies by using 'mvn clean install'
- Run the Test Cases from the root directory using command line 'mvn test'
- Create JAR using command line from the root directory. 'mvn install' (JAR is created in Target folder of the application)
- Run the Spring boot application using java -jar JARNAME
Testing with Postman
1.Import the collection QardioCollection.postman_collection in PostMan. 2.Execute the Rest API's in Collection.
JAVA Doc Documentation:
Please refer TemperatureService.html