# josejimenez-m/taskmanager architecture

> Architecture diagram of the GitHub repository josejimenez-m/taskmanager, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/josejimenez-m/taskmanager
- Repository: https://github.com/josejimenez-m/taskmanager

## Overview

##### Project Identification
- This is a desktop task management application built in Python, employing a graphical user interface (likely using Tkinter and related libraries such as Pillow and tkcalendar). It includes user authentication and MySQL database connectivity.
- The README and file structure reveal that its purpose is to allow users (admins and normal users) to create, update, complete, and delete tasks via a GUI, with authentication and a MySQL backend for task persistence.

##### High-Level Architectural Components
a. User Interface (UI):
- The UI is implicitly provided through various modules (e.g., Menu/Menu.py, styles.py) and possibly through Tkinter interfaces.
- It is responsible for displaying menus (Menu module) and forms for login and task management.

b. Authentication Module:
- Directory: Login
- Contains files for handling user authentication, including logging in (login.py) and creating users (createUser.py), as well as any utility authentication functions (auth.py).
- Interacts with a JSON file (users.json) for temporary or persistent user information.

c. Task Management Module:
- Directory: Tasks
- Contains scripts for handling CRUD operations on tasks (e.g., CreateTasks.py, DeleteTask.py, updateTask.py, CompleteTask.py, showAllTasks.py) as well as database query routines (db_queries.py).
- This module directly interacts with the MySQL database (as set up by the provided SQL script in the README).

d. Central Application Bootstrap & Configuration:
- Program_Main.py: Acts as the main entry point, responsible for bootstrapping and orchestrating the various modules.
- config.py and globals.py: Hold configuration data (such as database connection info, credentials, or other settings) and global variables/constants.
- README.md: Provides installation instructions and architectural clues, like dependencies and setup details.
- styles.py: Likely defines UI styling, ensuring a uniform look and feel.

##### Data Flow and Relationships
- The main program (Program_Main.py) initializes the application by loading configuration settings (from config.py and globals.py), and then routes the flow either into the Login module (for authentication) or directly to the Menu and Task management components.
- The Login module processes user credentials; after a successful login, the application transitions to the Menu module.
- The Menu module acts as a navigation layer that directs users to different task-related views.
- Task operations are handled by the Tasks module. These operations interact with the MySQL database through functions defined in db_queries.py.
- Users’ actions on the UI (such as creating, updating, or deleting tasks) trigger calls to the respective modules, which in turn execute SQL commands on the TaskManager database.
- Important external interactions include:
- MySQL database for persistent task storage.
- External libraries: Tkinter (GUI), Pillow (image support), bcrypt (secure password handling), and tkcalendar (date selection).

##### Architectural Patterns and Design Principles
- Modular Design: The project is cleanly divided into separate directories based on functionality (Login, Menu, Tasks). This separation simplifies understanding and maintenance.
- Separation of Concerns: Authentication, UI navigation, and task management responsibilities are clearly separated.
- Configuration Management: Dedicated configuration (config.py) and global settings (globals.py) files centralize environmental settings and constants.
- Object-Oriented or Procedural: The project might follow a procedural style given the file structure, but the separation hints at a simple MVC-like layout where the controllers (e.g., Login and Tasks modules) handle user actions and communicate with the data source.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Main["Program Main"]:::main

    subgraph "Configuration & Globals"
        C1["Configuration"]:::config
        C2["Globals"]:::config
        C3["Documentation"]:::config
    end

    subgraph "User Interface (UI Layer)"
        UI1["Menu"]:::ui
        UI2["Styles"]:::ui
    end

    subgraph "Authentication Module"
        A1["Login"]:::auth
        A2["Create User"]:::auth
        A3["Auth Logic"]:::auth
        A4["User Data"]:::auth
    end

    subgraph "Task Management Module"
        T1["Create Task"]:::task
        T2["Delete Task"]:::task
        T3["Update Task"]:::task
        T4["Complete Task"]:::task
        T5["Show Tasks"]:::task
        T6["DB Queries"]:::task
    end

    DB["MySQL Database"]:::db

    %% Main Application flows
    Main -->|"loads"| C1
    Main -->|"loads"| C2
    Main -->|"reads"| C3
    Main -->|"initiates"| A1
    Main -->|"initiates"| UI1

    %% Authentication interactions
    A1 -->|"onSuccess"| UI1
    A1 -->|"calls"| A2
    A1 -->|"uses"| A3
    A1 -->|"reads"| A4

    %% UI triggering Task operations
    UI1 -->|"triggers"| T1
    UI1 -->|"triggers"| T2
    UI1 -->|"triggers"| T3
    UI1 -->|"triggers"| T4
    UI1 -->|"triggers"| T5

    %% Task Management database interaction
    T1 -->|"executes"| T6
    T2 -->|"executes"| T6
    T3 -->|"executes"| T6
    T4 -->|"executes"| T6
    T5 -->|"executes"| T6

    T6 -->|"queries"| DB

    %% Configuration dependencies to modules
    C1 ---|"config"| A1
    C1 ---|"config"| T6
    C2 ---|"globals"| T6

    %% Styles for color coding
    classDef main fill:#f9c,stroke:#333,stroke-width:2px;
    classDef config fill:#bbf,stroke:#333,stroke-width:2px;
    classDef ui fill:#cfc,stroke:#333,stroke-width:2px;
    classDef auth fill:#fcf,stroke:#333,stroke-width:2px;
    classDef task fill:#cff,stroke:#333,stroke-width:2px;
    classDef db fill:#ffe,stroke:#333,stroke-width:2px,stroke-dasharray: 5, 5;

    %% Click Events for Central Application Bootstrap & Configuration
    click Main "https://github.com/josejimenez-m/taskmanager/blob/main/Program_Main.py"
    click C1 "https://github.com/josejimenez-m/taskmanager/blob/main/config.py"
    click C2 "https://github.com/josejimenez-m/taskmanager/blob/main/globals.py"
    click C3 "https://github.com/josejimenez-m/taskmanager/blob/main/README.md"

    %% Click Events for User Interface (UI) Layer
    click UI1 "https://github.com/josejimenez-m/taskmanager/blob/main/Menu/Menu.py"
    click UI2 "https://github.com/josejimenez-m/taskmanager/blob/main/styles.py"

    %% Click Events for Authentication Module
    click A1 "https://github.com/josejimenez-m/taskmanager/blob/main/Login/login.py"
    click A2 "https://github.com/josejimenez-m/taskmanager/blob/main/Login/createUser.py"
    click A3 "https://github.com/josejimenez-m/taskmanager/blob/main/Login/auth.py"
    click A4 "https://github.com/josejimenez-m/taskmanager/blob/main/Login/users.json"

    %% Click Events for Task Management Module
    click T1 "https://github.com/josejimenez-m/taskmanager/blob/main/Tasks/CreateTasks.py"
    click T2 "https://github.com/josejimenez-m/taskmanager/blob/main/Tasks/DeleteTask.py"
    click T3 "https://github.com/josejimenez-m/taskmanager/blob/main/Tasks/updateTask.py"
    click T4 "https://github.com/josejimenez-m/taskmanager/blob/main/Tasks/CompleteTask.py"
    click T5 "https://github.com/josejimenez-m/taskmanager/blob/main/Tasks/showAllTasks.py"
    click T6 "https://github.com/josejimenez-m/taskmanager/blob/main/Tasks/db_queries.py"
```
