Giter Site home page Giter Site logo

task_management_system's Introduction

Task Management System

Rust-based Task Management System

This Rust-based Canister provides a task management system that allows you to perform basic operations on tasks. It utilizes the Internet Computer Candid interface for communication and ic_cdk for initialization.

Initialization

To get started, clone the repository and navigate to the project directory:

git clone https://github.com/lxmwaniky/task_management_system.git
cd task_management_system

Prerequisites

Before running the task management system, make sure you have Rust and the Internet Computer Canister Development Kit (ic_cdk) installed. You can find the Rust infrastructure and installation instructions here.

Run Internet Computer

Start the Internet Computer Replica:

dfx start --clean --background

Deploy the Task Manager Canister:

dfx deploy task_manager_backend

This will deploy the Task Manager Canister, and you will receive output containing information about the deployed canister and its identifiers.

Functions

The task manager allows you to perform the following actions:

Create_task

Description: Creates a new task with the given title and description.

Parameters:

  • title (String): The title of the task.
  • description (String): The description of the task.

Returns:

  • id (u64): The unique identifier assigned to the newly created task.

Usage:

let task_id = create_task("Task Title".to_string(), "Task Description".to_string());

get_task

Description: Retrieves a task by its unique identifier.

Parameters:

  • id (u64): The unique identifier of the task.

Returns:

  • Option<Task>: The task if found, otherwise None.

Usage:

if let Some(task) = get_task(123) {
    // Handle the task
} else {
    // Task not found
}

get_all_tasks

Description: Retrieves all tasks currently stored.

Returns:

  • Vec<Task>: A vector containing all tasks.

Usage:

let all_tasks = get_all_tasks();
for task in all_tasks {
    // Process each task
}

update_task_status

Description: Updates the status (title, description, and completion) of a task.

Parameters:

  • id (u64): The unique identifier of the task.
  • title (String): The new title of the task.
  • description (String): The new description of the task.
  • done (bool): The new completion status of the task.

Returns:

  • bool: true if the update was successful, false otherwise.

Usage:

let updated = update_task_status(123, "New Title".to_string(), "New Description".to_string(), true);

update_task

Description: Updates either the title or description of a task.

Parameters:

  • id (u64): The unique identifier of the task.
  • title (Option): The new title of the task (if provided).
  • description (Option): The new description of the task (if provided).

Returns:

  • bool: true if the update was successful, false otherwise.

Usage:

let updated = update_task(123, Some("New Title".to_string()), None);

delete_task

Description: Deletes a task by its unique identifier.

Parameters:

  • id (u64): The unique identifier of the task.

Returns:

  • bool: true if the deletion was successful, false otherwise.

Usage:

let deleted = delete_task(123);

search_task_by_status

Description: Searches for tasks based on their completion status.

Parameters:

  • done (bool): The completion status to search for.

Returns:

  • Vec<Task>: A vector containing tasks with the specified completion status.

Usage:

let completed_tasks = search_task_by_status(true);
for task in completed_tasks {
    // Process each completed task
}

task_management_system's People

Contributors

lxmwaniky avatar coolestnick avatar maheshvishwakarma1998 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.