Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ricpalomino/spring-boot/llms.txt

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

This guide walks you through cloning the repository, building the project with Maven, starting the application, and making your first real HTTP request to create a product. By the end you will have a running API on port 8080 and an understanding of the ApiResponse<T> envelope every endpoint returns.
1

Check prerequisites

You need the following tools installed before you begin:
  • Java 17 or later — confirm with java -version
  • Maven — the repository includes the Maven Wrapper (mvnw), so a system-wide Maven installation is optional
java -version
# java version "17.0.x" ...
2

Clone the repository

git clone https://github.com/ricpalomino/spring-boot.git
cd spring-boot
3

Build the project

Run the Maven Wrapper to compile source code, run tests, and install the artifact to your local Maven repository:
./mvnw clean install
A BUILD SUCCESS message confirms the project compiled and all tests passed.
4

Start the application

./mvnw spring-boot:run
The application starts on port 8080 by default. You will see log output similar to:
2026-05-19 10:00:00 - Started DemoApplication in 2.341 seconds
Spring Boot DevTools is included as a runtime dependency. While running with spring-boot:run, the server automatically restarts whenever you save a .java file — no manual restart required during development.
5

Verify the API is running

In a separate terminal, send a GET request to list all products:
curl http://localhost:8080/api/v1/products
Because the in-memory store starts empty, the response is:
{
  "responseCode": "200",
  "responseMessage": "Productos obtenidos correctamente",
  "data": []
}
6

Create your first product

Send a POST request with a JSON body containing a name (3–100 characters) and a price (minimum 1):
curl -X POST http://localhost:8080/api/v1/products \
  -H "Content-Type: application/json" \
  -d '{"name": "Widget Pro", "price": 49.99}'
The server responds with HTTP 201 Created and the saved product wrapped in the ApiResponse envelope:
{
  "responseCode": "201",
  "responseMessage": "Producto creado correctamente",
  "data": {
    "id": 1,
    "name": "Widget Pro",
    "price": 49.99
  }
}
The id field is assigned automatically by the in-memory repository, starting at 1 and incrementing with each new product.
7

Explore the Swagger UI

Open your browser and navigate to:
http://localhost:8080/swagger-ui.html
The interactive Swagger UI, powered by springdoc-openapi 2.8.0, lists every endpoint — including GET /api/v1/products/filter — and lets you send requests directly from the browser without any additional tooling.
Now that you have a working API, read the architecture page to understand how the controller, service layer, repository, and Strategy Pattern fit together — and how to swap the active service implementation.

Build docs developers (and LLMs) love