Task Tracker Final1

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 67

DESIGN AND IMPLEMENTATION OF A TASK TRACKER WEB

APPLICATION SYSTEM

BY

ADENIRAN GABRIEL OLUWADAMILARE P/ND/21/3210037


OKORONKWO EMMANUEL CHIDIEBUBE P/ND/21/3210211
UGURU JOEL ONNYENATARUCHI P/ND/21/3210239
CHINEDU ISREAL OBINNA P/ND/21/3210168
ADAMS ABDULGAFAR HASSAN P/ND/21/3210137

TO

DEPARTMENT OF COMPUTER TECHNOLOGY


SCHOOL OF TECHNOLOGY
YABA COLLEGE OF TECHNOLGY
YABA, LAGOS

IN PARTIAL FULFILMENT OF THE REQUIREMENT FOR THE


AWARD OF ORDINARY NATIONAL DIPLOMA (OND)

JULY, 2024.
i
CERTIFICATION
This is to certify that this project report title “DESIGN AND IMPLEMENTATION OF A
TASK TRACKER WEB APPLICATION SYSTEM” was carried out by ADENIRAN
GABRIEL OLUWADAMILARE(P/ND/21/3210037), OKORONKWO EMMANUEL
CHIDIEBUBE(P/ND/21/3210211), UGURU JOEL ONYENATARUCHI(P/ND/21/3210239),
CHINEDU ISREAL OBINNA(P/ND/21/3210168),ADAMS ABDULGAFAR
HASSAN(P/ND/21/3210137) under the supervision of MR. FATOKI O.K and submitted to the
Department of Computer Technology, Yaba College of Technology, Yaba, Lagos in partial
fulfilment of the requirement for the award of National Diploma (OND) in Computer Science.

______________ ______________
MR FATOKI O.K DATE
Project Supervisor

______________ ______________
DR RUFAI M.M DATE
Head of Department (HOD) Computer Science

ii
DEDICATION
We dedicate this project work to the Almighty God, whose grace, strength, knowledge, wisdom,
and understanding have guided us to complete this endeavor successfully.
Additionally, we dedicate this project to our parents, and friends for their unwavering love,
understanding, and moral support. Without their encouragement and assistance, this achievement
would not have been possible.
May the Almighty God, in His infinite mercy, continue to bless and guide us all.

iii
ACKNOWLEDGEMENT
We seize this opportunity to extend our heartfelt gratitude to all who have contributed to the
successful completion of this project. First and foremost, we express our deep appreciation to our
supervisor, MR. FATOKI O.K, whose invaluable guidance, dedication, and insightful advice
were instrumental in shaping this project's outcome. We also take this opportunity to express our
deep sense of gratitude to the Head of Department of Computer Technology, DR. RUFAI M.M.
Also, our gratitude goes to our family for their financial, spiritual, and moral support, to all our
friends for their support and encouragement all through the courses of this project. May
Almighty God Bless you all.

iv
ABSTRACT
The Task Tracker project aims to develop a comprehensive web-based application designed to
streamline task management and enhance productivity for staff users. This application addresses
common challenges associated with task organization, assignment, tracking, and collaboration.
Utilizing a robust technological stack, including JavaScript, React.js, Node.js, and MongoDB,
the project delivers a user-friendly interface coupled with advanced functionalities such as user
authentication, data validation, and RESTful APIs. The system integrates with third-party tools
and services to extend its functionality and provides a seamless user experience through intuitive
UI components.

v
TABLE OF CONTENT
TITLE PAGE Ⅰ
CERTIFICATION Ⅱ
DEDICATION Ⅲ
ACKNOWLEDGEMENT Ⅳ
ABSTRACT Ⅴ
TABLE OF CONTENT Ⅵ
CHAPTER ONE – INTRODUCTION

1.1 Background of Study 1-2

1.2 Statement of the problem 2-3

1.3 Aim of Study 3

1.4 Objective of study 3

1.5 Significance of study 4

1.6 Scope of Study 4-5

1.7 Limitations 5-6

1.8 Definition of Terms 6-7

CHAPTER TWO – LITERATURE REVIEW

2.0 Introduction 8

2.1 General Overview of a Task Tracker System 8-9

2.2 Importance of a Task Tracking Web Application System 9-10

2.3 History of Task Tracking 10-11

2.4 Problems of Task Tracking 12-13

2.5 Features of Task Tracking 13

CHAPTER THREE – SYSTEM ANALYSIS AND DESIGN

vi
3.1 Analysis of Existing System 14

3.2 Description/Analysis of the New System 14

3.3 Program Module Specification 14-18

3.4 Input/Output Specification 18-19

3.5 System Flowchart 20-22

3.6 Use Case 22-26

CHAPTER FOUR – SYSTEM IMPLEMENTATION

4.1 System Implementation 27

4.2 System Design 28-30

4.2.1 The Output Design 28-32

4.2.2 The Input Design 32-34

4.3 Software Requirement 34-35

4.4 Choice of Programming Language 35-36

4.5 Change over Method 36-37

4.6 User’s Guide 37

CHAPTER FIVE – SUMMARY, CONCLUSION AND RECOMMENDATION

5.1 Summary 38

5.2 Conclusion 38

5.3 Future Research 38-39

5.4 Recommendation 39

REFERENCES 40

APPENDIX 41-58

vii
CHAPTER ONE
INTRODUCTION

1.1 Background of Study


In the modern landscape of organizational management, task-tracking systems have emerged as
essential components for managing the multitude of tasks, assignments, and projects that
characterize contemporary workflows. These systems, which are increasingly prevalent across
diverse sectors, play a crucial role in facilitating streamlined operations and optimizing
productivity. Educational institutions, exemplified by Yaba College of Technology (Yabatech),
recognize the significance of such systems in meeting the complex demands of their academic
and administrative functions

At their core, task-tracking systems harness the power of technology to provide centralized
platforms dedicated to the assignment, monitoring, and tracking of tasks. By offering a single,
cohesive interface for managing tasks across departments and teams, these systems eliminate the
inefficiencies associated with traditional, fragmented approaches to task management. Instead of
relying on manual methods or disparate tools, institutions like Yabatech can leverage task
trackers to create a unified environment where tasks are assigned, monitored, and completed
with ease.

One of the primary advantages of task-tracking systems lies in their ability to streamline
workflow processes. By providing clear visibility into the status of tasks and assignments, these
systems empower stakeholders to prioritize and allocate resources effectively. Tasks can be
assigned with defined deadlines and priority levels, ensuring that critical activities receive the
necessary attention while minimizing bottlenecks and delays. This streamlined approach not only
enhances overall efficiency but also fosters a culture of accountability among staff members.

In the context of educational institutions like Yabatech, the adoption of task-tracking systems
holds immense promise for enhancing operational efficiency and optimizing resource utilization.
Academic and administrative processes, which often involve a myriad of tasks and
responsibilities, can benefit from the structured framework provided by these systems. From
managing course assignments and academic projects to coordinating administrative tasks and

1
facility maintenance, task trackers offer a comprehensive solution tailored to the unique needs of
educational environments.

In summary, the adoption of task-tracking systems represents a paradigm shift in how


organizations approach task management and workflow optimization. By harnessing technology
to centralize task-related activities, these systems empower institutions like Yabatech to operate
more efficiently, communicate more effectively, and collaborate more seamlessly. As the
demands of modern-day workflows continue to evolve, task-tracking systems stand as
indispensable tools for organizations striving to stay ahead in an increasingly dynamic and
competitive landscape.

