AgroPulse ships as a self-contained JAR and a multi-stage Dockerfile, so it runs anywhere Java or Docker is available. For development, it uses SQLite with no additional setup. For production, swap in a PostgreSQL connection string and set your secrets as environment variables — no code changes required.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.
- Local development (SQLite)
- Production (PostgreSQL on Render)
SQLite is the default database. No installation or configuration is needed — AgroPulse creates The server starts on port
agropulse.db in the working directory on first startup.Requirements: Java 17, Maven 3.9+ (or use the included ./mvnw wrapper).8080. The full base URL is http://localhost:8080/api.To override the port:Dockerfile
The included Dockerfile uses a two-stage build to keep the final image small. The build stage compiles with Maven; the runtime stage uses only the JRE.Docker deployment
Environment variable reference
All variables are read at startup. Variables with defaults are optional; variables without a default are required in production.| Variable | Default | Description |
|---|---|---|
PORT | 8080 | Port the HTTP server listens on. |
CORS_ALLOWED_ORIGINS | http://localhost:5173, http://localhost:3000, http://localhost:4173 | Comma-separated list of origins allowed by CORS. Set to your frontend URL in production. |
JWT_SECRET | agropulse-default-secret-change-in-production | Secret used to sign JWT tokens. Must be overridden in production. |
JWT_EXPIRATION_MS | 86400000 | JWT token lifetime in milliseconds. Default is 24 hours. |
SPRING_DATASOURCE_URL | jdbc:sqlite:agropulse.db | JDBC connection URL. Override with a PostgreSQL URL for production. |
SPRING_DATASOURCE_DRIVER_CLASS_NAME | org.sqlite.JDBC | JDBC driver class. Set to org.postgresql.Driver for PostgreSQL. |
SPRING_JPA_DATABASE_PLATFORM | org.hibernate.community.dialect.SQLiteDialect | Hibernate dialect. Set to org.hibernate.dialect.PostgreSQLDialect for PostgreSQL. |
SENDGRID_API_KEY | (none) | SendGrid API key for email alert delivery. Anomaly email notifications are disabled if unset. |
SENDGRID_FROM_EMAIL | (none) | Sender address used in outgoing SendGrid emails. |
AGROPULSE_ADMIN_EMAIL | (none) | Email address granted admin privileges. Requests pass this value in the X-Admin-Email header to access admin-only endpoints. |
PostgreSQL notes
When connecting to Supabase or PgBouncer in transaction-pooling mode, prepared statement caching must be disabled to avoidprepared statement S_XX already exists errors. AgroPulse handles this automatically via: