This project implements a backend service in Java using Spring Boot that manages "Task" objects and their executions. The application exposes RESTful endpoints for creating, retrieving, deleting, and executing tasks.
- 
Java 17+ 
- 
Spring Boot 
- 
MongoDB (docker container) 
- 
Maven 
- 
REST API (JSON) 
- 
Postman 
- 
id: String — Unique task ID
- 
name: String — Task name
- 
owner: String — Task owner
- 
command: String — Shell command to execute
- 
taskExecutions: List ofTaskExecution
- 
startTime: Date — Execution start time
- 
endTime: Date — Execution end time
- 
output: String — Command output
| Method | Endpoint | Description |
|--------|-----------------------------|------------------------------------------|
| GET | /tasks | Get all tasks |
| GET | /tasks?id={id} | Get task by ID |
| PUT | /tasks | Create or update a task |
| DELETE | /tasks?id={id} | Delete task by ID |
| GET | /tasks/search?name={name} | Search tasks by name |
| PUT | /tasks/{id}/execute | Execute task command and store output |
Only safe shell commands are allowed. The following are permitted:
echo, ls, pwd, whoami, date, uptime, cat, touch, mkdir, sleep, head, tail, df, du
Before running the app, ensure the following are installed:
- 
Java 17+ 
- 
Maven 
- 
MongoDB via Docker 
git clone https://github.com/Jithin-b-p/task-java-backend
cd task-java-backenddocker run -d -p 27017:27017 --name task-mongo mongomvn clean installmvn spring-boot:run





