Task Tracker Canister is a decentralized task management system built using the Internet Computer (IC) platform. This project allows users to create, manage, update, and track tasks with a clear structure, making it a useful tool for personal task management or team collaboration.
It leverages REST APIs combined with TypeScript, Azle, Express, and the Internet Computer Protocol to ensure decentralized computation and data storage, bringing increased efficiency and speed to task management.
- Create Tasks: Users can add new tasks with details such as title, description, category, priority, and deadline.
- Retrieve Tasks: Fetch all tasks or specific tasks by task ID.
- Update Tasks: Modify task details, such as updating its description or priority.
- Complete Tasks: Mark tasks as completed.
- Delete Tasks: Remove tasks from the system.
- TypeScript: Type-safe JavaScript for easier code management.
- Azle: A framework for developing canisters on the Internet Computer using TypeScript.
- Express: Minimal web framework for building REST APIs.
- Internet Computer: Decentralized cloud infrastructure for scalable web applications.
To set up and run the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/your-username/task-tracker-canister.git
-
Install dependencies: Navigate to the project folder and install Node.js packages:
cd task-tracker-canister npm install
-
Start the Internet Computer locally: Use DFX to start the local Internet Computer network:
dfx start --host 127.0.0.1:8000 --clean --background
-
Deploy the canister: Deploy the canister code to the local IC instance:
dfx deploy
Once the canister is deployed, you can make API requests to interact with the task tracker. Follow these steps to get the URL and start using it:
-
Get the deployed canister's ID:
dfx canister id task_tracker
-
Replace the canister ID in the following URL format:
http://<CANISTER_ID>.localhost:8000
Example CANISTER_ID (bkyz2-fmaaa-aaaaa-qaaaq-cai)
http://bkyz2-fmaaa-aaaaa-qaaaq-cai.localhost:8000
-
Method:
POST
-
Endpoint:
/tasks
-
Description: Creates a new task.
Request Body:
{ "title": "Complete IC project", "description": "Finalize the Internet Computer project", "category": "work", "priority": "high", "deadline": "2023-12-31T23:59:59Z" }
Example
curl -X POST http://<CANISTER_ID>.localhost:8000/tasks -H "Content-Type: application/json" -d '{"title": "Complete IC project", "description": "Finalize the Internet Computer project", "category": "work", "priority": "high", "deadline": "2023-12-31T23:59:59Z"}'
- Method:
GET
- Endpoint:
/tasks
- Description: Retrieves all tasks.
Example
curl -X GET http://<CANISTER_ID>.localhost:8000/tasks
- Method:
GET
- Endpoint:
/tasks/:id
- Description: Retrieves a specific task by its ID.
Example
curl -X GET http://<CANISTER_ID>.localhost:8000/tasks/<TASK_ID>
-
Method:
PUT
-
Endpoint:
/tasks/:id
-
Description: Updates a task by its ID.
Request Body:
{ "description": "Updated task description", "priority": "medium" }
Example
curl -X PUT http://<CANISTER_ID>.localhost:8000/tasks/<TASK_ID> -H "Content-Type: application/json" -d '{"description": "Updated task description", "priority": "medium"}'
-
Method:
PUT
-
Endpoint:
/tasks/:id/complete
-
Description: Marks a task as completed.
Example
curl -X PUT http://<CANISTER_ID>.localhost:8000/tasks/<TASK_ID>/complete
-
Method:
DELETE
-
Endpoint:
/tasks/:id
-
Description: Deletes a task by its ID.
Example
curl -X DELETE http://<CANISTER_ID>.localhost:8000/tasks/<TASK_ID>
I welcome contributions to this project! If you’d like to get involved, please follow these steps:
- Fork the repository.
- Create a new branch for your changes.
- Make your modifications.
- Submit a pull request.