Skip to content

ruixip/interactive-todo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Todo App with Jaseci and LLM

Created by Lucy Piao (UMID:37872192)

An intelligent Todo application built with Jac that uses AI to automatically categorize tasks, predict priorities, and assign rewards.

Demo

Todo App Demo

Features

  • ✅ Add and manage todos
  • 🤖 AI-powered automatic categorization (Work, Personal, Shopping, Health, Other)
  • 🎯 AI-predicted priority levels (Low, Medium, High)
  • ⭐ Smart reward system (None, 1-3 stars)
  • 🔄 Manual priority adjustment
  • 📊 Sort todos by priority
  • ✔️ Mark tasks as complete
  • 🗑️ Delete tasks

New Features Code Location

🎯 AI-predicted priority levels (Low, Medium, High)

  • AI model definition: main.jac - predict_priority() function uses LLM
  • Priority enum: main.jac - Defines LOW, MEDIUM, HIGH levels
  • Priority prediction in action: main.jac - Called when adding new todos

⭐ Smart reward system (None, 1-3 stars)

  • AI model definition: main.jac - predict_reward() function uses LLM
  • Reward enum: main.jac - Defines NONE, ONE_STAR, TWO_STARS, THREE_STARS
  • Reward prediction: main.jac - Considers task category and priority
  • Display in UI: main.jac - Shows reward badge for each todo

🔄 Manual priority adjustment

  • Backend update function: main.jac - update_priority() updates database
  • Frontend handler: main.jac - change_priority() updates UI state
  • UI dropdown selector: main.jac - Allows users to select Low/Medium/High

📊 Sort todos by priority

  • Backend sort function: main.jac - sort_todos_by_priority() with priority mapping
  • Frontend toggle handler: main.jac - toggle_sort() enables/disables sorting
  • UI checkbox control: main.jac - "Sort by Priority" checkbox
  • Auto-sort on changes: main.jac - Re-sorts when priority is manually changed

Prerequisites

Before you begin, ensure you have the following installed:

  • Jac (Jaseci CLI)
  • Python 3.12+

Installation

  1. Clone the repository

    gh repo clone ruixip/interactive-todo
    cd my-todo
  2. Set up your Anthropic API key

    The app uses Claude AI for intelligent features. You need an Anthropic API key:

    export ANTHROPIC_API_KEY='your-api-key-here'

Running the Application

Start the development server:

jac start main.jac

The application will automatically:

  • Install necessary dependencies
  • Build the client-side code
  • Start the development server
  • Open the app in your browser (typically at http://localhost:8000)

Usage

  1. Add a Todo: Type your task in the input field and press Enter or click "Add"
  2. AI Processing: The app will automatically:
    • Categorize the task
    • Assign a priority level
    • Suggest a reward
  3. Sort by Priority: Check the "Sort by Priority" checkbox to view tasks ordered by importance (High → Medium → Low)
  4. Change Priority: Use the dropdown menu on each task to manually adjust priority
  5. Complete Tasks: Click the checkbox to mark tasks as done
  6. Delete Tasks: Click the "X" button to remove tasks

Project Structure

my-todo/
├── jac.toml              # Project configuration
├── main.jac              # Main application (backend functions + UI)
├── styles.css            # Application styles
├── components/           # Reusable components
│   └── Button.cl.jac     # Button component
└── assets/               # Static assets

Configuration

The app uses Claude Sonnet 4 for AI features. You can modify the model in main.jac:

glob llm = Model(model_name="claude-sonnet-4-20250514");

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors