Author: Shyam Anand
Date: October 19, 2025
This project implements a Java-based REST API for managing task objects that represent shell commands. The application is built using Spring Boot 3.5.6, MongoDB for data persistence, and provides endpoints for creating, searching, updating, deleting, and executing shell commands.
- Java: 17
- Framework: Spring Boot 3.5.6
- Database: MongoDB (Local instance)
- Build Tool: Maven
- Testing: Postman
C:.
| .gitattributes
| .gitignore
| Dockerfile
| HELP.md
| mvnw
| mvnw.cmd
| pom.xml
| structure.txt
|
+---.mvn
| \---wrapper
| maven-wrapper.properties
|
+---.vscode
| settings.json
|
+---Kubernetes_YAML
| app-deployment.yaml
| mongodb-deployment.yaml
| rbac.yaml
|
+---src
| +---main
| | +---java
| | | \---com
| | | \---platinum
| | | \---task_manager
| | | CorsConfig.java
| | | PlatinumTaskManagerApplication.java
| | | Task.java
| | | TaskController.java
| | | TaskExecution.java
| | | TaskRepository.java
| | |
| | \---resources
| | | application.properties
| | |
| | +---static
| | \---templates
| \---test
| \---java
| \---com
| \---platinum
| \---task_manager
| TaskManagerApplicationTests.java
|
\---target
| task-manager-0.0.1-SNAPSHOT.jar
| task-manager-0.0.1-SNAPSHOT.jar.original
|
+---classes
| | application.properties
| |
| \---com
| \---platinum
| \---task_manager
| CorsConfig.class
| PlatinumTaskManagerApplication.class
| Task.class
| TaskController.class
| TaskExecution.class
| TaskRepository.class
|
+---generated-sources
| \---annotations
+---generated-test-sources
| \---test-annotations
+---maven-archiver
| pom.properties
|
+---maven-status
| \---maven-compiler-plugin
| +---compile
| | \---default-compile
| | createdFiles.lst
| | inputFiles.lst
| |
| \---testCompile
| \---default-testCompile
| createdFiles.lst
| inputFiles.lst
|
\---test-classes
\---com
\---platinum
\---task_manager
TaskManagerApplicationTests.class
- Java 17 or higher
- Maven
- MongoDB (running locally on port 27017)
-
Clone the repository: git clone https://github.com/ShyamAnand2/Kaiburr-Assessment-Task1.git cd Kaiburr-Assessment-Task1
-
Ensure MongoDB is running: mongod --dbpath=C:\data\db
-
Build and run the application: mvnw.cmd spring-boot:run
-
The application will start on: http://localhost:8080
{ "id": "string", "name": "string", "owner": "string", "command": "string", "taskExecutions": [ { "startTime": "date", "endTime": "date", "output": "string" } ] }
Endpoint: POST /tasks
Description: Creates a new task with the specified name, owner, and command.
Request Body: { "name": "platinum-test", "owner": "Shyam", "command": "echo platinum" }
Endpoint: GET /tasks
Description: Returns a list of all tasks stored in the database.
Endpoint: GET /tasks/search?name={searchString}
Description: Searches for tasks where the name contains the specified string.
Example: GET /tasks/search?name=platinum
Endpoint: PUT /tasks/{id}
Description: Updates an existing task with new data.
Request Body: { "name": "platinum-updated", "owner": "Shyam", "command": "echo updated" }
Screenshot:
Before: When we specifically create a platinum-original task to showcase the update functionality

After: The GET with all the tasks to showcase that PUT was used to update platinum-original to platinum-updated.

Endpoint: DELETE /tasks/{id}
Description: Deletes a task by its ID.
Example: DELETE /tasks/671234abcd5678ef
Screenshot:
Before: Refer to the ID fo the task which was deleted to showcase functionality.

After: One of them missing, run with the DELETE command.

Endpoint: PUT /tasks/{id}/execute
Description: Executes the shell command associated with the task and stores the execution result (startTime, endTime, output) in the taskExecutions array.
Example: PUT /tasks/671234abcd5678ef/execute
Note: No request body required. Only commands starting with "echo " are allowed for security reasons.
Screenshot - After Execution:
The time stamp in the taskExecutions bar shows the time when the code has been executed, and the table in the Preview part shows how many times the task has been executed.
- Command validation is implemented to allow only safe
echocommands - Commands must start with "echo " to be executed
- This prevents execution of potentially malicious or unsafe shell commands
The following screenshot shows the tasks stored in MongoDB Compass:

All endpoints were tested using Postman. The screenshots above demonstrate:
- Request URL and HTTP method
- Request body (where applicable)
- Response with status code
- Timestamp and author name visible
Request: POST http://localhost:8080/tasks Content-Type: application/json
{ "name": "platinum-two", "owner": "Shyam", "command": "echo platinum 2" }
Response: { "id": "68f4e3925c39df428267296f", "name": "platinum-two", "owner": "Shyam", "command": "echo platinum 2", "taskExecutions": [] }
Request: PUT http://localhost:8080/tasks/68f4e3925c39df428267296f/execute
Response: { "id": "68f4e3925c39df428267296f", "name": "platinum-two", "owner": "Shyam", "command": "echo platinum 2", "taskExecutions": [ { "startTime": "2025-10-19T13:30:15.123+00:00", "endTime": "2025-10-19T13:30:15.456+00:00", "output": "platinum 2\n" } ] }
- Only
echocommands are supported for execution - Commands are executed locally on Windows using
cmd.exe /c - No authentication/authorization implemented (as per task requirements)
- Support for additional safe shell commands
- Kubernetes pod execution (Task 2 requirement)
- Input validation and error handling improvements
- Rate limiting and request throttling
All screenshots in this README include:
- My name (Shyam Anand) visible in the environment
- System timestamp visible in the taskbar
- Complete request/response information
Repository: https://github.com/ShyamAnand2/Kaiburr-Assessment-Task1
Submission Date: October 20, 2025