1.2 Statement of Problem


The statement of the problem regarding the implementation of a task tracker system in Yaba
College of Technology (Yabatech) revolves around the problems and challenges faced in
managing tasks, assignments, and projects within the institution using traditional methods. Some
specific issues include:

1. Lack of Centralization: Currently, task management at Yabatech might be decentralized, with


tasks assigned and tracked through disparate systems or manual processes. This decentralization
can lead to confusion, duplication of efforts, and difficulties in tracking task progress efficiently.

2. Ineffective Communication: Without a centralized task tracking system, communication


regarding task assignments, updates, and deadlines might be fragmented or unclear. This can
result in misunderstandings, missed deadlines, and suboptimal collaboration among faculty and
staff members.

3. Limited Visibility and Accountability: Manual task tracking methods may lack real-time
visibility into task progress and completion status. This lack of visibility makes it challenging for
administrators to hold individuals or teams accountable for their assigned tasks, leading to
potential delays and inefficiencies.

4. Resource Misallocation: Without proper tracking and analysis of task allocation and workload
distribution, there's a risk of resources being misallocated. Some departments or individuals

2
might be overloaded with tasks, while others remain underutilized, leading to imbalances in
productivity and efficiency.

5. Data-Driven Decision Making: In the absence of comprehensive reporting and analytics


capabilities, administrators may lack the necessary insights to make data-driven decisions
regarding task prioritization, resource allocation, and process optimization.

6. Risk of Errors and Delays: Manual task management processes are prone to errors, such as
data entry mistakes, missed updates, and overlooked deadlines. These errors can lead to delays in
task completion, negatively impacting overall productivity and organizational effectiveness.

In summary, the problem statement highlights the need for a centralized task tracker system in
Yabatech to address the challenges faced with decentralized task management, ineffective
communication, limited visibility, accountability issues, resource misallocation, and the lack of
data-driven decision-making capabilities.

1.3 Aim of Study


The Problem that Task Tracker aims to solve is the lack of a secure and reliable platform for
managing-to-do-list. Traditional-to-do-list applications often face issues like data privacy,
centralized control, and lastly data loss which will lead to a lack of transparency and trust, as
users have a limited visibility of how their data is handled and managed. The primary aim of
studying a task Tracker system is to design, develop, and implement a comprehensive web
application solution that effectively addresses task management in an organization. The goal is to
enhance productivity, streamline workflow processes, improve communication, and
collaboration among staff, and promote accountability in task execution. Additionally, the aim
provides administrators access to reporting functionality to support informed decision-making
and optimize resource allocation.

1.4 Objectives of Study


This study seeks to design and implement a comprehensive Task Tracker System for Yabatech,
with the following objectives:

3
1. Provide a centralized platform for assigning, monitoring, and tracking tasks across
various departments within the institution.
2. Enhance communication and collaboration among faculty and staff members, facilitating
seamless coordination and information sharing.
3. Streamline workflow processes and improve efficiency in task management, thereby
reducing delays and bottlenecks.
4. Promote accountability by establishing clear task assignments and enabling real-time
progress tracking, fostering a culture of responsibility and ownership.
5. Facilitate data-driven decision-making through the provision of comprehensive reports
and analytics, enabling administrators to gain insights into performance metrics and identify
areas for improvement.

1.5 Significance of Study


Implementing a Task Tracker System at Yabatech holds significant implications for enhancing
operational efficiency, improving communication, and promoting accountability within the
institution. By providing a centralized platform for task management, the system will streamline
workflow processes, reduce errors, and facilitate timely completion of tasks. Moreover, access to
real-time data and analytics will empower administrators to make informed decisions, optimize
resource allocation, and drive continuous improvement initiatives.

1.6 Scope of Study


The scope of the study regarding the implementation of a task tracker system at Yaba College of
Technology (Yabatech) covers several key aspects:
1. System Development: The study will focus on the design, development, and implementation
of a task tracker system specifically tailored to the needs of Yabatech. This includes the creation
of a user-friendly interface and backend infrastructure to support task assignment, tracking, and
management.
2. Feature Implementation: The task tracker system will include essential features such as task
assignment, progress tracking, deadline reminders, reporting, and analytics.

4
3. User Training: To ensure the successful adoption and utilization of the task tracker system, the
study will include comprehensive training sessions for faculty and staff members. Training
materials and workshops will be developed to educate users on system functionalities, best
practices, and troubleshooting procedures.
4. Pilot Phase: Before full implementation, the task tracker system will undergo a pilot phase
involving a select group of departments or users. During this phase, feedback will be collected to
identify any issues or areas for improvement before rolling out the system college-wide.
5. Full Rollout: Upon successful testing and refinement in the pilot phase, the task tracker system
will be fully rolled out across Yabatech. The implementation process will involve deploying the
system to all relevant departments and users, ensuring seamless integration into existing
workflow processes.
6. Monitoring and Evaluation: Following the full rollout, the study will include mechanisms for
monitoring and evaluating the effectiveness of the task tracker system. This may involve
collecting user feedback, analyzing system usage metrics, and assessing the impact of the system
on productivity, communication, and accountability within the institution.
In summary, the scope of the study covers the development, implementation, training, pilot
testing, full rollout, monitoring, and evaluation of a task tracker system at Yabatech, with a focus
on addressing the specific needs and challenges of the institution's academic and administrative
tasks.

1.7 Limitations of Project


The limitations of the proposed task tracker system at Yaba College of Technology (Yabatech)
can include:
1. Technical Constraints: The system may face limitations in terms of technical infrastructure,
such as hardware capabilities, network bandwidth, and server capacity. These constraints could
impact system performance, scalability, and reliability, particularly during peak usage periods or
when handling large volumes of data.

2. User Adoption and Training: Ensuring widespread adoption and effective utilization of the
task tracker system among faculty, staff, and administrators may be a challenge. Resistance to

5
change, lack of familiarity with the new technology, and insufficient training and support
resources could hinder user acceptance and engagement.
3. Customization and Flexibility: While the system aims to meet the specific requirements of
Yabatech, it may lack certain customization options or flexibility to accommodate unique
workflow processes or user preferences.
4. Maintenance and Support: Sustaining the functionality, performance, and security of the task
tracker system over time requires regular maintenance, updates, and technical support. Adequate
resources, expertise, and processes must be in place to address software bugs, system errors, and
user inquiries in a timely manner.
Addressing these limitations requires careful planning, staff engagement, and ongoing
monitoring and evaluation to ensure that the task tracker system effectively meets the needs of
Yabatech and delivers tangible benefits to its users.

1.8 Definition of Terms


To ensure clarity and consistency, key terms relevant to the study are defined as follows:
- Task Tracker System: A web based software application designed to streamline task
management, enhance communication, and promote accountability within an institution or
organization.
- Yaba College of Technology (Yabatech): A renowned educational institution known for
its diverse academic and administrative activities.
- Workflow Processes: The sequence of tasks and activities required to complete an
organization's specific project or objective.
- Task: A specific activity or assignments that need to be completed within a defined
timeframe. Tasks can include projects, or administrative tasks.
- Data-driven Decision Making: The process of making informed decisions based on
analysis of real-time data and performance metrics, enabling organizations to achieve their
strategic objectives effectively.
- Dashboard: A graphical user interface that displays metrics, information about tasks,
assignments, and progress. The Task Tracker Web App includes a dashboard features to provide
users a quick overview of their tasks and priorities
6
- Task Assignment: This involves the process of allocating specific tasks or assignments
to individuals or team within an organization.
- Progress Tracking: This involves the assessment and monitoring of Task status and
completion progress.
- Deadline Reminders: These are automated notifications that will be sent to user to
remind them of the approaching tasks deadline.
- Task Tracker Web App: This is a web-based application designed to help staffs for tasks
tracking and assigning

