Implement a Java Spring Boot application that serves as a backend for a task management system. The application should support user authentication, creating tasks with deadlines and priorities, and organizing tasks into projects. Use JWT for authentication and Hibernate for interacting with a MySQL database.
PLAINFORMAT
// Task.java
@Entity
public class Task {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    private String title;
    private String description;
    private LocalDateTime deadline;
    private Integer priority;

    @ManyToOne
    private Project project;

    // Getters and setters...
}

// Project.java
@Entity
public class Project {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    private String name;

    @OneToMany(mappedBy = "project")
    private List<Task> tasks;

    // Getters and setters...
}

// TaskController.java
@RestController
@RequestMapping("/api/tasks")
public class TaskController {

    @Autowired
    private TaskService taskService;

    @GetMapping
    public ResponseEntity<List<Task>> getAllTasks() {
        return ResponseEntity.ok(taskService.findAll());
    }

    // Other endpoints like create, update, delete...
}

// ProjectController.java
@RestController
@RequestMapping("/api/projects")
public class ProjectController {

    @Autowired
    private ProjectService projectService;

    @GetMapping
    public ResponseEntity<List<Project>> getAllProjects() {
        return ResponseEntity.ok(projectService.findAll());
    }

    // Other endpoints like create, update, delete...
}