This README provides an overview of the features offered by TaskFlow, including CRUD operations, exception handling, response entities, and data transfer objects (DTOs). This API is built using Spring Boot,Spring Data JPA,H2 Database and is designed for managing tasks and notes effectively.
- Task Management: Create, read, update, and delete tasks.
- Note Management: Associate notes with specific tasks, allowing for detailed task descriptions.
- Exception Handling: Graceful error management with meaningful responses.
- Response Entities: Standardized responses for success and error scenarios.
- Data Transfer Objects: Efficient data handling between the client and server.
The application follows a layered architecture:
- Controllers: Handle incoming HTTP requests and return appropriate responses.
- Services: Contain the business logic and interact with the data layer.
- Repositories: Interface with the database to perform CRUD operations.
- Models: Define the data structure for tasks and notes.
The application utilizes Spring Boot's built-in features for dependency injection, RESTful services, and data management.
- Create: Add a new task using
POST /tasks. - Read: Retrieve tasks with:
GET /tasksfor all tasks.GET /tasks/{id}for a specific task.
- Update: Modify an existing task using
PATCH /tasks/{id}. - Delete: Remove a task with
DELETE /tasks/{id}.
- Create: Add a new note to a task with
POST /tasks/{taskId}/notes. - Read: Access notes using:
GET /tasks/{taskId}/notesfor all notes of a task.GET /tasks/{taskId}/notes/{noteId}for a specific note.
- Update: Modify an existing task using
PATCH /tasks/{taskId}/notes/{noteId}. - Delete: Remove a note with
DELETE /tasks/{taskId}/notes/{noteId}.
The application includes centralized exception handling for:
- Task Not Found: Returns a
404 Not Foundresponse if a task is not found. - Note Not Found: Returns a
404 Not Foundresponse if a note is not found.
Custom error messages are provided to help identify the issue.
The API utilizes the following DTOs for structured data exchange:
-
ErrorResponse DTO:
- Structure for error messages.
-
SuccessResponse DTO:
- Structure for success messages.
-
TasksResponse DTO:
- Structure to represent a collection of tasks, including count and task details.
-
NotesResponse DTO:
- Structure to represent a collection of notes, including count and note details.
To set up the Task Manager application on your local machine, follow these steps:
-
Clone the Repository: Open your terminal and run the following command to clone the repository:
git clone https://github.com/ashutoshsanghi3/TaskFlow.git
-
Navigate to the Project Directory: Change to the directory of the cloned repository:
cd your-project-directory -
Build the Project with Maven: Run the following command to build the project:
mvn clean install
-
Run the Application: Start the application using Maven:
mvn spring-boot:run