7
CHAPTER TWO
LITERATURE REVIEW

2.0 Introduction
Task tracking system is a web based application system that plays a pivotal role in modern
organizations, facilitating efficient allocation of resources, clear communication, and streamlined
workflow processes. It’s is designed to simplify and enhance management and tracking of tasks
assigned to individuals within an organization. In today's fast-paced world, staying organized and
managing time effectively is crucial for both individuals and organizations. A task tracker system
is a powerful tool designed to streamline the process of task management, enhancing
productivity and ensuring that nothing falls through the cracks. This write-up delves into the
fundamentals of a task tracker system, its benefits, key features, and the impact it can have on
various aspects of personal and professional life.

Understanding Task Tracker Systems


A task tracker system, also known as a task management tool or project management software, is
an application designed to help staff users keep track of their tasks, projects, and deadlines. It
provides a centralized platform where tasks can be created, assigned, prioritized, and monitored
until completion. These systems are utilized by staffs, and organizations to improve efficiency,
collaboration, and accountability.

2.1 General Overview of a Task Tracking System


A task tracking system is a specialized software designed to help individuals and teams manage
tasks, projects, and deadlines efficiently. It provides a centralized platform to create, assign,
prioritize, and monitor tasks from inception to completion. Here’s a detailed overview of what a
task tracking system entails:
Definition and Purpose

8
A task tracking system, also known as task management software or project management tool, is
an application used to keep track of tasks, manage workflow, and facilitate collaboration among
staffs. Its primary purpose is to streamline task management processes, ensuring that tasks are
completed on time and within scope.
Key Components

1. Task Creation: Users can create tasks with detailed descriptions, ensuring clarity and
understanding of the task requirements.
2. Task Assignment: Tasks can be assigned to specific individuals or teams, defining
roles and responsibilities clearly.
3. Prioritization: Tasks can be prioritized based on urgency and importance, helping
users focus on critical activities first.
4. Deadlines and Reminders: Users can set deadlines for tasks and receive automated
reminders, ensuring timely completion.
5. Progress Tracking: The system provides tools to monitor the progress of each task,
offering visual representations such as progress bars or kanban boards.
6. Collaboration Tools: Built-in communication features like comments, file sharing,
and notifications facilitate seamless collaboration among team members.
7. Reporting and Analytics: Advanced reporting features provide insights into task
completion rates, project timelines, and team performance.
8. Integration: Many task tracking systems integrate with other software applications
(e.g., email, calendars, and project management tools) to create a cohesive workflow.

2.2 Importance of a Task Tracking Web Application System


In the digital age, the complexity and volume of tasks have increased significantly. To navigate
this, individuals and organizations require tools that can streamline task management, enhance
productivity, and foster better collaboration. A task tracking web application system is an
essential tool that addresses these needs. This write-up explores the importance of such systems,
focusing on their key benefits and the impact they have on personal and professional efficiency.

1. Centralized Task Management: A task tracking web application provides a single


platform where all tasks can be managed. This centralization simplifies task creation,
9
assignment, and monitoring, ensuring that all team members have access to the same
information. This leads to a more organized and efficient workflow.
2. Enhanced Accessibility: Being web-based, task tracking applications can be
accessed from any device with an internet connection. This accessibility ensures that
users can manage their tasks anytime and anywhere, providing flexibility and
convenience, especially for remote teams or individuals who travel frequently.
3. Real-Time Collaboration: Task-tracking web applications facilitate real-time
collaboration among team members. Features such as shared task lists, comment
sections, and real-time updates ensure that all team members are on the same page.
This reduces miscommunications and enhances team synergy.
4. Improved Accountability and Transparency: These systems enhance accountability
by clearly defining task responsibilities and tracking progress. Every task has a
designated owner, and progress can be monitored by all team members. This
transparency ensures that everyone is aware of their responsibilities and deadlines,
promoting a sense of accountability.
5. Effective Prioritization and Time Management: Task tracking systems allow users
to prioritize tasks based on urgency and importance. By setting deadlines and
reminders, these systems help users manage their time more effectively. This
prioritization ensures that critical tasks are completed on time, reducing the risk of
missed deadlines.

6. Comprehensive Reporting and Analytics: Advanced task tracking applications


offer robust reporting and analytics features. These tools provide insights into task
completion rates, project timelines, and individual performance. Such data-driven
insights help managers make informed decisions and identify areas for improvement.
7. Integration with Other Tools: Many task tracking web applications integrate
seamlessly with other software tools such as email, calendars, and project
management systems. This integration creates a cohesive workflow, reducing the
need to switch between different applications and improving overall productivity.

10
2.3 The History of Task Tracking
The evolution of task tracking is a fascinating journey that mirrors the advancements in
technology and changes in work culture over the centuries. From simple paper-based methods to
sophisticated digital applications, task tracking has continuously evolved to meet the growing
complexity and demands of personal and professional life. This write-up provides an overview of
the history of task tracking, highlighting key developments and milestones.

Early Methods of Task Tracking

Ancient Civilizations: Task tracking can trace its roots back to ancient civilizations. The
Sumerians, for instance, used clay tablets to record and manage agricultural activities and trade.
Similarly, the Egyptians employed hieroglyphics on papyrus to document tasks related to
construction, trade, and governance. The Middle Ages: During the Middle Ages, task tracking
was primarily managed through written records maintained by scribes. Monasteries, for example,
used meticulous record-keeping to track tasks related to agricultural production, construction,
and daily routines.

The Emergence of Modern Task Tracking

1. The Industrial Revolution: The Industrial Revolution in the 18th and 19th centuries
marked a significant shift in task management. As factories and large-scale enterprises
emerged, there was a growing need for more organized and efficient task tracking
systems. The introduction of timekeeping and shift management systems helped track
labor and productivity.
2. The Birth of Management Theories: In the late 19th and early 20th centuries, pioneers
like Frederick Winslow Taylor and Henry Gantt introduced scientific management
theories that emphasized efficiency and productivity. Taylor’s time and motion studies
aimed to optimize task performance, while Gantt’s eponymous Gantt Chart provided a
visual representation of project schedules and task dependencies.
The Digital Revolution
The Advent of Computers: The introduction of computers in the mid-20th century revolutionized
task tracking. Early computer systems, such as IBM's mainframes, were used to manage complex

11
tasks and projects in industries like aerospace and manufacturing. These systems provided
unprecedented computational power and data storage capabilities.
The Rise of Personal Computers: The 1980s saw the advent of personal computers, making task
tracking more accessible to individuals and small businesses. Software applications like Lotus 1-
2-3 and Microsoft Excel became popular tools for managing tasks, creating schedules, and
tracking progress.
The Internet Era
Web-Based Applications: The rise of the internet in the 1990s and early 2000s brought about
web-based task tracking applications. These tools allowed users to manage tasks online, enabling
real-time collaboration and remote access. Pioneering applications like Basecamp and Trello
introduced features such as task lists, project boards, and collaborative tools.
Integration and Automation: The 2010s saw the integration of task tracking systems with other
productivity tools. Applications like Asana, Jira, and Monday.com offered seamless integration
with email, calendars, and project management software. Automation features, such as
automated reminders and recurring tasks, further enhanced efficiency.

