Task Manager 2.0 📝📤📆 - A feature-rich Task Management app built with Python & customTkinter
Tags: python, mongodb, productivity, programming
Published: 2023-01-22 21:01:40

Introducing Task Manager: A Fun and User-Friendly Way to Organize Your Tasks! 📝📤📆

An update to my previous [article](https://dev.to/siwhelan/task-manager-47jh) on a Task Management app being built with Python and customTkinter, with several new features implemented and code refactored to improve efficiency. This is a personal project that I took on as a learning and portfolio exercise after completing a Software Engineering Bootcamp with [HyperionDev](https://www.hyperiondev.com/).

The program is based on a task manager that I created as a capstone project during the bootcamp, but I wanted to take it to the next level by adding a GUI to make the backend more user-friendly. The original program can be found [here](https://github.com/siwhelan/taskManager).

#### Changelog - 

- Implemented Add/View Tasks
- Implemented a search feature to search tasks assigned to a particular person or task ID
- Created 'Edit Tasks' to change task details, such as the user assigned, due dates, and mark tasks as completed
- Addition of default admin account added upon first installation
- Addition of error handling and success frames for displaying relevant messages to the user
- Several bug fixes

#### Enough intro - let's get to the app! 🚀

As developers, we all know the importance of keeping our tasks organized and on track. But, let's be real - sometimes the task of managing our tasks can feel like a tedious task in itself. That's why I'm excited to introduce Task Manager 2.0 - an updated task management program that makes organization simple and user-friendly.


![main window of task manager app](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ycz16hqjvhakem9l25xg.JPG)

Built with the [customtkinter](https://github.com/TomSchimansky/CustomTkinter) library, Task Manager features a sleek and modern graphical user interface. But, it's not just about looks - the program also includes practical features such as a dark mode, UI scaling, and the ability to view, add, edit, and delete tasks with ease. Plus, the program includes a login system that utilizes a MongoDB database to store and verify user credentials, ensuring the security of your task and user information.

The program employs `pymongo` to connect to the MongoDB database storing information on tasks and user login information, and passwords are hashed using [SHA-256](https://www.n-able.com/blog/sha-256-encryption) for added security 🔑. This makes Task Manager a great example of a complete software project that includes a GUI, database, and security features, all wrapped up in a user-friendly package.

When a user logs in, their inputted password is hashed and compared against the stored password in the database. When registering new users, the password is hashed before the user is added to the database, and all password input fields show '*' when typing, so there are no cleartext/visible passwords at any point.


![code to hash password](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hedn1zq60wx7f9qsjdmm.png)

#### Want to try it? Feel free!

Installation is a simple affair - install the necessary dependencies and libraries, set up a MongoDB server, and voila! You're ready to start managing your tasks like a pro. Full instructions for all of these can be found in the Github repo - [link](https://github.com/siwhelan/taskManagerGUI)

Before running the app, make sure your MongoDB server is up and running. On the first use, a default admin account with the username "admin" and password "adm1n" will be automatically created and added to the "login_info" collection within the MongoDB instance. This account can be used to log in and manage tasks.

One of the first things that you'll notice when you open the application is the ability to change the appearance mode and theme. The appearance mode can be set to "System" (standard), "Dark", or "Light" and the theme can be set to "blue" (standard), "green", or "dark-blue". This allows you to customize the look and feel of the application to suit your preferences.


![Image of task menu dropdown](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pzulpq7u96vbjgsig86m.JPG)

Since the last blog, a dropdown menu has been added to create a Task Menu. This consists of 'View All', 'Add Task', 'Edit Task' and 'Delete Task'. All self explanatory, but we'll go through them briefly anyway!

#### Add Task - 

A window with inputs for username, task title, task description and due date. These are then saved as a new entry in the MongoDB collection 'tasks' along with the default entry of 'date assigned' which is set using the `datetime` module in Python and the `datetime.now()` function as well as a 'completed' field that is defaulted to 'No'.


![add task window](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y9k4xqob0xhp02jcmoy3.JPG)

Task due dates are stored as datetime objects in the database to allow for easier reporting and usage throughout the program.

#### Edit Task - 

'Edit task' first requires a Task ID number, upon selection the `view_all()` function is called which inserts all task data into the main textbox for reference. The relevant task number must be entered into the correct field along with any info that is to be edited. Blank fields are skipped and any new info is added to the database in place of the current task info.


![edit task window](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u5epx675wrx9wd6jm7j9.JPG)

Once a task has been completed, the Edit Task window can be called and a checkmark within the window ticked, this then changes the default `completed: 'No’` to `completed: 'Yes’`. 


![completed task](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/91bvzemu1tljbtmboi2r.JPG)

This can be confirmed by calling the View All function once again, and displaying the updated tasks.

![task marked as complete](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xta3xtb183xkvuszvgx2.JPG)

#### Delete Task -

![delete task input field](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5z7bszcfakgtf27m6pcc.JPG)

A much simpler input field that asks for the relevant task number. Upon entering, the task with the inputted Task ID is removed from the database. 

A 'Task does not exist' error is shown if the Task ID is not found.

####  Search -

The task manager app has a built-in search feature that makes it quick and easy for users to find specific tasks. This feature can be accessed by typing in a search query into the search bar located at the bottom of the main window and then clicking the 'search' button. The search function is user-friendly and allows you to search for tasks based on different criteria like the user assigned to the task and the Task ID. This makes it easy to filter and locate the tasks you need, or keep track of a specific user's progress.


![search bar](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ssk9i75fi0p7v1nblx2u.JPG)


#### Reports -

One of the most exciting features of Task Manager 2.0 is the ability to generate reports on tasks 📈 and the option menu to switch between different task views and functions, this allows you to have a better understanding of your progress and to make data-driven decisions. 

![task reports](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hk87ozofqg5qsbrx0m8n.JPG)

In addition to being a great tool for individual developers, Task Manager can also be used by small businesses to manage tasks assigned to team members. The program's user-friendly interface and ability to view, add, edit, and delete tasks makes it easy for team leaders to assign and monitor tasks, while the login system and MongoDB database ensures that each team member's tasks are secure and easy to access.

The ability to generate reports on tasks and switch between different task views and functions 📊 also allows managers to have a better understanding of the team's progress and make data-driven decisions. This can be especially useful for small businesses with limited resources and a need to optimize their workflow and performance.

Overall, Task Manager is not only a great tool for individual developers but also for small businesses looking for an easy-to-use and secure way to manage tasks for their team members.

Give it a try and see for yourself! 🚀

P.S. Don't forget to check out the Github [README](https://github.com/siwhelan/taskManagerGUI/blob/master/README.md) for more details on installation and usage.

I've added several checks/if statements and error handling in places I thought it would be useful, but I'm sure there'll still be a few bugs! Let me know if you spot any and I'll get them fixed asap!

Any other feedback or questions, or if you have any feature suggestions or requests, feel free to leave a comment!

Thanks for reading 👋