The Task Management System is a Spring Boot application designed to manage user tasks efficiently. It includes features for user authentication, task creation, retrieval, and deletion, providing a robust backend API for task management.
- Overview
- Technologies Used
- Project Structure
- Setup and Installation
- API Endpoints
- Exception Handling
- Programming Language: Java
- Framework: Spring Boot
- Database: MySQL
- Tools: IntelliJ IDEA, Postman
- Version Control: Git
src/
├── main/
│ ├── java/
│ │ ├── com/
│ │ │ ├── TaskManagement/
│ │ │ │ ├── Controller/
│ │ │ │ │ ├── AuthController.java
│ │ │ │ │ ├── TaskController.java
│ │ │ │ ├── Dto/
│ │ │ │ │ ├── LoginDto.java
│ │ │ │ │ ├── TaskDto.java
│ │ │ │ │ ├── UserDto.java
│ │ │ │ ├── Entity/
│ │ │ │ │ ├── Task.java
│ │ │ │ │ ├── UserRole.java
│ │ │ │ │ ├── Users.java
│ │ │ │ ├── Exceptions/
│ │ │ │ │ ├── APIException.java
│ │ │ │ │ ├── TaskNotFound.java
│ │ │ │ │ ├── UserNotFound.java
│ │ │ │ ├── Repository/
│ │ │ │ │ ├── TaskRepo.java
│ │ │ │ │ ├── UserRepo.java
│ │ │ │ ├── Security/
│ │ │ │ │ ├── SecurityConfig.java
│ │ │ │ ├── Service/
│ │ │ │ │ ├── JwtService.java
│ │ │ │ │ ├── TaskService.java
│ │ │ │ │ ├── UserService.java
│ │ │ │ ├── ServiceImpl/
│ │ └── resources/
│ │ ├── application.properties
- Java JDK 8 or higher
- Maven
- MySQL or any other preferred database
-
Clone the repository
git clone https://github.com/Eshwar863/TaskManagement.git cd task-management-system
-
Configure the database
- Update
src/main/resources/application.properties
with your database configurations.
spring.datasource.url=jdbc:mysql://localhost:3306/yourdatabase spring.datasource.username=yourusername spring.datasource.password=yourpassword spring.jpa.hibernate.ddl-auto=update
- Update
-
Build and run the application
mvn clean install mvn spring-boot:run
-
Create Task
POST /api/task/{id}/task
- Request Body:
TaskDto
- Response:
TaskDto
-
Get All Tasks
GET /api/task/{userid}/tasks
- Response:
List<TaskDto>
-
Get Specific Task
GET /api/task/{userid}/task/{taskid}
- Response:
TaskDto
-
Delete Task
DELETE /api/task/{userid}/task/{taskid}
- Response:
String
curl -X POST "http://localhost:8080/api/task/1/task" -H "Content-Type: application/json" -d '{"title":"Sample Task", "description":"This is a sample task."}'
The application includes custom exceptions to handle specific error cases:
APIException
TaskNotFound
UserNotFound
These exceptions are used to provide meaningful error messages and appropriate HTTP status codes.