2.4 Problems of a Web based Task Tracking System


Task tracking web applications can encounter several problems, including:
Complexity of Use: Some systems can be overly complex, making it difficult for users to
navigate and utilize effectively.

1. Integration Issues: Difficulty integrating with existing systems or other software tools
used by the organization can hinder adoption and efficiency.
2. Customization Limitations: Lack of flexibility in customization options may not meet
the specific needs or workflows of different teams or organizations.
3. Scalability Concerns: As the number of users and tasks increases, performance issues
can arise, affecting speed and responsiveness.
4. Data Security: Concerns about data privacy and security breaches, especially when
dealing with sensitive task information or user data.
5. Cost: High initial setup costs or ongoing subscription fees may be prohibitive for smaller
teams or organizations with limited budgets.

12
6. User Adoption: Resistance from team members to adopt new tools or processes,
especially if they perceive the system as cumbersome or redundant.
7. Training Needs: Significant training may be required to educate users on how to
effectively use the task tracking system, adding to the overall implementation cost and
time.
8. Maintenance and Support: Dependence on timely updates, patches, and responsive
customer support to address issues or bugs that may arise.
9. Performance Monitoring: Difficulty in tracking and monitoring the performance and
effectiveness of tasks and workflows within the system itself.

2.5 Key Features of a Task Tracker System


A robust task tracker system typically includes the following features:
1. Task Creation and Assignment: Users can create tasks, set priorities, and assign them to
specific team members. This ensures clarity in roles and responsibilities.
2. Deadlines and Reminders: The system allows users to set deadlines and receive
reminders, ensuring that tasks are completed on time.
3. Progress Tracking: Progress tracking features provide a visual representation of task
completion, helping users stay on top of their work and make necessary adjustments.
4. Collaboration Tools: Built-in communication tools, such as comments, file sharing, and
notifications, enable seamless collaboration among team members.
5. Reporting and Analytics: Advanced task tracker systems offer reporting and analytics
features that provide insights into team performance, task completion rates, and project
timelines.
6. Integration with Other Tools: Many task tracker systems integrate with other software
applications, such as calendars, email, and project management tools, creating a cohesive
workflow.

13
CHAPTER THREE
SYSTEM ANALYSIS AND DESIGN

3.1 Analysis of the Existing Method of Task tracking System


The existing system of task tracking may vary from organization to organization, but common
approaches typically include a combination of manual methods and digital tools. Some
organizations/institutions may rely solely on manual methods, while others may use project
management software or spreadsheets. Here are some common elements of the existing systems:
Manual methods, Spreadsheets, project Management tools, despite these existing systems,
organizations/institutions often face limitations such as lack of real-time visibility, difficulty in
tracking dependencies and deadlines, communication gaps, and the need for manual data entry.
Integrating different tools may also cause information fragmentation and hinder overall task
management efficiency.

Delving deep into the description and analysis of the old Systems for task tracking, we have the
manual method, the use of spreadsheets and lastly project management tools.

3.2 Description/Analysis of the New System


The new method of the tracking tasks will address the limitations of the old method of tracking
tasks and provide effective solutions for effective task management. Here are the key features
and functionalities that the new method poses: Task Creation and assignment, Real-time Task
Tracking, Allocation and Workload Balance, integration with notifications, Reporting and
Analytics. Overall, the proposed Task Tracking system aims to streamline task management,
enhance collaboration, improve efficiency, and it tends to enhance the institution’s productivity.
It should be user-friendly, customizable to meet specific organizational/educational needs, and
scalable as the institution grows.

14
3.3 Program Module Specification

The program module specification of a task tracker web application system typically includes
several key modules or components designed to manage various aspects of task tracking and
management. Here’s a general outline of what such a specification might include:

User Management Module:

 Registration and authentication of users.


 User roles and permissions management.
 User profile management (update profile, preferences, etc.).
Staff Sign In page

15
Task Management Module:

 Creation, editing, and deletion of tasks.


 Assignment of tasks to users or teams.
 Task status tracking (open, in progress, completed, etc.).

Task Deletion

16
Task Allocation

Notification and Alerts Module:


 Real-time notifications for task assignments, updates, and deadlines.
 Customizable alerts for overdue tasks or critical changes.

Task Allocation

17
Task Notification

3.4 Input/Output Specifications:

1. User Inputs:
 Registration Data: Name, email, password, etc., for creating new user accounts.
 Task Creation: Title, description, assignee, due date, priority, etc., when creating
new tasks.

18
 Project Details: Name, description, team members, deadlines, milestones, etc.,
when creating new projects.
 Updates and Edits: Changes to existing tasks, projects, user profiles, etc.

2. System Inputs:
 API Inputs: Data received from third-party integrations (e.g., calendar events,
updates from other software).
 Scheduled Tasks: Automated system tasks (e.g., backups, notifications).

3. File Uploads:
 Attachments and documents related to tasks or projects.

4. Configuration Inputs:
 Settings adjustments (e.g., user permissions, notification preferences).

Output Specifications:

1. User Outputs:
• Task Lists: Displaying tasks assigned to a user or team, filtered by status, priority,
etc.
• Project Overviews: Summaries of projects, including tasks, deadlines, and
progress.
• Reports: Generated reports on task completion rates, team productivity, etc.
• Notifications: Real-time alerts and notifications for task updates, deadlines, etc.

2. System Outputs:
• API Outputs: Responses to third-party applications (e.g., confirmation of data
sync).

3. File Downloads:
• Access to attachments and documents associated with tasks or projects.

19
4. Configuration Outputs:
• Confirmation messages for settings changes.
• System logs and audit trails for user actions.

20
3.5 System Flowchart
The flow chart diagram for the Task Tracker system provides a visual representation of the
workflow and processes within the system. It illustrates the key steps involved from user
registration to task creation, updating, deletion, and retrieval. This flow chart helps in
understanding the sequence of operations and the interaction between different components of
the task tracking web application.

Start

Input Task
Details

No
Validate the input

Yes

Create Task Generate Task ID

Assign Task To
Store Task
User

Update Task
Task Track Progress Error Handling
Status

Check Task
Completion

Notify Task
Completion

End

21
Components of the Flow Chart
1. User Registration and Authentication
- New User Registration: Users provide their details (name, email, password) to create an
account. The system generates a unique ID for each user.
- Existing User Authentication: Users log in with their email and password to access the
system.

2. Task Creation and Allocation


- Task Creation: Users create tasks by providing details such as task name, description, priority,
and deadline.
- Task Allocation: Tasks are assigned to specific users or team members.

3. Task Management
- Updating Task: Users can update task details, including status, description, and deadline.
- Task Deletion: Users can delete tasks that are no longer needed or completed.

4. Task Notification
- The system sends notifications to users about task assignments, updates, and upcoming
deadlines.

5. Reviewing and Retrieving Tasks


- Users can view a list of all tasks, filter tasks by status or priority, and retrieve detailed
information about specific tasks.

6. Database Interaction
- Task Collection: Tasks are stored in a database, with each task associated with the user who
created or is responsible for it.
- User Collection: User information, including login credentials and profile details, is stored in
a separate database collection.

