This project is a RESTful API built with Java Spring Boot, integrated with a PostgreSQL database, and containerized using Docker. Key features include:
- Spring Boot framework for efficient API development
- PostgreSQL as the relational database, managed via Spring Data JPA
- Docker for easy containerization and environment consistency
- Basic CRUD operations for resource management
- Exception handling, logging, and validation mechanisms
- Unit and integration tests for reliability
Perfect for scalable and portable backend services.
This API allows CRUD operations on a resource. Below are the available routes:
- Method: GET
- Endpoint:
/tarefas/{TarefaId}
- Description: Retrieves a specific resource by ID.
- URL Example:
http://localhost:8080/tarefas/{TarefaId}
- Response:
{ "id": 1, "titulo": "Resource titulo", "descricao": "Resource description" }
- Method: GET
- Endpoint:
/tarefas
- Description: Retrieves all resources.
- URL Example:
http://localhost:8080/tarefas
- Response:
[ { "id": 1, "titulo": "Resource titulo", "descricao": "Resource description" }, { "id": 2, "titulo": "Resource titulo", "descricao": "Resource description" } ]
- Method: POST
- Endpoint:
/tarefas
- Description: Creates a new resource.
- URL Example:
http://localhost:8080/tarefas
- Request Body:
{ "titulo": "New Resource", "descricao": "Resource description" }
- Response:
{ "id": 2, "titulo": "New Resource", "descricao": "Resource description" }
- Method: PUT
- Endpoint:
/tarefas/{TarefaId}
- Description: Updates an existing resource by ID.
- URL Example:
http://localhost:8080/tarefas/{TarefaId}
- Request Body:
{ "titulo": "Updated Resource", "descricao": "Updated description" }
- Response:
{ "id": 1, "titulo": "Updated Resource", "descricao": "Updated description" }
- Method: DELETE
- Endpoint:
/tarefas/{TarefaId}
- Description: Deletes a specific resource by ID.
- URL Example:
http://localhost:8080/tarefas/{TarefaId}
- Response:
{ "message": "Deleted" }