AgroPulse is a Spring Boot 3 REST API that accepts sensor data over HTTP, detects anomalies automatically, and fires alerts via email and WhatsApp. This guide walks you through everything from cloning the repository to posting your first reading against a running local instance.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/diarpicu2022-commits/backend-AgroPulse/llms.txt
Use this file to discover all available pages before exploring further.
All endpoints are served under the
/api context path. The default local base URL is http://localhost:8080/api.Clone and build
Clone the repository and build a runnable JAR. You can use Maven directly or build a Docker image — both produce the same artifact.The Maven build produces a JAR in
target/. The Docker build uses a two-stage process: it compiles with maven:3.9.6-eclipse-temurin-17 and packages the result into a minimal eclipse-temurin:17-jre-jammy runtime image.Set environment variables
Copy Edit
.env.example to .env and fill in the required values. For local development the only mandatory variable is JWT_SECRET — all others have safe defaults..env:The database defaults to SQLite (
agropulse.db in the working directory). No database setup is required for local development.Run the application
Start the server with Maven or Docker:Once the application starts you should see Spring Boot’s startup banner. The API is ready when the log shows
Started on port 8080.Verify the server is up:Register a user
Create an account by posting to A successful response returns the new user object (password is never included):
/api/auth/register. The username field must be unique.Create a greenhouse
Post to The response includes the auto-assigned
/api/greenhouses with at least a name. Optional fields include location, description, latitude, and longitude.id you will use in the next step:Post a sensor reading
Send a reading to The API returns the persisted reading and immediately runs it through anomaly detection:
/api/readings. If you omit sensorId (or set it to 0) and supply greenhouseId and sensorType, AgroPulse auto-registers the sensor for you.Valid
sensorType values include TEMPERATURE, HUMIDITY, SOIL_MOISTURE, CO2, PH, LIGHT, and WIND_SPEED.Next steps
Deploy to production
Switch from SQLite to PostgreSQL and run AgroPulse on Render or any Docker host.
API reference
Explore every endpoint — sensors, greenhouses, readings, alerts, and automation rules.
Connecting devices
Send readings from ESP32 or any HTTP-capable device.
Anomaly detection
Understand how AgroPulse flags out-of-range values and stuck sensors.