22
Flow Chart Description
The flow chart diagram for the Task Tracker system provides a clear and organized visualization
of how users interact with the system and how various processes are managed. This aids in both
the development and troubleshooting of the application by providing a comprehensive overview
of the system's functionality.

The flow chart begins with user registration and authentication, ensuring that only authorized
users can access the system. It then moves on to task creation and allocation, highlighting the
importance of task details and the assignment process. The task management section shows how
tasks can be updated or deleted as needed. The inclusion of task notifications ensures that users
are kept informed about their tasks, improving overall efficiency and productivity. Finally, the
flow chart emphasizes the critical role of database interactions in maintaining and organizing
user and task data.

This structured approach ensures that the Task Tracker system is user-friendly, efficient, and
scalable, meeting the needs of individual users and teams alike.

3.6 Use Case Study for the Task Tracker Web Application System
The Task Tracker Web Application is designed to help individuals and teams manage their tasks
effectively. It provides functionalities for creating, assigning, and tracking tasks, ensuring that
users can stay organized and productive.

23
Review Task

View To Do List

Retrieve To Do List

Staff Receive Task

LOGIN

Update Task
Application

Add Task

Admin
Delete Task

Assign Task
All Task
Filter Task Complete
Task
Incomplete
Task

Stakeholders

 End Users: Staffs who will use the application to manage their tasks.
 Admin: Those who need to assign tasks and monitor the progress of other staffs.

Primary Actors

 User: A staff using the application to create and manage tasks.


 Admin: A staff with administrative privileges to manage users and oversee the system.

Use Cases

1. User Registration and Login


• Description: Staffs can register for an account and log in to access the
application.

24
• Actors: Staffs
• Preconditions: The user must have access to the registration page.
• Postconditions: The user is registered and can log in to the application.
• Steps:
1. Staff navigates to the registration page.
2. Staff fills in the registration form with required details (e.g., name, email,
password).
3. Staff submits the form.
4. System validates the details and creates a new user account.
5. Staff receives a confirmation email and logs in to the application.

2. Task Creation
• Description: Staffs can create tasks and assign them to themselves or other team
members.
• Actors: User
• Preconditions: The staff must be logged in.
• Postconditions: A new task is created and visible in the task list.
• Steps:
1. Staff navigates to the task creation page.
2. Staff enters task details (e.g., title, description, due date, assignee).
3. Staff submits the task form.
4. System saves the task and updates the task list.

3. Task Assignment and Tracking


• Description: Staff users can assign tasks to team members and track their
progress.
• Actors: User
• Preconditions: The task must be created.
• Postconditions: The task is assigned and tracked until completion.
25
• Steps:
1. User selects a task from the task list.
2. User assigns the task to a staff.
3. System notifies the assignee about the new task.
4. Assignee updates the task status (e.g., In Progress, Completed).
5. System updates the task status and progress in real-time.

4. Notification System
• Description: Users receive notifications for task assignments, updates, and
deadlines.
• Actors: User
• Preconditions: User must have tasks assigned to them.
• Postconditions: User is notified about relevant task updates.
• Steps:
1. System monitors task events (e.g., assignments, status changes).
2. System sends notifications to users (e.g., email, in-app notifications).
3. User receives and acknowledges notifications.

5. User Management (Admin)

Description: Admins can manage user accounts, including creating, updating, and
deleting accounts.

• Actors: Admin
• Preconditions: Admin must be logged in with appropriate privileges.
• Postconditions: User accounts are managed as required.
• Steps:
1. Admin navigates to the user management page.
2. Admin views the list of users.

26
3. Admin performs actions such as adding, updating, or deleting user
accounts.
4. System updates the user database accordingly.

Benefits

1. Efficiency: Users can manage tasks in one centralized location.


2. Productivity: Teams can collaborate effectively by assigning and tracking tasks.
3. Accountability: Clear task assignments and progress tracking ensure accountability.
4. Organization: Users can prioritize and organize their tasks with due dates and statuses

27
CHAPTER FOUR
SYSTEM IMPLEMENTATION

4.1 System Implementation


The system implementation of a Task Tracker System involves the process of bringing the
system from concept to reality, ensuring that it meets the Institution's needs and objectives. It
encompasses various stages, including planning, development, testing, deployment, and
maintenance. As a project work, we ensured that the implementation of the system solves the
solution to task management needs specifically to Yabatech’s task management needs. It covers a
structured approach, including detailed planning, development, testing, deployment, and ongoing
maintenance. Throughout this journey, we made proper research on how task management was
handled, worked with some end-users to ensure alignment with project goals and requirements.
We prioritize user experience, usability, and scalability, aiming to deliver a solution that not only
meets but exceeds expectations.

During the implementation phase, key tasks include defining project scope, gathering
requirements, designing the system architecture, developing the software, testing for quality
assurance, deploying the system into production, and providing ongoing support and
maintenance. Effective system implementation requires collaboration between developers,
testers, and end-users to ensure that the system is delivered on time, within specific time, and
meets quality standards. Clear communication, thorough planning, and diligent execution were
essential to the success of the implementation process. Throughout the implementation phase, we
ensured that user experience was one of our top most priority, alongside usability, scalability to
ensure that the web app effectively supports task management workflows and contributes to the

28
institution efficiency and productivity. Regular feedback, monitoring, and adaptation are
necessary to address any issues, refine functionality, and optimize system performance over time.

4.2 System Design

1. Architecture Overview

The system architecture is divided into three main layers:

 Presentation Layer: User interface (UI) components that interact with end-users.
 Business Logic Layer: Core functionalities and services that handle task management.
 Data Layer: Database components for storing and retrieving data.

2. Components

1. Presentation Layer
o Frontend Framework: React.js
o Features:
 User registration and login forms
 Dashboard displaying task lists and statuses
 Task creation and update forms
 Notification system for task updates
 Filtering and sorting tasks
 User profile management

2. Business Logic Layer


o Backend Framework: Node.js with Express.js
o Features:
 User authentication and authorization (JWT-based)
29
 Task CRUD (Create, Read, Update, Delete) operations
 Notification service for task updates and deadlines
 Task assignment logic
 Role-based access control (admin, user)
o Microservices Architecture:
 User Service: Handles user registration, authentication, and profile
management.
 Task Service: Manages task creation, updates, assignment, and deletion.
 Notification Service: Sends emails and in-app notifications for task-
related events.
 Analytics Service: Generates reports on task progress, user performance,
and system usage.

1. User Registration and Authentication


o Flow:
1. User accesses the registration form on the frontend.
2. User submits the form with name, email, and password.
3. Frontend sends a POST request to the User Service API.
4. User Service validates input, hashes the password, and stores user data in
MongoDB.
5. User receives a confirmation email and can log in using the credentials.
6. During login, the User Service generates a JWT token upon successful
authentication.
2. Task Creation and Management
o Flow:
1. Authenticated user accesses the task creation form on the frontend.
2. User submits task details, including title, description, priority, and
assignee.
3. Frontend sends a POST request to the Task Service API with task data.
4. Task Service validates input and stores task details in MongoDB.

30
5. Notification Service triggers an email and in-app notification to the
assignee.
6. Task is displayed on the dashboard, and users can update or delete tasks as
needed.
3. Notification System
o Flow:
1. Task Service triggers events for task creation, updates, and deadlines.
2. Notification Service listens for these events and generates appropriate
notifications.
3. Notifications are sent via email using an email service provider (e.g.,
SendGrid).
4. In-app notifications are updated in real-time using WebSockets.
4. Analytics and Reporting
o Flow:
1. Analytics Service aggregates task data and user activity from MongoDB.
2. Generates reports on task completion rates, user performance, and system
usage statistics.
3. Reports are accessible to admins via the admin dashboard.
4. Data visualizations are created using a library such as D3.js or Chart.js.

