This project was done as a part of Object Oriented Design (CSYE 6200) Course-work, and have been uploaded here from private university github profile.
TaskSphere is a collaborative project and task management system inspired by Kanban principles. It offers a visual board for streamlined project organization, allowing users to create, assign, and track tasks effectively. With features such as detailed task management, real-time progress monitoring, and user assignments, TaskSphere facilitates seamless collaboration. Authentication is handled through JWT tokens, ensuring secure user access. The system also supports export/import functionalities for efficient project management. TaskSphere aims to enhance team coordination and project success with its user-friendly interface and robust features.
- Introduction
- Tech Stack
- Flows
- Concepts Used
- Individual Contributions
- Class Diagram
- Steps to Setup Backend
- Steps to Setup Frontend
- Swagger Documentation
The User Flow involves the creation, authentication, and management of users. Users can register and log in through the AuthenticationController
, which uses the AuthenticationServiceImpl
. User information is stored in the User
entity, and passwords are securely encoded.
Upon successful registration or login, a JWT token is generated for user authentication. The Token
entity represents these tokens, allowing secure access to protected endpoints.
The Authentication Flow begins with the AuthenticationController
, handling user registration and login endpoints. These are processed by the AuthenticationServiceImpl
. The register
function creates a new user and generates a JWT token, while login
authenticates the user and returns a JWT token. The Token
entity represents a user's authentication token.
In the Project Flow, ProjectController
manages endpoints for project operations. The ProjectServiceImpl
provides functions for interacting with projects, including getting project details, creating, updating, and deleting projects, assigning users to projects, and exporting/importing projects from/to CSV files. The Project
entity represents a project, and UserProject
represents the relationship between users and projects.
The Task Flow is handled by TaskController
, including endpoints for tasks like getting task details, creating, updating, and deleting tasks, assigning tasks to users, and changing task priority and status. The TaskServiceImpl
implements functions for these operations. The Task
entity represents a task with properties like name, description, deadline, priority, status, associated project, assignee, and comments.
Inheritance
ProjectRequest extends ProjectDTO
,
ProjectRepository extends JPARepository
,
BadRequestException extends RuntimeException
Polymorphism In entity models: User.java, Task.java, Project.java, Token.java, JwtAuthenticationFilter.java etc.
toString
,
equals
,
logout
,
compare
,
compareTo
,
createProject
,
commence
,
doFilterInternal
@Override
public void logout(
HttpServletRequest request,
HttpServletResponse response,
Authentication authentication
) {
final String authHeader = request.getHeader("Authorization");
final String jwt;
if (authHeader == null || !authHeader.startsWith("Bearer ")) {
return;
}
}
APIs Interfaces & Implementations
AuthenticationServiceImpl implements AuthenticationService
,
UserServiceImpl implements UserService
,
UserProjectServiceImpl implements UserProjectService
,
ProjectServiceImpl implements ProjectService
,
TaskServiceImpl implements TaskService
Enums
Role
Role.java : Admin, Manager, Developer
Task Priority
Task Priority.java : Lowest, Low, Medium, High, Highest
Abstarct methods
public abstract ProjectDTO createProjectDto(Integer id, String name, String description);
ProjectDtoFactory.java
Lambdas
List<TaskDTO> taskDTOList = taskStream
.sorted()
.map(this::mapToTaskDTO)
.collect(Collectors.toList());
taskStream = taskStream.filter(task -> task.getPriority().equals(priority));
Inner classes
public static class UserProjectId implements Serializable
- UserProject.java
public static class LastestCommentComparator implements Comparator<Comment>
- Comment.java
Comparators Comment.java
public static class LastestCommentComparator implements Comparator<Comment> {
@Override
public int compare(Comment o1, Comment o2) {
return o2.getCreatedAt().compareTo(o1.getCreatedAt());
}
}
Comparables Task.java
public class Task implements Comparable<Task> {
@Override
public int compareTo(Task o) {
return Integer.compare(this.getPriority().getPriority(), o.getPriority().getPriority());
}
}
Generics
TaskRepository extends JpaRepository<Task, Integer>
,
Exception Handling
BadRequestException extends RuntimeException
,
ResourceNotFoundException extends RuntimeException
,
UnauthorizedException extends RuntimeException
CSV file handling Importing Project from CSV File (Reading CSV Files) - ProjectServiceImpl.java
public ResponseEntity<List<ProjectDTO>> importProject(File file) {
ProjectFactory projectFactory = ProjectFactory.getInstance();
List<ProjectDTO> list = new ArrayList<>();
try (FileReader fr = new FileReader(file); BufferedReader br = new BufferedReader(fr)) {
String inputLine = null;
while ((inputLine = br.readLine()) != null) {
String[] fields = inputLine.split(",");
Project project = projectFactory.createProject(fields[0], fields[1]);
projectRepository.save(project);
list.add(new ProjectDTO(project.getId(), project.getName(), project.getDescription()));
}
} catch (Exception e) {
e.printStackTrace();
}
return ResponseEntity.ok(list);
}
String Builder ProjectServiceImpl.java
for (Project p : projects) {
StringBuilder sb = new StringBuilder();
sb.append(p.getId()).append(",");
sb.append(p.getName()).append(",");
sb.append(p.getDescription()).append(",");
sb.append(p.getCreatedAt());
bw.write(sb.toString());
bw.newLine();
list.add(new ProjectDTO(p.getId(), p.getName(), p.getDescription()));
}
-
Repository Pattern:
UserRepository.java
,TaskRepository.java
- Provides a consistent and abstracted interface for data access, facilitating interactions with the underlying database for entities such as
User
,UserProject
,Task
, andProject
.
-
Factory Method Pattern:
- Eager Singleton Factory
ProjectFactory.java
, - Lazy Singleton Factory
UserProjectFactory.java
, - Enum Singleton Factory
ProjectDtoFactory.java
- Encapsulates the creation of complex objects (
Project
,ProjectDTO
) in a separate factory class, promoting code organization and separation of concerns.
- Eager Singleton Factory
-
Singleton Pattern:
- Eager Singleton Factory
ProjectFactory.java
, - Lazy Singleton Factory
UserProjectFactory.java
, - Enum Singleton Factory
ProjectDtoFactory.java
- Utilized in the factory classes to ensure a single instance of the factory exists, controlling access to the creation methods and maintaining a global point of access.
- Eager Singleton Factory
-
Observer Pattern:
Task.java
,Comment.java
- Established implicitly through the bidirectional relationship between
Task
andComment
, allowing tasks to be observed for changes in the associated comments. Any changes in comments can be reflected in the task, providing a form of observation.
-
Strategy Pattern:
TaskServiceImpl.java
- The strategy pattern is not explicitly implemented in the code but can be considered in the
TaskServiceImpl
. The service class encapsulates algorithms for various task operations, providing a strategy for each operation.
-
MVC (Model-View-Controller) Pattern:
- packages:
controller
,service
,repository
,model
,entity
- The MVC pattern is implicitly applied in the task management module. The
Controller
acts as the controller, handling user input and directing it to theServiceImpl
for processing. TheDTO
&Entity
serves as the model, representing the data, and the view is represented by the API endpoints, which return responses to the user.
Name | NU ID | Contributions |
---|---|---|
Aashish Chaple | #002680570 | Streams, Enums, Strategy Pattern, MVC Design Pattern |
Akhileshkumar Kumbar | #002201470 | Lazy Singleton Design Pattern, Enum Singleton Factory Pattern |
Akshay Bharadwaj | #002745765 | Observer Design Pattern, Streams, MVC Design Pattern |
Pritesh Nimje | #002817324 | Repository Pattern, Observer Pattern, MVC Design Pattern, Streams |
Ruchika Shashidhara | #002245068 | Comparable, Streams, Enum Singleton & Lazy Singleton Factory Pattern |
Sai Geeta Acharya | #002627749 | Comparator, Inner Classes, Eager Singleton Factory Pattern |
Yuchen Zhang | #002646829 | CSV Files, Repository Design Pattern, MVC Design Pattern |
1. Clone the application
git clone https://github.com/CSYE6200-Object-Oriented-DesignFall2023/final-project-final-group-19.git
2. Create postgres database
create database 'TaskSphere'
- run
src/main/resources/tasksphere.sql
3. Run the app using maven
cd backend
mvn clean install
mvn spring-boot:run
The app will start running at http://localhost:8080
This project was bootstrapped with Create React App.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
You can learn more in the Create React App documentation.
Swagger documentation will be available at http://localhost:8080/swagger-ui/index.html