Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📋 Task Manager



A RESTful API built with Spring Boot for managing tasks (create, read, update, delete), backed by an embedded H2 database.


✅ Requirements

No need to install Maven separately. This project includes the Maven Wrapper (mvnw). No need to install a database. It uses an embedded H2 database.

⚙️ How to Run

  1. Clone the repository
git clone https://github.com/artknak/task-manager.git
cd task-manager
  1. Run the application
# Linux/Mac
./mvnw spring-boot:run

# Windows
mvnw.cmd spring-boot:run

On Linux/Mac, if you get a "Permission denied" error, run chmod +x mvnw first.

  1. The API will be available at http://localhost:8080

🛠️ How to Use

A Postman collection is available here to test the endpoints.

🔍 Get All Tasks

Get all tasks currently saved.

GET http://localhost:8080/task

Example response:

{
    "msg": "Tasks retrieved successfully.",
    "data": [
        {
            "id": 1,
            "name": "Do summary",
            "dueDate": "2025-10-12",
            "responsible": "Artur"
        },
        {
            "id": 2,
            "name": "Refactor code",
            "dueDate": "2025-10-15",
            "responsible": "John"
        },
        {
            "id": 3,
            "name": "Send email to professor",
            "dueDate": "2025-10-10",
            "responsible": "Maria"
        }
    ]
}

🔍 Get Task By Id

Get a single task by adding its ID after the endpoint.

GET http://localhost:8080/task/1

Example response:

{
    "msg": "Task retrieved successfully.",
    "data": {
        "id": 1,
        "name": "Do summary",
        "dueDate": "2025-10-12",
        "responsible": "Artur"
    }
}

📝 Create Task

Create a task.

POST http://localhost:8080/task
Content-Type: application/json
{
  "name": "Test",
  "dueDate": "2025-11-20",
  "responsible": "Gabriela"
}

Example response:

{
    "msg": "Task created successfully.",
    "data": {
        "id": 4,
        "name": "Test",
        "dueDate": "2025-11-20",
        "responsible": "Gabriela"
    }
}

✏️ Update Task

Update a task by adding its ID after the endpoint.

PUT http://localhost:8080/task/1
Content-Type: application/json
{
  "name": "Updated task",
  "dueDate": "2025-10-25",
  "responsible": "Carlos"
}

Example response:

{
    "msg": "Task updated successfully.",
    "data": {
        "id": 1,
        "name": "Updated task",
        "dueDate": "2025-10-25",
        "responsible": "Carlos"
    }
}

🗑️ Delete Task By Id

Delete a single task by adding its ID after the endpoint.

DELETE http://localhost:8080/task/1

Example response:

{
    "msg": "Task deleted successfully.",
    "data": null
}

🗑️ Delete All Tasks

Delete all tasks.

DELETE http://localhost:8080/task

Example response:

{
    "msg": "All tasks deleted successfully.",
    "data": null
}

Contributors

Languages