4.2.1 Input Design


User Registration and Login

User Registration Form

 Fields:
o Name: Text input for the user’s full name.
o Email: Email input to ensure a valid email format.
o Password: Password input with visibility toggle and strength indicator.
o Confirm Password: Password input to confirm the user's password.
 Validations:
o Name: Required, alphabetic characters only.

31
o Email: Required, valid email format.
o Password: Required, minimum 8 characters, including uppercase, lowercase,
numeric, and special characters.
o Confirm Password: Must match the password field.

Login Form

Fields:

o Email: Email input.


o Password: Password input.
 Validations:
o Email: Required, valid email format.
o Password: Required.

2. Task Creation and Management

Task Creation Form

 Fields:
o Task Title: Text input for the task title.
o Description: Text area for a detailed description of the task.
o Priority: Dropdown menu with options (Low, Medium, High).
o Due Date: Date picker to select the due date.
o Assignee: Dropdown menu to select a team member.
 Validations:
o Task Title: Required, alphanumeric characters only.
o Description: Optional, but if provided, it should not exceed 500 characters.
o Priority: Required, must select one from the dropdown.

32
o Due Date: Required, must be a future date.
o Assignee: Required, must select a user from the list.

Task Update Form

 Fields:
o Task Title: Text input (pre-filled with existing title).
o Description: Text area (pre-filled with existing description).
o Priority: Dropdown menu (pre-selected with current priority).
o Due Date: Date picker (pre-filled with current due date).
o Assignee: Dropdown menu (pre-selected with current assignee).
o Status: Dropdown menu with options (Not Started, In Progress, Completed).
o Loading indicator while processing the task update.

4.2.2 Output Design

Users Sign in Page

33
Output interface for the Performance Metrics for Staffs

34
The Output Interface for Task Assigning and List of Staffs

35
The Output Interface for the Profile Information

4.3 Software Requirement


The software requirement for the Task Tracker System outlines the necessary components and
configurations required to support its functionality and performance. Here's a concise overview:

1. Operating System (OS):


The Task Tracker System is compatible with modern operating systems, such as Windows,
MacOS, or Linux distributions, ensuring broad accessibility for users across different platforms.

2. Database Management System (DBMS):


We utilized a robust database management system such as MongoDB, to store and manage task
data efficiently.
The chosen DBMS supports essential features like data integrity, concurrency control, and
backup and recovery mechanisms to ensure data reliability and availability.

3.Web Server:

36
The Task Tracker System is hosted on a web server software, such as Apache HTTP Server,
Nginx, or Microsoft Internet Information Services (IIS), to serve web pages and handle HTTP
requests from users' web browsers.
The web server is configured to support secure communication protocols (e.g., HTTPS) and
optimize performance through caching and compression techniques.

4. Programming Languages and Frameworks:


We employ programming languages and frameworks suitable for web application development,
such as JavaScript, React.JS, Node.JS and Typescript.
These languages and frameworks was used to provide the necessary tools and libraries to build
robust, scalable, and maintainable web applications with features like user authentication, data
validation, and RESTful APIs.

5. User Interface (UI) Components:


The Task Tracker System utilizes front-end technologies like HTML, CSS, and JavaScript
frameworks (e.g., React.js, Angular, Vue.js) to create intuitive and responsive user interfaces.
UI components are designed to provide users with a seamless and engaging experience for
managing tasks, viewing dashboards, and interacting with the system's features.

6. Integration and APIs:


The Task Tracker System integrates with third-party tools and services through APIs
(Application Programming Interfaces) to extend its functionality and exchange data with other
systems.
APIs are documented and standardized to facilitate seamless integration with popular tools and
platforms used by our Institution.

4.4 Choice of Programming Language


The Task Tracker Web application was developed using a combination of HTML, CSS,
JavaScript, Node.JS for the backend and Typescript. Each of these technologies were chosen for
specific reasons that aligns with the project’s requirement for functionality, efficiency, and
scalability

37
HTML (Hypertext Markup Language)
HTML forms the web application's backbone, providing the web pages' structure and layout. It
was used to create the user interface ensuring that the content was organized and accessible.
CSS (Cascading Style Sheets)
CSS was used for styling the HTML elements, ensuring that the application has an appealing and
consistent look and feel.

JavaScript
JavaScript is crucial for adding interactivity and dynamic functionalities to the web application.
It enables features such as form validation, dynamic content updates, and interactive user
interfaces.

Node.JS
Node.js is utilized for the backend development of the application. It is a powerful, event-driven
JavaScript runtime that allows for the creation of scalable and high-performance server-side
applications.

TypeScript
TypeScript is a superset of JavaScript that adds static typing to the language. It was used in
catching errors during development, improving code quality, and making the codebase more
maintainable.

4.5 Changeover Method


The changeover method for transitioning users to access the web app through a link involves a
seamless and user-friendly approach that minimizes disruption and maximizes adoption. By
providing users with a direct link to the web app, we eliminate the need for complex installation
processes or significant changes to existing workflows. Through effective communication and
training, we ensure that users are informed about the transition and equipped with the necessary
knowledge to access the web app effortlessly. We emphasize the simplicity and convenience of
using the link, highlighting its accessibility from any device with an internet connection. For
easy access to the web app, here is the link to the web app https://dazzling-praline-

38
5c3ff0.netlify.app, you can either click on the link or copy it and then paste it to any browser
either from your phone or a laptop.

4.6 User’s Guide


The User's Guide for the Task Tracker Web App! Is designed to provide you with comprehensive
instructions and resources to help users make the most out of our task tracking system. Whether
they are new user or an experienced one, this guide will serve as User go-to resource for
navigating the app and utilizing its features effectively.

Here's what users should expect:


1. Getting Started: Learn how to access the Task Tracker Web App and create your account.
Follow step-by-step instructions to set up your profile and get started with managing your tasks.
You either get to register as a Staff or an Admin.

2. Navigating the App: Familiarize yourself with the app's interface and navigation. Discover
how to move between different sections, access menus, and use shortcuts to streamline your
workflow.

3. Managing Tasks: Explore the various features for creating, assigning, prioritizing, and tracking
tasks. Learn how to add due dates, set reminders, attach files, and collaborate with other Staffs
on tasks.

CHAPTER FIVE

39
SUMMARY, CONCLUSION, AND RECOMMENDATION

5.1 Summary
This is our project “Task Tracker Web Application System ” which will allow staffs to assign,
retrieve, manage and track tasks on the web seamlessly from the comfort of their office without
the need for physical meetings. The is a web based application that was developed with HTML,
CSS, JavaScript, Node.JS, and lastly TypeScript. The main objective of this project was that,
staffs can be able to assign task seamlessly and conveniently.

Many efforts were required in developing this project, Development of this website gave us a lot
of satisfaction.

