task-list-api/
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ ├── com/
│ │ │ │ ├── com.example.task_list_api/
│ │ │ │ │ ├── task_list_api/
│ │ │ │ │ │ ├── controller/
│ │ │ │ │ │ │ ├── TaskController.java
│ │ │ │ │ │ ├── model/
│ │ │ │ │ │ │ ├── Task.java
│ │ │ │ │ │ ├── service/
│ │ │ │ │ │ │ ├── TaskService.java
│ │ │ │ │ │ ├── config/
│ │ │ │ │ │ │ ├── CorsConfig.java
│ ├── resources/
│ │ ├── static/
│ │ ├── template/
│ │ ├── application.properties
│ │ ├── tasks.json
├── target/
├── pom.xml
├── test/
This API serves as a backend for a task management application. It provides endpoints for managing tasks, including creating, reading, updating, and deleting tasks.
The tech stack used includes Spring Boot for the backend, with MVC architecture for handling HTTP requests. The frontend is built separately and consumes the API's endpoints. Data is stored in a JSON file (tasks.json
) and is read and manipulated by the API.
- Get All Tasks:
curl https://task-list-api-java.onrender.com/api/tasks
- Get Task by ID:
curl https://task-list-api-java.onrender.com/api/tasks/{id}
- Add New Task:
curl -X POST -H "Content-Type: application/json" -d '{"task":"New Task","completed":false}' https://task-list-api-java.onrender.com/api/tasks
- Update Task:
curl -X PUT -H "Content-Type: application/json" -d '{"task":"Updated Task","completed":true}' https://task-list-api-java.onrender.com/api/tasks/{id}
- Delete Task:
curl -X DELETE https://task-list-api-java.onrender.com/api/tasks/{id}
- Open Postman and import the provided collection.
- Test each endpoint by sending the appropriate HTTP request with required parameters.
The frontend of this application is deployed on Netlify and can be accessed at Task List UI.