This is a REST API for a task app that allows users to CRUD tasks. By default tasks are created to a public tenant, use the tenantId field to create tasks for a specific tenant. Is built with Java 21, Spring Boot, Spring Data JPA, H2 Database and Gradle.
- Java 21 - It is recommended to use sdkman to manage the Java version.
git clone <repository-url>
cd task-appThe project includes a Gradle wrapper, so you don't need to install Gradle separately.
# Navigate to the project directory
cd task-app
# Make the gradlew script executable (on macOS/Linux)
chmod +x gradlew
# Run the application
./gradlew bootRungradle bootRun- Server Port: 8080 (default Spring Boot port)
- Database: H2 in-memory database
- Base URL:
http://localhost:8080/api/v1
The application provides the following REST endpoints:
-
Header:
X-Tenant-ID(string, optional) - Specify the tenant ID for multi-tenancy (default: public)
-
GET
/tasks- Get all tasks (paginated)- Query parameters:
page- Page number (default: 0)size- Page size (default: 20)sort- Sort criteria (default: createdAt)status- Filter by task status (optional)
- Query parameters:
-
GET
/tasks/{id}- Get task by ID -
POST
/tasks- Create a new task- Body parameters:
title(string, required, max 100 characters)description(string, optional)
- Body parameters:
-
PUT
/tasks/{id}- Update an existing task- Body parameters:
title(string, required, max 100 characters)description(string, optional)status(enum: PENDING, IN_PROGRESS, COMPLETED)
- Body parameters:
-
DELETE
/tasks/{id}- Delete a task
./gradlew test