5.2 Conclusion
The Task Tracker project is a comprehensive web-based application designed to streamline task
management and enhance productivity for staff and users. Developed by a team of skilled
professionals with extensive experience in software development and project management, this
project aims to address the challenges associated with task organization, assignment tracking,
and collaboration. The Task Tracker project offers a user-friendly interface, robust features, and
advanced functionalities to empower users to efficiently manage their tasks, meet deadlines, and
achieve their goals. By leveraging a robust technological stack including JavaScript, React.js,
Node.js, and MongoDB, the application integrates seamlessly with third-party tools and services
to extend its functionality and provides a seamless user experience through intuitive UI
components.

5.3 Future Research


This project can be improved by the addition of other features and updates such as integration of
the mobile app version which involves developing a mobile-friendly version to enhance
accessibility and convenience for staff on the go. Another improvement that can be added will be
the third-party integration which involves expanding compatibility with additional third-party
tools like calendar apps and project management software. Lastly, another feature that can be

40
added would be AI-powered Task which will enable AI to generate task priorities and deadlines
based on workload and past performance.

5.4 Recommendation
The Task Tracker Web Application stands out as an exceptional tool for staff, significantly
enhancing task management and boosting productivity. Its intuitive interface and comprehensive
features foster seamless communication and collaboration among team members. Real-time
tracking capabilities and data-driven insights provided by the application enhance accountability
and support informed decision-making processes. Seamless integration with existing systems
ensures a smooth workflow, making it an invaluable resource for organizational efficiency.
Overall, this application serves as a highly efficient and effective solution for managing tasks
within the institution, empowering staff to accomplish goals more effectively.

41
References
1. Atkinson, R. (1999). Project Management: Cost, Time and Quality, Two Best Guesses and a
Phenomenon, Its Time to Accept Other Success Criteria. International Journal of Project
Management, 17(6), 337-342.

2. Black, P. E., & Sloan, T. (2020). Managing and Developing Open Source Projects. The Journal
of Open Source Software, 5(45), 1-5.

3. Boehm, B. W. (1988). A Spiral Model of Software Development and Enhancement. ACM


SIGSOFT Software Engineering Notes, 11(4), 14-24.

4. Cockburn, A. (2002). Agile Software Development. Addison-Wesley.

5. Collins, J. C., & Porras, J. I. (1996). Building Your Company's Vision. Harvard Business
Review, 74(5), 65-77.

6. Dingsøyr, T., Nerur, S., Balijepally, V., & Moe, N. B. (2012). A Decade of Agile
Methodologies: Towards Explaining Agile Software Development. Journal of Systems and
Software, 85(6), 1213-1221.

7. Drury, M., Conboy, K., & Power, K. (2012). Obstacles to Decision Making in Agile Software
Development Teams. Journal of Systems and Software, 85(6), 1239-1254.

8. Fitzgerald, B., & Stol, K. J. (2014). Continuous Software Engineering: A Roadmap and
Agenda. Journal of Systems and Software, 123, 176-189.

9. Highsmith, J. (2009). Agile Project Management: Creating Innovative Products. Addison-


Wesley Professional.

10. Larman, C., & Basili, V. R. (2003). Iterative and Incremental Development: A Brief History.
Computer, 36(6), 47-56.

42
Appendix A (Front-End Design)

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Task Tracker System </title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

/** @type {import('tailwindcss').Config} */


