Skip to content

Sheikh-H/Sentinel-Task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

41 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ SentinelTask: Multi-User Cryptographic CLI Task Manager

A secure, multi-user command-line task management system engineered in Python.
Optimised for speed, security, and direct execution via the terminal.


πŸ“˜ Project Overview

SentinelTask is an advanced command-line interface (CLI) task tracking tool designed to allow multiple users to securely manage their tasks independently on a single terminal environment. This repository was developed specifically as a solution for the Task Tracker project on roadmap.sh.

Unlike basic single-user scripts, SentinelTask implements robust multi-user isolation by utilising secure cryptographic hashing algorithms. Each user's data is isolated, and tasks are strictly mapped to their unique user accounts. No interactive menus are used; instead, it relies entirely on direct, fast command-line arguments passed via the terminal for slick automation and scriptability.


πŸ”„ Evolution: Differences from the Old Version

SentinelTask is a complete architectural rewrite of the previous single-user Task Manager (CLI Edition). Here is a breakdown of the structural upgrades:

Feature Old Version (Task Manager) New Version (SentinelTask)
User Support Single-user only. Anyone with script access manages the same list. Multi-user workspace with explicit individual account ownership.
Security None. No authentication or encryption mechanism was present. High security. Accounts are verified using hashlib and unique salts.
Interface Design Interactive looped menus using blocking input() prompts. Direct CLI invocation passing command arguments in one line.
Task Statuses Binary state: Completed (True) or Incomplete (False). Tri-state tracking: To-Do, In-Progress, and COMPLETED.
Task Identifiers Global application ID counters across the entire file. User-scoped IDs (User A and User B can both have a Task ID #1).

🧩 Folder Structure

SentinelTask/
β”‚
β”œβ”€β”€ task-cli.py         # Application entry point & main script
β”œβ”€β”€ README.md           # Project documentation
β”œβ”€β”€ users.json          # Database file holding hashed credentials (auto-generated)
└── tasks.json          # Database file holding individual task records (auto-generated)

πŸš€ How to Run

  1. Ensure you have Python 3.8 or above installed on your operating system.
  2. Clone or download this repository locally:
    git clone https://github.com/Sheikh-H/Sentinel-Task.git
  3. Navigate directly into the project directory:
    cd SentinelTask
  4. Execute commands using the syntax options defined below. You can view the syntax manual at any time by running:
    python task-cli.py --help

πŸ–₯️ Detailed Usage & Command Manual

Since this script acts as a true CLI tool responding to arguments, execute your desired operational tasks by passing arguments directly following the script path.

1. User Account Operations

  • Register a New User:
    python task-cli.py new-user [username] [password]
  • Change an Account Password:
    python task-cli.py change-password [username] [old_password] [new_password]

2. Task Manipulation Operations

  • Create a New Task:
    python task-cli.py [username] [password] add-task "Your task title here"
  • Update an Existing Task Title:
    python task-cli.py [username] [password] update-task [task_id_or_title] "New task title"
  • Delete an Active Task:
    python task-cli.py [username] [password] delete-task [task_id_or_title]

3. Task Tracking Lifecycle Statuses

  • Mark a Task as In-Progress:
    python task-cli.py [username] [password] mark-in-progress [task_id_or_title]
  • Mark a Task as Complete:
    python task-cli.py [username] [password] mark-complete [task_id_or_title]

4. Comprehensive Viewing & Filtering Options

  • View All Tasks:
    python task-cli.py [username] [password] view
  • Filter by Category Type:
    python task-cli.py [username] [password] view [filter_phrase]
    Supported phrases include:
    • Completed tasks: done, complete, completed, finished
    • Active tasks: doing, current, currently active, active, in-progress
    • Awaiting tasks: new, to-do, todo, recent, just added

⚠️ Note: If your task title or filtering phrase contains spaces, always wrap it inside quotation marks (e.g. "Buy groceries") so the CLI interprets it correctly as a single parameter.


βš™οΈ Code Architecture & Function Breakdown

This section details how the script processes data and explains exactly what each function does under the hood:

Data Persistence

  • load_data(filename): Checks for the targeted JSON database file. If missing, it writes an empty array structure to initialise it cleanly. It opens, parses, and returns the stored data records.
  • save_data(data, filename): Flushes current in-memory global state modifications to disk using an automated two-space structural indentation layout.

Security Engine

  • new_user(username, password): Handles registration logic. It safeguards details by generating a random cryptographically secure 16-byte hex value using the secrets module. It applies a PBKDF2-HMAC-SHA256 key derivation path running 100,000 algorithmic cycles before preserving the resulting unique hash string.
  • user_login(username, password): Authenticates operational tasks. It fetches the exact individual user record, pairs the provided password attempt against the user's stored salt value, executes matching key processing iteration settings, and explicitly halts script loop flow via the error() function if mismatched.

Core Task Processing

  • add_task(username, password, task_title): Validates credentials via user_login(), checks for duplicate naming conflicts across active records, calculates a user-scoped incrementing identifier index, and maps a complete task entity containing creation timestamps.
  • update_task(username, password, task_search, new_title): Evaluates if task_search is a numerical entry or an explicit string pattern. If string matching yields ambiguous multiple results, the utility returns an intuitive prompt telling the user to use the unique numerical task ID context.
  • delete_task(username, password, task_id): Iterates sequentially over global storage scopes, maps entries containing matching ownership attributes, and removes indices targeting matching records.
  • list_task(username, password, list_type): Acts as an entry dispatcher. It processes multiple human-readable string inputs into standardized categories before querying output formatting streams.
  • view_tasks_print(user, category): Evaluates parameters to layout information fields explicitly framed inside systematic ASCII table layouts, tracing parameters like creation dates and precise adjustment timestamps.

πŸ“‚ JSON Storage Architecture

The storage layout separates users from user tasks into distinct files, tracking precise ownership keys across lists:

User Accounts File (users.json)

[
  {
    "id": 1,
    "username": "sheikh",
    "password": "a1b2c3d4e5f6g7h8i9j0...",
    "created_at": "2026-05-23 16:30:00",
    "salt": "f37a28e9d8c21b5a...",
    "last_updated": null
  }
]

Task Records File (tasks.json)

[
  {
    "id": 1,
    "user_id": 1,
    "title": "Complete Roadmap Project",
    "status": "IN-PROGRESS",
    "created_at": "2026-05-23 16:35:00",
    "updated_at": "2026-05-23 16:40:12"
  }
]

🧰 Requirements & Dependencies

  • Python Runtime: version 3.8 or above.
  • External Libraries: Completely dependency-free! Built completely using internal standard libraries (sys, json, os, time, datetime, hashlib, and secrets).

πŸ“„ Licence

This project is licensed under the MIT Licence β€” see the LICENCE file for details.

MIT Licence

Copyright (c) 2026 Sheikh Hussain

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Footnote

πŸ—£οΈ Feel free to follow, connect, and chat!

GitHub LinkedIn Gmail Portfolio

⭐ If you like this project, please give it a star on GitHub!

About

πŸ›‘οΈ SentinelTask: A secure, multi-user command-line interface (CLI) task tracking system built with Python standard libraries. Implements cryptographic isolation using salted PBKDF2-HMAC-SHA256 hashes, terminal argument parsing via sys.argv, and user-scoped auto-incrementing task IDs. Developed for the roadmap.sh Task Tracker project challenge.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages