Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/CLINTONARMANDO/apiregistropendientes/llms.txt

Use this file to discover all available pages before exploring further.

Running the API Registro Pendientes in production requires Java 21, a PostgreSQL database, and a writable directory for file uploads. This guide walks you through building the application artifact, supplying the required configuration, and verifying that the service is healthy.

Prerequisites

Before deploying, make sure the target machine has the following available:
  • Java 21 — the application is compiled for Java 21 and will not start on earlier versions.
  • PostgreSQL — a running instance accessible from the deployment host. The API uses JDBC with the org.postgresql.Driver.
  • A writable filesystem path for uploaded images (the uploads/ directory relative to the working directory).
The database schema is managed automatically via spring.jpa.hibernate.ddl-auto=update. Tables are created or altered on startup — no manual migration step is needed for a first-time deploy.

Building the application

1

Clone the repository and navigate to the project root

Ensure the Maven wrapper script is executable before running any build commands.
chmod +x mvnw
2

Build the executable JAR

Use the Maven wrapper to compile the code and package it as a single self-contained JAR. The -DskipTests flag speeds up the build when tests have already been validated in CI.
./mvnw clean package -DskipTests
The output artifact will be written to:
target/apiregistropendientes-0.0.1-SNAPSHOT.jar

Configuration

The application reads its settings from application.properties (or application.yml) bundled inside the JAR. You must override the database connection properties at runtime — never bake real credentials into the committed source file.

Required properties

PropertyDescription
spring.datasource.urlJDBC URL of your PostgreSQL instance
spring.datasource.usernameDatabase username
spring.datasource.passwordDatabase password

Supplying overrides

Pass property overrides directly to the java command. This is the simplest approach for scripted deployments.
java -jar target/apiregistropendientes-0.0.1-SNAPSHOT.jar \
  --spring.datasource.url=jdbc:postgresql://db-host:5432/mydb \
  --spring.datasource.username=myuser \
  --spring.datasource.password=mypassword
Never commit database credentials to version control. Use environment variables or a secrets manager (e.g., AWS Secrets Manager, HashiCorp Vault) to inject credentials at deploy time.

Running the application

Start the JAR from the directory where the uploads/ folder should live (typically the deployment root):
java -jar target/apiregistropendientes-0.0.1-SNAPSHOT.jar
The server binds to 0.0.0.0:8080 by default, making it reachable on all network interfaces. To run as a background process using nohup:
nohup java -jar target/apiregistropendientes-0.0.1-SNAPSHOT.jar \
  --spring.datasource.url=jdbc:postgresql://db-host:5432/mydb \
  --spring.datasource.username=myuser \
  --spring.datasource.password=mypassword \
  > app.log 2>&1 &

File upload storage

Uploaded images are stored on the local filesystem under the uploads/notas/ directory, relative to the process working directory. The directory is created automatically on first use, but the parent path must be writable by the OS user running the process. The static resource handler exposes the directory at /uploads/**:
GET http://your-host:8080/uploads/notas/example.jpg
For production deployments behind a load balancer or with multiple instances, replace the local uploads/ directory with a shared volume or object storage (e.g., S3-compatible). Update WebConfig to point to the new resource location accordingly.

File size limits

The following limits are configured by default:
SettingValue
Max single file size50 MB
Max request size50 MB
To override these at runtime:
java -jar target/apiregistropendientes-0.0.1-SNAPSHOT.jar \
  --spring.servlet.multipart.max-file-size=100MB \
  --spring.servlet.multipart.max-request-size=100MB

Connection pool

The API uses HikariCP with a deliberately small pool configuration, suited for managed database plans with limited connection quotas:
SettingValueNotes
maximum-pool-size5Hard cap on concurrent DB connections
minimum-idle1Keeps one connection warm
idle-timeout30 sIdle connections are released after 30 seconds
max-lifetime30 minConnections are recycled every 30 minutes
connection-timeout30 sRequest fails if no connection is available within 30 seconds
With a pool of 5, high-concurrency deployments may queue or timeout under load. If your database plan supports it, increase spring.datasource.hikari.maximum-pool-size via command-line override.

Health check

The API is ready to serve traffic when port 8080 responds to HTTP requests. A simple check:
curl -I http://your-host:8080/swagger-ui/index.html
A 200 OK response confirms the application started successfully. For automated health checks (e.g., in Docker or a load balancer), target the Swagger UI or any public endpoint:
http://your-host:8080/swagger-ui/index.html

API documentation

The interactive Swagger UI is available at:
http://your-host:8080/swagger-ui/index.html
Use it to explore all available endpoints, inspect request/response schemas, and test calls directly from the browser.
In production, consider restricting access to the Swagger UI via a reverse proxy (e.g., NGINX) so it is only reachable from internal networks.

Summary

Build

./mvnw clean package -DskipTests — produces the runnable JAR in target/.

Configure

Supply spring.datasource.url, username, and password via command-line args or environment variables.

Run

java -jar target/apiregistropendientes-0.0.1-SNAPSHOT.jar — binds to port 8080.

Verify

Hit http://your-host:8080/swagger-ui/index.html — a 200 response means the API is live.

Build docs developers (and LLMs) love