This project is a web-based application for managing sensor data using various Spring technologies such as Spring Boot, Spring Data JPA, and Spring I/O Validation. The system allows users to register new sensors, add new measurements from the sensors, view all measurements, and calculate the number of rainy days.
- Spring Boot
- Spring Data JPA
- Spring I/O Validation
- MySQL
- Jackson
- Java 8 or higher
- MySQL Server
-
Clone the repository:
git clone https://github.com/doneskkk/measurements.git
-
Configure the MySQL database:
- Create a new database with the name "rest_api_3"
- Update the database connection settings in the application.properties file
-
Build and run the application:
./mvnw spring-boot:run
-
Access the application:
http://localhost:8080/
HTTP Method | Endpoints | Description |
---|---|---|
POST | /api/v1/sensors/registration | Register a new sensor |
HTTP Method | Endpoints | Description |
---|---|---|
POST | /api/v1/measurements/add | Adding new measurement |
GET | /api/v1/measurements | Get all measurements |
GET | /api/v1/measurements/rainyDaysCount | Get the number of rainy days |
Users can register new sensors by providing the sensor name
Users can add new measurements from sensors by providing the sensor name , field isRaining , and measurement value.
Users can view all measurements in the system.
The system can calculate the number of rainy days based on the measurements taken by sensors.
measurement-client : https://github.com/doneskkk/measurement-client
- Dones Chiril (@doneskkk)