export default {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [

43
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}

(Users Authentication)

import User from "../models/User.js";


import CryptoJS from "crypto-js";
import dotenv from "dotenv";
import jwt from "jsonwebtoken";

dotenv.config();

export const register = async (req, res) => {


try {
const existingUser = await User.findOne({ email: req.body.email });
if (existingUser) {
return res.status(403).json("User already exists");
}
const encryptedPassword = CryptoJS.AES.encrypt(

44
req.body.password,
process.env.PassKey
).toString();

const newUser = new User({ ...req.body, password: encryptedPassword });


const savedUser = await newUser.save();
res.status(200).json(savedUser);
} catch (err) {
res.status(500).json(err);
}
};

export const login = async (req, res) => {


try {
const user = await User.findOne({ email: req.body.email });
if (!user) {
return res.status(404).json("User not found");
}

const bytes = CryptoJS.AES.decrypt(user.password, process.env.PassKey);


const unhashedPassword = bytes.toString(CryptoJS.enc.Utf8);
if (unhashedPassword !== req.body.password) {
return res.status(401).json("Wrong Password");
}

const token = jwt.sign(


{ id: user._id, isAdmin: user.isAdmin, username: user.username },
process.env.jwtKey,
{ expiresIn: "1d" }
);

45
const { password, ...others } = user._doc;

// Set the cookie


res.cookie("access_token", token, {
httpOnly: true,
maxAge: 24 * 60 * 60 * 3000,
sameSite: "None",
secure: true,
});
return res.status(200).json(others);
} catch (err) {
return res.status(500).json(err);
}
};

export const logout = async (req, res) => {


try {
res
.clearCookie("access_token", {
httpOnly: false,
path: "/",
secure: true,
sameSite: "None",
})
.status(200)
.json("You've logged out successfully");
} catch (err) {
res.status(500).json(err);
}
};

46
Appendix (Task Allocation)
import Task from "../models/Task.js";
import User from "../models/User.js";
import nodecron from "node-cron";
import { sendTaskNotification } from "../notification.js";

export const createTask = async (req, res) => {


try {
const newTask = new Task({
taskName: req.body.taskName,
description: req.body.description,
assignedUser: req.body.assignedUser,
deadLine: req.body.deadLine,
taskStatus: req.body.taskStatus,
assignedBy: req.body.assignedBy,
priority: req.body.priority,
});

const theAssignedUser = await User.findOne({


email: newTask.assignedUser,
});

!theAssignedUser && res.status(404).json("This user does not exist");


const savedTask = await newTask.save();
theAssignedUser.tasks.push(savedTask);
theAssignedUser.save();

sendTaskNotification(savedTask.assignedBy, savedTask.assignedUser);
//since it is automated, we will now use crom
// Schedule a cron job to run every day
nodecron.schedule("0 0 * * *", async () => {

47
// Get all tasks from the database
const tasks = await Task.find();

// Calculate the reminder date (one day before the deadline) for each task
tasks.forEach((task) => {
const deadline = new Date(task.deadLine);
const reminderDate = new Date(deadline);
reminderDate.setDate(reminderDate.getDate() - 1);

// Check if the current date matches the reminder date


const currentDate = new Date();
if (
currentDate.getFullYear() === reminderDate.getFullYear() &&
currentDate.getMonth() === reminderDate.getMonth() &&
currentDate.getDate() === reminderDate.getDate()
){
// Send the reminder notification to the assigned user
sendReminderNotification(
task.assignedUser,
task.taskName,
reminderDate
);
}
});
});
console.log(theAssignedUser);

res.status(200).json(savedTask);
} catch (err) {
res.status(500).json(err);
}

48
};

export const updateTask = async (req, res) => {


try {
const task = await Task.findById(req.params.id);
const theAssignedUser = await User.findOne({ email: task.assignedUser });
theAssignedUser.tasks.pull(task);

const updatedTask = await Task.findByIdAndUpdate(


req.params.id,
{ $set: req.body },
{ new: true }
);

theAssignedUser.tasks.push(updatedTask);

theAssignedUser.save();

res.status(200).json(updatedTask);
} catch (err) {
console.log(err);
res.status(500).send(err);
}
};

export const deleteTask = async (req, res) => {


try {
const task = await Task.findById(req.params.id);
const taskAssignedUser = await User.findOne({
email: task.assignedUser,
});

49
taskAssignedUser.tasks.pull(task);
taskAssignedUser.save();
await Task.findByIdAndDelete(req.params.id);

res.status(200).json("Successfully deleted task");


} catch (err) {
res.status(500).json(err);
}
};

export const getTask = async (req, res) => {


try {
const task = await Task.findById(req.params.id);
res.status(200).json(task);
} catch (err) {
res.status(500).json(err);
}
};

export const getTasks = async (req, res) => {


try {
const completed = req.query.completed;
const notStarted = req.query.notStarted;
const inProgress = req.query.inProgress;
let tasks;
if (completed) {
tasks = await Task.find({ taskStatus: "completed" }).sort({
createdAt: "desc",
});
} else if (notStarted) {
tasks = await Task.find({ taskStatus: "not started" }).sort({

50
createdAt: "desc",
});
} else if (inProgress) {
tasks = await Task.find({ taskStatus: "in progress" }).sort({
createdAt: "desc",
});
} else {
tasks = await Task.find().sort({ createdAt: "desc" });
}
res.status(200).json(tasks);
} catch (err) {
res.status(500).json(err);
}
};

export const getStaffToNotify = () => {};


import express from "express";
import mongoose from "mongoose";
import dotenv from "dotenv";
import cookieParser from "cookie-parser";
import AuthRoute from "./routes/Auth.js";
import UserRoute from "./routes/User.js";
import TaskRoute from "./routes/Task.js";
import cors from "cors";

dotenv.config();

const app = express();

app.use(express.urlencoded({ extended: false }));

51
app.use(express.json());

app.use(cookieParser());

app.use(
cors({
origin: "https://dazzling-praline-5c3ff0.netlify.app",
methods: ["GET", "POST", "PUT", "DELETE"],
credentials: true,
exposedHeaders: ["*"],
preflightContinue: false,
optionsSuccessStatus: 204,
})
);

app.options(
"*",
cors({
credentials: true,
origin: "https://dazzling-praline-5c3ff0.netlify.app",
methods: ["GET", "POST", "PUT", "DELETE"],
exposedHeaders: ["*"],
preflightContinue: false,
optionsSuccessStatus: 204,
})
);

mongoose
.connect(process.env.mongoUrL)
.then(() => console.log("db connected"))
.catch((err) => console.log("db is not connected. This is the" + err));

52
app.get("/health", (req, res) => {
res.status(200).json({ status: "UP" });
});

app.use("/api/auth", AuthRoute);
app.use("/api/user", UserRoute);
app.use("/api/task", TaskRoute);

app.listen(8000 || process.env.PORT, () => {


console.log("app is connected and listening on port 8000");
});

Notification.JS
// notificationService.js

import nodemailer from "nodemailer";

// Create a transporter using your email service provider's configuration


const transporter = nodemailer.createTransport({
service: "Gmail",
auth: {
user: "[email protected]",
pass: "kqbn wksr kdtz tgdr",
},
});

export const sendTaskNotification = async (


assignerEmail,
assignedUserEmail
) => {

53
try {
// Compose the email message
const mailOptions = {
from: assignerEmail,
to: assignedUserEmail,
subject: "Task Notification",
text: `Dear ${assignedUserEmail}, you have a new task, kindly log in to your app to view.
Best regards, ${assignerEmail}`,
};

// Send the email


await transporter.sendMail(mailOptions);
console.log("Task notification sent successfully");
} catch (error) {
console.error("Error sending task notification:", error);
}
};

export const sendReminderTaskNotification = async (


assignerEmail,
assignedUserEmail
) => {
try {
// Compose the email message
const mailOptions = {
from: assignerEmail,
to: assignedUserEmail,
subject: "Task Status Reminder",
text: `Dear ${assignedUserEmail} , Kindly Complete your unfinished task.
Best regards,
${assignerEmail}`,

54
};

// Send the email


await transporter.sendMail(mailOptions);
console.log("Task notification sent successfully");
} catch (error) {
console.error("Error sending task notification:", error);
}
};

Token Verification
import jwt from "jsonwebtoken";
import dotenv from "dotenv";

dotenv.config();

export const verifyToken = async (req, res, next) => {


try {
const token = req.cookies.access_token;
!token && res.status(401).json("You're not authenticated");

jwt.verify(token, process.env.jwtKey, (err, userInfo) => {


err && res.status(401).json("invalid token");
req.user = userInfo;
next();
});
} catch (err) {
res.status(500).json(err);
}
};

55
export const verifyTokenAndAuthorization = (req, res, next) => {
try {
verifyToken(req, res, () => {
if (req.user.id === req.params.id || req.user.isAdmin) {
next();
} else {
return res.status(403).json("You're not allowed to do that");
}
});
} catch (err) {
res.status(500).json(err);
}
};

export const verifyTokenAndAdmin = (req, res, next) => {


try {
verifyToken(req, res, () => {
if (req.user.isAdmin) {
next();
} else {
return res.status(403).json("You're not allowed to do that");
}
});
} catch (err) {
res.status(500).json(err);
}
};

Users Model
import mongoose from "mongoose";

56
const UserSchema = new mongoose.Schema(
{
fullName: { type: String, required: true },
username: { type: String, required: true, unique: true },
email: { type: String, required: true, unique: true },
password: { type: String, required: true },
uniqueId: { type: String, required: true },
isAdmin: { type: Boolean, required: true },
tasks: [
{
taskName: { type: String, default: null },
description: { type: String },
assignedBy: { type: String },
assignedUser: { type: String },
deadLine: { type: String },
priority: { type: String },
taskStatus: { type: String, default: "not started" },
createdAt: { type: String },
updatedAt: { type: String },
},
],
},
{ timestamps: true }
);

export default mongoose.model("User", UserSchema);

Authentication Model
import mongoose from "mongoose";

57
const TaskSchema = new mongoose.Schema(
{
taskName: { type: String, required: true, unique: true, default: null },
description: { type: String },
assignedUser: { type: String, required: true },
assignedBy: { type: String, required: true },
deadLine: { type: String, required: true },
priority: { type: String, required: true },
taskStatus: { type: String, default: "not started" },
},
{ timestamps: true }
);

export default mongoose.model("Task", TaskSchema);

Routes for Authentication


import express from "express";
import { login, logout, register } from "../collections/Auth.js";

const router = express.Router();

router.post("/register", register);
router.post("/login", login);
router.post("/logout", logout);

export default router;

Routes for Tasks


import express from "express";

58
import {
createTask,
deleteTask,
getTask,
getTasks,
updateTask,
} from "../collections/Task.js";

const router = express.Router();

router.post("/createTask", createTask);
router.put("/updateTask/:id", updateTask);
router.delete("/deleteTask/:id", deleteTask);
router.get("/getTask/:id", getTask);
router.get("/getTasks", getTasks);

export default router;

Routes for Users


import express from "express";
import {
deleteUser,
getLoggedInUser,
getUser,
getUsers,
updateUser,
} from "../collections/User.js";
import {
verifyToken,
verifyTokenAndAdmin,
verifyTokenAndAuthorization,

59
} from "../TokenVerification.js";

const router = express.Router();

router.put("/update/:id", verifyTokenAndAuthorization, updateUser);


router.delete("/delete/:id", verifyTokenAndAuthorization, deleteUser);
router.get("/getUser/:id", verifyTokenAndAuthorization, getUser);
router.get("/getUsers", verifyTokenAndAdmin, getUsers);
router.get("/getLoggedInUser", getLoggedInUser);

export default router;

60

You might also like